Skip to content

Gateway MCP: projects use has no project-type guard #350

Description

@leggetter

Why

hookdeck gateway mcp refuses to start against a non-Gateway project, but places no guard on switching to one mid-session.

hookdeck_projects use <outpost-project-id> succeeds. Every Gateway tool afterwards then 404s, while the server sits there apparently healthy. Nothing tells the agent what it did, and the session is left pointing at a project it cannot serve.

This is the same failure shape v2.5.0 spent nine fixes eliminating: the CLI silently doing something other than what was asked, with the first symptom being missing data rather than an error.

Current behaviour

Startup projects use mid-session
gateway mcp rejects non-Gateway (there is a test for this) no guard — any project id is accepted
outpost mcp rejects non-Outpost Outpost projects only

The Outpost server sets a project-type filter; the Gateway server sets none.

What to do

Scope each product's MCP server to its own project type — list and switch. A server that can only serve one product should not list, or move to, projects it cannot serve.

Concretely, for gateway mcp:

  • hookdeck_projects list returns Gateway projects only
  • hookdeck_projects use refuses a non-Gateway project, with a message naming the type and pointing at the other server
  • Test covering the switch attempt, alongside the existing startup-rejection test

The mechanism already exists in the shared MCP package (ProjectFilter); Gateway just does not set it.

Considered and rejected

Listing every project with its type and refusing only on use. It gives more visibility, but shows projects the server can never act on, and makes the useful case (one product, several projects) noisier for no benefit. Filtering is the clearer contract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions