Skip to content

[feature] Mount an imported MCP router's tools beside an app's own tools at the same level #2286

Open

Description

@bierlingm

The problem

An app that wraps an imported MCP server can't add its own tools at the top level. These are the only two router() overloads (apps@0.0.1-beta.34, unchanged in 0.0.1-beta.84 / Executor 2.0.0-beta.16):

router(children: Record<string, RouterChild>, options?)
router(source: RouterDeclaration, options)   // only overrides metadata

So with

tools: router(withApprovals(await mcpRouter({ url }), policy), { title: "cass" })

the MCP tools are tools.cass.cass_search and so on. To add one app-owned tool (for us, a feedback.* router), the MCP router has to move under a key: router({ sessions: mcpSource, feedback: feedbackRouter }). That renames every imported tool to tools.cass.sessions.cass_search and breaks existing callers and instructions. We deployed exactly that on self-host 2.0.0-beta.10, then reverted it for this reason.

Proposed shape

Let a router mix an imported source's tools with its own children at the same level. For example:

  • router({ ...mcpSource, feedback }), or a mergeRouters(mcpSource, router({ feedback })) helper.
  • Or an option such as router({ "": mcpSource, feedback }) that mounts a source at the parent path.

Name collisions could fail at evaluation, the way duplicate keys do today. Lazy and dynamic resolution of the imported source should keep working: names that don't match a static child would be forwarded to the source.

Alternatives

  • Mount under a sub-key: this breaks tool paths.
  • A dynamicRouter that re-lists the MCP tools and resolves app tools by hand: this duplicates mcpRouter and loses its caching and approvals wiring.
  • A separate app: an extra install just to hold one tool, and cross-app calls are deferred.

Where it belongs

Executor Cloud, Self-host (Docker), Self-host (Cloudflare), CLI

Before you submit

  • I searched the open issues for a duplicate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions