MoonshotAI / MoonshotAI/kimi-code
Feature request: restrict MCP servers to specific models via a models field
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What feature would you like to see?
An optional models field on MCP server entries (stdio, http, and sse) that restricts a server to specific models.
Today every configured MCP server is loaded for every model. Users who mix models — for example a strong primary model and a cheaper or specialized secondary one — cannot keep tool-heavy or provider-specific MCP servers away from models that should not use them.
Proposed semantics:
modelsaccepts exact model aliases andprefix*wildcards (e.g.example-provider/*).- A server with
modelsloads only for sessions whose model matches; servers withoutmodelsload for every model as before (fully backward compatible). - Restricted servers are excluded when the session's model is unknown.
- Scoping is evaluated once at session start; mid-session model switches do not reload MCP servers.
Additional information
I searched existing issues and PRs for "MCP models", "restrict MCP", and "scope MCP" and found no prior request for per-model MCP scoping (the closest items, such as [tools].disabled filtering, are global rather than per-model).
I have a working implementation of this proposal (v1 engine, with tests and docs) that I am currently testing on my fork: https://github.com/kevingatera/kimi-code/pull/2 — happy to open it as a PR here once maintainers signal the approach is acceptable. Note the v2 engine's separate MCP stack would need a follow-up to honor the field.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the v1 engine's MCP configuration and session-start handling, then inspect the existing tests and docs mentioned in the proposal. Compare the separate v2 engine MCP stack to determine the scope of the follow-up. Done means the models field supports exact aliases and prefix* wildcards, preserves unrestricted behavior, excludes unknown models, and is covered by tests and documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100