Feature hasn't been suggested before.
Describe the enhancement you want to request
Background
Currently, OpenCode uses global MCP server configuration, but there are limitations:
- Project-specific MCPs: Some MCP servers are only relevant to specific projects
- Per-project authentication: Different projects may require different authentication configurations for the same MCP server (e.g., GitLab MCP with different tokens for different repositories)
Solution
OpenCode should support project-level MCP configuration, similar to Claude Code's implementation documented at https://code.claude.com/docs/en/mcp#project-scope
Users should be able to create a .mcp.json file in the project root directory with project-specific MCP server configurations.
Example .mcp.json file:
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "@zereight/mcp-gitlab"],
"env": {
"GITLAB_TOKEN": "project-specific-token"
}
},
"custom-tool": {
"command": "node",
"args": ["/path/to/project-specific/mcp/server"],
"env": {}
}
}
}
Feature hasn't been suggested before.
Describe the enhancement you want to request
Background
Currently, OpenCode uses global MCP server configuration, but there are limitations:
Solution
OpenCode should support project-level MCP configuration, similar to Claude Code's implementation documented at https://code.claude.com/docs/en/mcp#project-scope
Users should be able to create a
.mcp.jsonfile in the project root directory with project-specific MCP server configurations.Example
.mcp.jsonfile:{ "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "@zereight/mcp-gitlab"], "env": { "GITLAB_TOKEN": "project-specific-token" } }, "custom-tool": { "command": "node", "args": ["/path/to/project-specific/mcp/server"], "env": {} } } }