Skip to content

Host multiple MCP servers with different HTTP endpoints in one process using keyed services #1202

@flensrocker

Description

@flensrocker

Is your feature request related to a problem? Please describe.

In my "modulith" (ASP.NET Core) application I want to provide multiple MCP servers/endpoints, so that every endpoint delivers a subset of tools, so that MCP clients are not "overwhelmed" by the amount of tools.

Describe the solution you'd like

I would like to register multiple MCP server as keyed services in dependency injection and call MapMcp multiple times with different routes providing the key used for the keyed services.

builder.AddKeyedMcpServer("key", ...) // etc.

app.MapKeyedMcp("key", "/mcp/key", ...) // etc.

Describe alternatives you've considered

I haven't considered alternatives, because keyed services seems natural for me. Only viable alternative would be "going microservices" and split the application into multiple containers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions