[PR #1769] [MERGED] Fix: Sanitize MCP Tool Names for Consistency in User Expectations #10056

Closed
opened 2026-02-16 18:14:37 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1769
Author: @spoons-and-mirrors
Created: 8/9/2025
Status: Merged
Merged: 8/11/2025
Merged by: @thdxr

Base: devHead: fix/mcp-tool-name-sanitization


📝 Commits (1)

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 packages/opencode/src/mcp/index.ts (+2 -1)

📄 Description

MCP tool names were inconsistent, mixing server_tool-name and server_tool_name formats
Added sanitization of tool names by replacing hyphens and spaces with underscores

This edit ensures that when users configure MCP servers, they'll have predictable naming conventions regardless of how the original tool names are formatted.

Tools like context7_resolve-library-id will now become context7_resolve_library_id, maintaining consistency across all MCP tool names.

image

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1769 **Author:** [@spoons-and-mirrors](https://github.com/spoons-and-mirrors) **Created:** 8/9/2025 **Status:** ✅ Merged **Merged:** 8/11/2025 **Merged by:** [@thdxr](https://github.com/thdxr) **Base:** `dev` ← **Head:** `fix/mcp-tool-name-sanitization` --- ### 📝 Commits (1) - [`2dcc3a6`](https://github.com/anomalyco/opencode/commit/2dcc3a69e768bb9a2dffddc2fccad6e448fda122) sanitize MCP tool name ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/mcp/index.ts` (+2 -1) </details> ### 📄 Description MCP tool names were inconsistent, mixing `server_tool-name` and `server_tool_name` formats Added sanitization of tool names by replacing hyphens and spaces with underscores This edit ensures that when users configure MCP servers, they'll have predictable naming conventions regardless of how the original tool names are formatted. Tools like `context7_resolve-library-id` will now become `context7_resolve_library_id`, maintaining consistency across all MCP tool names. <img width="375" height="282" alt="image" src="https://github.com/user-attachments/assets/ae597741-f726-40eb-8f84-75d8f938d6ce" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:37 -05:00
yindo closed this issue 2026-02-16 18:14:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10056