Skip to content

[FEATURE]: Add Project-level MCP Support #9931

Description

@magicds

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Background

Currently, OpenCode uses global MCP server configuration, but there are limitations:

  1. Project-specific MCPs: Some MCP servers are only relevant to specific projects
  2. 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": {}
    }
  }
}

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions