Add MCP site targeting (#72)#111
Merged
Merged
Conversation
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/mcp/tools/core.ts (1)
1326-1334: 💤 Low valueMinor: Handler signature inconsistent with similar tools.
The handler ignores parameters, but for consistency with other no-argument tools like
ghost_site_info(line 1323), consider matching the pattern:- async () => toolResult(await listConfiguredSites()), + async (_global) => toolResult(await listConfiguredSites()),This clarifies that the tool intentionally doesn't use the global context (since it reads from local config rather than making API calls).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mcp/tools/core.ts` around lines 1326 - 1334, The handler for the ghost_site_list tool currently ignores parameters; change its signature to explicitly accept the same parameters used by similar no-argument tools (e.g., accept the global/context param) so it matches the pattern of ghost_site_info; update the anonymous async handler passed to registerGhostTool (referencing registerGhostTool, toolResult, and listConfiguredSites) to take the global argument (even if unused) and then call toolResult(await listConfiguredSites()) to make the unused global explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/mcp/tools/core.ts`:
- Around line 1326-1334: The handler for the ghost_site_list tool currently
ignores parameters; change its signature to explicitly accept the same
parameters used by similar no-argument tools (e.g., accept the global/context
param) so it matches the pattern of ghost_site_info; update the anonymous async
handler passed to registerGhostTool (referencing registerGhostTool, toolResult,
and listConfiguredSites) to take the global argument (even if unused) and then
call toolResult(await listConfiguredSites()) to make the unused global explicit.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 47e6b6a1-4336-4fb5-92da-ad2150287e76
📒 Files selected for processing (5)
AGENTS.mdREADME.mdsrc/mcp/tools/core.tstests/mcp-core-tools.test.tstests/mcp-http-integration.test.ts
MCP tools need to operate across multiple configured Ghost sites without requiring one server process per site. This adds a shared MCP tool wrapper that accepts an optional site alias, validates it, scopes connection resolution per call, and strips the routing argument before downstream Ghost API calls. Adds ghost_site_list for credential-safe site discovery and covers per-call routing, omitted arguments, schema visibility, and credential omission in tests. Closes #72
b64ac60 to
710c95d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
siteargument to MCP tools so one server can target multiple configured Ghost sitesghost_site_listfor credential-safe alias discoveryWhy
A single MCP server should be able to operate across configured Ghost instances without requiring one MCP process per site. The
siteargument acts as a routing selector only: it is validated with the existing site alias schema, applied to connection resolution, and stripped before downstream Ghost API calls.Closes #72
Validation
pnpm vitest run tests/mcp-core-tools.test.ts tests/mcp-http-integration.test.tspnpm lint && pnpm typecheck && pnpm test && pnpm buildNote:
pnpm lintexits successfully but still reports existing Biome optional-chain warnings outside this change.