Skip to content

fix: better mcp sanitization - #3842

Merged
rekram1-node merged 3 commits into
anomalyco:devfrom
eddienubes:fix/mcp-tool-sanitization
Nov 3, 2025
Merged

rekram1-node merged 3 commits into
anomalyco:devfrom
eddienubes:fix/mcp-tool-sanitization

Conversation

@eddienubes

@eddienubes eddienubes commented Nov 3, 2025 •

Copy link
Copy Markdown
Contributor

Closes #3354
Closes #3245

You may read those for further background.

Repro

  1. Use https://xmcp.dev to generate a dummy MCP server with a greet tool
  2. Rename that greet tool to include a slash "/", e.g.
// ...
export const metadata: ToolMetadata = {
  name: "greet/tool",
  description: "Greet the user",
// ...
  1. Add MCP server to opencode.json in the root of the repo.
  2. Run opencode using Anthropic and ask something
    New MCP server in opencode.json 👇
"test-mcp-server": {
      "type": "remote",
      "url": "http://localhost:3001/mcp"
}

Changelog

Applied further sanitization to both tool names and client names.
Note, that I've seen a number of issues related to tool name length, I haven't looked into that yet.

Successful scenario A

CleanShot 2025-11-03 at 9  34 53@2x

Small footnote: debugging bun is such a PITA

@eddienubes eddienubes changed the title fix: better mcp tool name sanitization closes #3354 #3245 fix: better mcp tool/client name sanitization closes #3354 #3245 Nov 3, 2025
@eddienubes

Copy link
Copy Markdown
Contributor Author

@rekram1-node apologies for keeping you waiting, the PR turned out quite small and unrelated to schema.

@rekram1-node

Copy link
Copy Markdown
Collaborator

hey no need to be sorry :) I appreciate you doing this!

@rekram1-node rekram1-node changed the title fix: better mcp tool/client name sanitization closes #3354 #3245 fix: better mcp sanitization Nov 3, 2025
@rekram1-node
rekram1-node merged commit e5a651e into anomalyco:dev Nov 3, 2025
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants