SEP-2633: Standard Client-Side Configuration Format - mcp.json#2633
SEP-2633: Standard Client-Side Configuration Format - mcp.json#2633BobDickinson wants to merge 6 commits into
Conversation
tadasant
left a comment
There was a problem hiding this comment.
High level thought: we should probably propose this as an Extension instead of straight to core (that is likely the direction Server Card is going as well).
|
|
||
| ## Abstract | ||
|
|
||
| The MCP ecosystem has server.json (the MCP Registry package specification), and soon the related ServerCard, for describing how servers can be configured. But there's no standard for the other side: how a client will connect to its servers. |
There was a problem hiding this comment.
| The MCP ecosystem has server.json (the MCP Registry package specification), and soon the related ServerCard, for describing how servers can be configured. But there's no standard for the other side: how a client will connect to its servers. | |
| The MCP ecosystem has [server.json](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/server-json/generic-server-json.md) (the MCP Registry package specification), and soon the related [Server Card](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2127), for describing how servers can be configured. But there's no standard for the other side: how a client will connect to its servers. |
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { |
There was a problem hiding this comment.
Do we definitely want/need to define mcpServers like this?
Could we potentially scope this spec down to be "the object you put inside mcpServers"; implying the choice of e.g. mcpServers vs. servers is up to the client?
Maybe that's confusing, because then we're not really replacing what is commonly today called the .mcp.json file, we're more just replacing the object in the mcpServers field... but that also seems potentially cleaner, in that we're not trying to wholesale replace that whole file (what with e.g. VS Code's management of inputs, etc).
And maybe the design goal here is to define the whole file, so you can copy/paste the whole thing... probably don't feel strongly on this, but what do you think?
| } | ||
| ``` | ||
|
|
||
| Server names must match `^[a-zA-Z0-9_\[\]-]+$` (alphanumeric, hyphens, underscores, brackets). |
There was a problem hiding this comment.
We should probably allow for name as defined in server.json, i.e. allow . and / as part of DNS prefixing. But of course this is a "localized" name that doesn't have to align with name.
| } | ||
| ``` | ||
|
|
||
| #### streamable-http — HTTP Streaming |
There was a problem hiding this comment.
| #### streamable-http — HTTP Streaming | |
| #### streamable-http — Streamable HTTP |
|
|
||
| #### streamable-http — HTTP Streaming | ||
|
|
||
| For remote servers using HTTP streaming: |
There was a problem hiding this comment.
| For remote servers using HTTP streaming: | |
| For remote servers using streamable HTTP: |
|
|
||
| | Scheme | Description | Example | | ||
| | ------- | --------------- | ----------------------------- | | ||
| | `env` | Environment var | `env:ENV_VAR_NAME` | |
There was a problem hiding this comment.
Should we still allow for the absence of a scheme to imply env, as is probably convention out there right now, or do you think that's a bad idea for some reason?
|
|
||
| | Scheme | Description | Example | | ||
| | ------- | --------------- | ----------------------------- | | ||
| | `env` | Environment var | `env:ENV_VAR_NAME` | |
There was a problem hiding this comment.
Perhaps ironic given my ask about making this a default: but should we explicitly discourage usage of environment variables as secrets? Typical ways people inject environment variables (i.e. storing in a file and sourcing them) seems to be the pattern by which rogue agents can pick up tokens and make API calls they're not meant to have access to. And thus encouraging clients to support schemes like op might meaningfully nudge along MCP security posture.
Co-authored-by: Tadas Antanavicius <[email protected]>
|
looking at some real world use cases, I think the I've written up the publisher-side half of this as a separate SEP — SEP-2742 (the menu shape that a Server Card / The short version of what I think is missing here:
|
|
A data point from the stdio side. With Server Card now card-only (experimental-ext-server-card#28), the npm + stdio install path is the piece without a worked answer in the spec (issue #2963 landed here for that reason), and from what I can see that answer is nearly there already. I maintain a small stdio server that's live in the registry (io.github.addiplus/vercel-deployment-mcp, v0.1.0). Its server.json declares the npm package with a stdio transport [1] and its env vars with isRequired/isSecret [2]. From those two blocks the client config is almost entirely derivable — everything but the runtime convention: {
"command": "npx",
"args": ["-y", "@addiplus/[email protected]"],
"env": { "VERCEL_TOKEN": "<prompt the user; declared isSecret>" }
}That config works today against the published package, and the optional VERCEL_TEAM_ID drops out because it's isRequired: false; the mapping is field-sensitive, not a hardcoded template. The npx choice is the undeclared part, which is exactly what a written mapping would pin down. What can't be derived at all (integrity digests, consent text, re-approval policy — what HarperZ9 raised on #2963) reads like requirements for this SEP rather than registry schema changes. Registry PR #1364 (postInstallInstructions) fits the same split: the registry describes, the client derives. So a concrete suggestion: include the npm+stdio mapping as a worked conformance example (registry entry in, mcp.json out), and let that example define which server.json fields are load-bearing for install. It would also help registry#749, which is parked pending this kind of standardization. Happy for this server.json to be the example's input if that saves anyone time; its config handling is pinned by tests at the tag [3]. Want me to draft that example section? [1] https://github.com/addiplus/vercel-deployment-mcp/blob/v0.1.0/server.json#L11-L19 |
The MCP ecosystem has server.json (the MCP Registry package specification), and soon the related ServerCard, for describing how servers can be configured. But there's no standard for the other side: how a client will connect to its servers.
Today every MCP client invents its own format for server configuration. Clients use different file names, and even different file types (JSON, JSONC, and TOML). They use different top-level keys (including "servers" and "mcpServers"). They use different values for the
typefield. They use different mechanisms and encodings for secret interpolation. The list goes on. This makes it hard to share MCP server configurations across clients.mcp.json is a proposal for a minimal, client-side configuration format that any MCP client can adopt, and that will provide interoperability of MCP server configurations across clients.
Note: Initial draft is opinionated with many decisions made by the author. These decisions should be considered a starting point for discussion.