Skip to content

fix(mcp): scope gateway mcp projects list/use to Gateway projects - #505

Open
pcbeingused333 wants to merge 1 commit into
hookdeck:mainfrom
pcbeingused333:fix/gateway-mcp-outpost-projects
Open

pcbeingused333 wants to merge 1 commit into
hookdeck:mainfrom
pcbeingused333:fix/gateway-mcp-outpost-projects

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #350
Related: #434 (same mid-session gap; #350 settles the asymmetry it asks about)

hookdeck gateway mcp refuses to start against a non-Gateway project, but hookdeck_projects use <outpost-project-id> mid-session succeeded and left every Gateway tool returning 404. The Outpost server already sets ProjectFilter; the Gateway server did not.

NewServer for the Gateway MCP server now sets ProjectFilter to the Event Gateway type. Console projects are Event Gateway projects with a different entry point (config.IsGatewayProject), so the shared filter matching (matchesProjectFilter) accepts both for the Gateway filter. The same helper is used in the login project-mismatch check, otherwise a console project signed in via hookdeck_login would have been rejected (TestLoginTool_PollSurvivesAcrossToolCalls caught this). projects list now returns Gateway projects only, and projects use on any other project is refused with a message that names the type and points at the other product's MCP server. The active project stays unchanged.

Tests: TestProjectsList_OnlyGatewayProjects and TestProjectsUse_RefusesOutpostProject in pkg/gateway/mcp/server_test.go, using a mixed event_gateway/console/outpost project list. Both fail on main (the Outpost project is listed and use succeeds) and pass with this change; pkg/gateway/mcp, pkg/mcpcore, pkg/outpost/mcp and pkg/cmd tests pass.

This change was prepared with AI assistance.

The Gateway MCP server set no ProjectFilter, so hookdeck_projects use
accepted an Outpost project and every later Gateway call 404ed. Set
ProjectFilter to the Event Gateway type; the filter treats console
projects as Gateway projects (also in the login mismatch check), and the
refusal now points at the other product's MCP server.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway MCP: projects use has no project-type guard

1 participant