modelcontextprotocol / modelcontextprotocol/csharp-sdk

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

Open
#1,202 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs confirmation
Dominant language
C#
Stars
4.5k
Forks
814
Avg merge
9d 19h
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the existing MapMcp HTTP mapping and dependency-injection registration entry points. Determine how keyed services could support multiple MCP servers and routes, with each endpoint exposing a subset of tools. Done means multiple keyed servers can be registered and mapped to distinct HTTP endpoints in one ASP.NET Core process.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.