MoonshotAI / MoonshotAI/kimi-code

Feature request: restrict MCP servers to specific models via a models field

Open
#2,480 0 comments 0 reactions 0 assignees View on GitHub

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:

  • models accepts exact model aliases and prefix* wildcards (e.g. example-provider/*).
  • A server with models loads only for sessions whose model matches; servers without models load 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.