Skip to content

Use MCP server instructions from the initialize result #4142

Description

@glmn

What feature would you like to see?

Use the instructions an MCP server returns in its initialize result. Kimi Code currently ignores them: nothing in packages/agent-core-v2/src/mcpCore/ reads getInstructions(), so a server's usage guidance never reaches the model. Claude Code, Codex CLI and Qwen Code all put this text into the system prompt (Codex uses it as the description of the server's tool namespace).

Expected: for each connected server that returns non-empty instructions, add a short section to the system prompt, for example "MCP server <name>: ". It could have a size cap and a per-server opt-out in mcp.json.

Additional information

The spec describes instructions as hints that clients can use to improve the model's understanding of the server's tools. Servers that need cross-tool rules (call A before B, which tool to prefer, limits) put them there, because they don't fit any one tool's description.

Our case: we run Kimi Code in a desktop app (NeuroSquad) with its own MCP server, whose instructions explain how its tools fit together. For Kimi we currently copy that text into a per-session $KIMI_CODE_HOME/AGENTS.md (which reaches the system prompt). That only works because we generate a whole Kimi home per session, so it isn't an option for ordinary MCP servers.

Checked on 2.1.1 and main at 21406fb.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions