MoonshotAI / MoonshotAI/kimi-cli
Feature Request:Dynamic Loading/Unloading of MCP Servers and Skills During Active Sessions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.4k
- Forks
- 1.3k
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 2
Description
What feature would you like to see?
Motivation
Currently, both MCP Servers and Skills are loaded once during the KimiCLI.create() startup phase:
- MCP: Configured via
kimi mcp add/removewhich modifiesmcp.json, requires CLI restart to take effect - Skills: Discovered from filesystem directories (KLIP-8 layered lookup:
~/.config/agents/skills/→.agents/skills/), scanned and registered as slash commands at startup
During long-running interactive sessions, if I want to temporarily connect an MCP Server (e.g., adding Playwright MCP for debugging) or create a new Skill file and use it immediately, the only option is /reload. While /reload does preserve the session (the _reload_loop re-enters _run with the same session_id), it triggers a full KimiCLI.create() rebuild — disconnecting all existing MCP connections, tearing down the entire toolset, and re-initializing everything from scratch.
This is particularly painful in the following scenarios:
- Exploratory development: Realizing mid-conversation that a specific MCP tool is needed (database, browser automation, etc.) —
/reloadforces reconnection of all existing MCP servers just to add one new one - Skill iteration: Writing/debugging a
SKILL.mdand wanting changes to take effect immediately —/reloadrestarts the entire tool/skill registration pipeline - SDK/Wire integration: External UI clients needing to dynamically inject MCP configurations based on user actions during a session — Wire mode has no post-
initializetool management
Proposal
1. In-Session MCP Management Slash Commands
/mcp add <name> <command/url> [--transport stdio|http] [--env K=V]
/mcp remove <name>
/mcp list
/mcp reload [name] # reconnect specified or all MCP Servers
2. Skill Hot-Reload
/skill reload # re-scan skill directories, register new skills, remove deleted ones
/skill list # list currently loaded skills
Additional information
No response
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 reading the KimiCLI.create startup path and _reload_loop, then trace how mcp.json, the layered skill directories, and Wire mode initialize MCP servers and skills. Compare the proposed /mcp and /skill commands with the current full /reload behavior. Done means supporting in-session MCP and skill updates without tearing down unrelated existing connections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100