fix(anthropic): use Claude Code-compatible MCP tool prefix for OAuth#17681
Open
JayGwod wants to merge 1 commit into
Open
fix(anthropic): use Claude Code-compatible MCP tool prefix for OAuth#17681JayGwod wants to merge 1 commit into
JayGwod wants to merge 1 commit into
Conversation
Author
|
Bumping — open for ~2 days. Status on current upstream/main (
Context: this is the prefix companion to the Happy to take feedback if you'd prefer this fold into a different code path. Thanks! |
31f8e92 to
7ec9dd1
Compare
b2849ab to
0fbddca
Compare
d3d36a7 to
2d9e685
Compare
2d9e685 to
1725d32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcp__as the MCP tool-name prefix for native Anthropic OAuth requests.tool_useresponses back into Hermes tool calls.Why
Claude Code's Anthropic OAuth tool protocol uses a double-underscore MCP marker, for example:
Hermes was previously emitting a single-underscore marker on the native Anthropic OAuth path:
That can make Hermes OAuth tool requests diverge from the Claude Code-compatible shape even though the request is otherwise using Claude Code/OAuth beta headers. Using the same
mcp__marker makes the OAuth tool schema consistent with Claude Code-style MCP tool naming.This PR is intentionally scoped only to tool-name compatibility. It does not claim to change Anthropic account/billing behavior such as extra-usage gating.
Tests
./venv/bin/python -m py_compile agent/anthropic_adapter.py agent/transports/anthropic.py ./venv/bin/python -m pytest -o 'addopts=' tests/agent/test_anthropic_adapter.py -qResult:
Additional sanity checks verified:
mcp__terminal.mcp__terminalback to Hermes tool nameterminal.