fix: use mcp_ prefix for tools (port from pi-coding-agent)#14
Merged
rekram1-node merged 1 commit intoanomalyco:masterfrom Jan 9, 2026
Merged
fix: use mcp_ prefix for tools (port from pi-coding-agent)#14rekram1-node merged 1 commit intoanomalyco:masterfrom
rekram1-node merged 1 commit intoanomalyco:masterfrom
Conversation
- Change TOOL_PREFIX from 'oc_' to 'mcp_' - Add prefix to tool_use blocks in messages, not just tool definitions - Update stream transform regex to strip mcp_ prefix from responses
|
Question guys, im just getting used to use opencode could i temporarily clone this and test it locally like this ? so far is not working for me |
Contributor
Author
|
Use {
"plugin": [
"file://<path-to>/opencode-anthropic-auth/index.mjs"
]
} |
|
You such a genius. I can confirm this works. |
|
should i select use api keys or claude pro sub when i connect, so far is not working for me |
Contributor
Author
|
Ah yes, you should run it like this: OPENCODE_DISABLE_DEFAULT_PLUGINS=true opencode |
|
confirm !! it works ! thanks so much ! |
devxoul
added a commit
to devxoul/opencode-anythropic-auth
that referenced
this pull request
Jan 9, 2026
|
We’re so back! |
|
hi @lenstr , thanks for this solution but im getting this error: "ish: Job 1, 'OPENCODE_DISABLE_DEFAULT_PLUGIN...' terminated by signal SIGABRT (Abort)" |
Contributor
Author
|
This should be fixed in the latest opencode version. Try updating. |
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
Fixes the OAuth tool calling that broke after PR #10's
oc_prefix was blocked by Anthropic.This is a port of the solution from pi-coding-agent which encountered and fixed the same issue.
Changes
Changed prefix from
oc_tomcp_- This is what pi-coding-agent uses for Anthropic OAuth.Added prefix to
tool_useblocks in messages - PR fix: claude oauth by renaming tools on in/out #10 only prefixed tool definitions, but not tool calls in conversation history. This caused issues when the model tried to continue conversations with previous tool calls.Testing locally
git clone https://github.com/lenstr/opencode-anthropic-auth.git cd opencode-anthropic-auth git checkout fix/mcp-tool-prefixopencode.json:{ "plugin": [ "file://<path-to>/opencode-anthropic-auth/index.mjs" ] }Reference
mcp_prefix handling for OAuth tokens