Skip to content

Running multiple instances of same MCP server with different configs? #9634

Closed

Description

@cvrt-jh

Use Case

I need to access 2 Google Workspace accounts via the workspace-mcp server. The MCP server requires OAuth authentication on port 8000.

Problem

When configuring two instances of the same MCP in opencode.json:

{
  "google-personal": {
    "command": ["uvx", "workspace-mcp", "--single-user"],
    "environment": {
      "WORKSPACE_MCP_CREDENTIALS_DIR": "~/.google_workspace_mcp/credentials/personal",
      "USER_GOOGLE_EMAIL": "user@example.com"
    }
  },
  "google-work": {
    "command": ["uvx", "workspace-mcp", "--single-user"],
    "environment": {
      "WORKSPACE_MCP_CREDENTIALS_DIR": "~/.google_workspace_mcp/credentials/work",
      "USER_GOOGLE_EMAIL": "work@example.com"
    }
  }
}

Both instances try to use port 8000 for OAuth callback, causing conflicts.

Question

Is there a way in opencode to:

  1. Start MCP instances sequentially (so OAuth can complete one at a time)?
  2. Pass different port configurations to each instance?
  3. Any other pattern for running multiple instances of the same MCP with different credentials?

The workspace-mcp server supports WORKSPACE_MCP_PORT env var, but I'm not sure if that helps with stdio transport.

Related

Also asked on workspace-mcp repo.

Activity

  1. github-actions commented on Jan 20, 2026

    @github-actions
    Contributor

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

    Both issues describe the exact same use case (multiple Google Workspace accounts), the same MCP server (workspace-mcp), and the same port 8000 conflict problem.

    Feel free to ignore if this is a different context than the other issue.

  2. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions