Problem
CodeGraph's MCP tools are named with a codegraph_ prefix (e.g., codegraph_explore, codegraph_search, codegraph_status). When used with MCP clients like OpenCode that auto-prefix all tools with the server name, this creates double-prefixed tool names:
Server name: codegraph
Tool name: codegraph_explore
Registered: codegraph_codegraph_explore
This causes two issues:
-
"Unavailable tool" errors — The model's system prompt references codegraph_explore (the natural name), but the actual registered tool is codegraph_codegraph_explore. Every call to the unprefixed name fails with:
Model tried to call unavailable tool 'codegraph_explore'
-
Ugly developer experience — codegraph_codegraph_explore is redundant and confusing. All 8 tools are affected:
codegraph_codegraph_explore
codegraph_codegraph_search
codegraph_codegraph_status
codegraph_codegraph_node
codegraph_codegraph_callers
codegraph_codegraph_callees
codegraph_codegraph_impact
codegraph_codegraph_files
Why This Happens
The MCP protocol convention is: <server_name>_<tool_name>. Most MCP servers name their tools without repeating their own name. For comparison:
| MCP Server |
Tool Name |
Registered As |
Clean? |
| socraticode |
codebase_search |
socraticode_codebase_search |
✅ |
| playwright |
browser_click |
playwright_browser_click |
✅ |
| snyk |
snyk_code_scan |
snyk_snyk_code_scan |
❌ same issue |
| codegraph |
codegraph_explore |
codegraph_codegraph_explore |
❌ |
Proposed Fix
Remove the codegraph_ prefix from tool names inside the MCP server:
| Current |
Proposed |
codegraph_explore |
explore |
codegraph_search |
search |
codegraph_status |
status |
codegraph_node |
node |
codegraph_callers |
callers |
codegraph_callees |
callees |
codegraph_impact |
impact |
codegraph_files |
files |
After the fix, MCP clients would register them as codegraph_explore, codegraph_search, etc. — clean, no duplication.
Current Workaround
We're patching oh-my-opencode's dist/index.js after every npm update to rewrite all prompt-level codegraph_explore references to codegraph_codegraph_explore. This is fragile and breaks on every update.
Environment
- CodeGraph:
@colbymchenry/codegraph@1.3.1
- MCP Client: OpenCode (oh-my-opencode 4.16.1)
- Node.js: 26.x (with Node 22 via
CODEGRAPH_NODE_BIN)
- OS: Windows 11
Problem
CodeGraph's MCP tools are named with a
codegraph_prefix (e.g.,codegraph_explore,codegraph_search,codegraph_status). When used with MCP clients like OpenCode that auto-prefix all tools with the server name, this creates double-prefixed tool names:This causes two issues:
"Unavailable tool" errors — The model's system prompt references
codegraph_explore(the natural name), but the actual registered tool iscodegraph_codegraph_explore. Every call to the unprefixed name fails with:Ugly developer experience —
codegraph_codegraph_exploreis redundant and confusing. All 8 tools are affected:codegraph_codegraph_explorecodegraph_codegraph_searchcodegraph_codegraph_statuscodegraph_codegraph_nodecodegraph_codegraph_callerscodegraph_codegraph_calleescodegraph_codegraph_impactcodegraph_codegraph_filesWhy This Happens
The MCP protocol convention is:
<server_name>_<tool_name>. Most MCP servers name their tools without repeating their own name. For comparison:codebase_searchsocraticode_codebase_searchbrowser_clickplaywright_browser_clicksnyk_code_scansnyk_snyk_code_scancodegraph_explorecodegraph_codegraph_exploreProposed Fix
Remove the
codegraph_prefix from tool names inside the MCP server:codegraph_exploreexplorecodegraph_searchsearchcodegraph_statusstatuscodegraph_nodenodecodegraph_callerscallerscodegraph_calleescalleescodegraph_impactimpactcodegraph_filesfilesAfter the fix, MCP clients would register them as
codegraph_explore,codegraph_search, etc. — clean, no duplication.Current Workaround
We're patching
oh-my-opencode'sdist/index.jsafter every npm update to rewrite all prompt-levelcodegraph_explorereferences tocodegraph_codegraph_explore. This is fragile and breaks on every update.Environment
@colbymchenry/codegraph@1.3.1CODEGRAPH_NODE_BIN)