anomalyco / anomalyco/opencode
MCP tools not sent to local OpenAI-compatible models (empty tools array)
@jlongster is already working on this.
Since Jul 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When using a local model via an OpenAI-compatible provider (Ollama proxy), OpenCode sends tools: [] (empty array) instead of the actual MCP tool definitions. The model responds with plain text because it never receives the tool definitions.
The same configuration works correctly with the Anthropic/Claude provider.
Environment
- OpenCode: 1.18.5
- Provider tested:
@ai-sdk/openai-compatiblev3.0.7 and@ai-sdk/openaiv4.0.11 - Local model: deepseek-v4-flash-stock (also qwen3.5:9b-stock)
- Proxy: Ollama proxy (OpenAI-compatible endpoint)
- MCP servers: filesystem, fetch
- OS: Linux (CachyOS)
Steps to reproduce
- Configure local model with
"tools": truein opencode.json - Enable MCP servers (filesystem, fetch)
- Start OpenCode with local model
- Ask the model to use a tool
- Model responds with text, no tool call
Expected
Model receives MCP tool definitions and calls the appropriate tool.
Actual
OpenCode sends tools: [] (empty array). Logs show:
WARN "MCP connection closed" server=filesystem
WARN "schema rejection" kind=Payload reason="Expected object, got undefined"
Direct test (works)
Same request sent directly to the proxy WITH tool definitions → model responds with correct tool_calls. The model and proxy are not the problem.
Note
Affects both @ai-sdk/openai-compatible and @ai-sdk/openai. Does NOT occur with Anthropic/Claude provider.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.