opencode
opencode copied to clipboard
[FEATURE]: Let LLM enable MCP on demand, default all MCPs off
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
MCPs can increase the agent prompt significantly while oftentimes they're not even used in all sessions. Similar to skills, add (generate?) short descriptions of the MCPs and let the LLM enable them for the current session so that disabled MCPs can be activated on demand. Custom agent prompts by users and skills can also instruct the LLM to enable and use a certain MCP when the situation calls for it.
ie:
- a user tasks the LLM to create unit tests for laravel 12 using pest.
- LLM doesn't know pest so it creates an older version of PHPUnit compatible tests
- Deprecation warnings ensue
- User prompts to fix the deprecation issues with context7, but it's as yet disabled.
- LLM enables context7, reads the instructions from the MCP and queries it for PHPUnit to Pest migration instructions
- LLM fixes issues and the tests are now best practice compliant.
This way, having a large set of MCP servers doesn't give you the penalty of a overly large system prompt, saving costly tokens and making more efficient use of the context so that the LLM doesn't get confused, improving the general coding experience and code quality.