Skip to content

fix: mcp client name - #2289

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
MQ37:fix/mcp-client-name
Aug 28, 2025
Merged

rekram1-node merged 1 commit into
anomalyco:devfrom
MQ37:fix/mcp-client-name

Conversation

@MQ37

@MQ37 MQ37 commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Currently, Opencode uses the MCP config server name as the MCP clientInfo.name, which prevents MCP servers from easily identifying that the client is actually Opencode. This fix changes the clientInfo.name to a hardcoded value: "opencode". This ensures the Opencode MCP client is clearly identifiable by MCP servers, allowing them to adapt the features exposed based on supported specification features.

We are working on a package to address this, as the protocol does not support it yet. We would like to add Opencode, but without this change, we cannot: https://github.com/apify/mcp-client-capabilities

For example, if you configure opencode.json like this, the clientInfo.name in the MCP initialize request will be "testing-client" instead of a consistent identifier such as "opencode". Since each MCP client supports a different feature set, this makes it impossible to reliably identify Opencode.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "testing-client": {
      "type": "remote",
      "url": "http://localhost:3001",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer MY_API_KEY"
      }
    }
  }
}

MCP initialize request with this config, which cannot be easily identified as Opencode:

{"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"testing-client","version":"1.0.0"}},"jsonrpc":"2.0","id":0}

MCP initialize request with this config patched, now clearly identifiable by the "opencode" client name:

{"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"opencode","version":"1.0.0"}},"jsonrpc":"2.0","id":0}

@rekram1-node

Copy link
Copy Markdown
Collaborator

this makes sense, the ai sdk defaults to "name": "ai-sdk-mcp-client" but name shouldn't be the name of mcp server, it should be name of client.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants