Skip to content

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

Closed

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": {}
    }
  }
}

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 22, 2026
  2. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. magicds commented on Jan 22, 2026

    @magicds
    Author

    I couldn't find a related feature request Issue, but I did locate an already implemented pull request for this functionality.
    722

  4. sunxyw commented on Jan 22, 2026

    @sunxyw

    I believe you are able to do so by putting a opencode.json with mcps config in your project root, which will be merged with the global config.

  5. magicds commented on Jan 22, 2026

    @magicds
    Author

    I believe you are able to do so by putting a opencode.json with mcps config in your project root, which will be merged with the global config.

    Thank you so much! This is incredibly helpful.

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

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions