Skip to content

Conversation

@harshav167
Copy link
Contributor

@harshav167 harshav167 commented Jan 23, 2026

Summary

btca's internal OpenCode agent was inheriting MCP servers from the user's global ~/.config/opencode/opencode.jsonc, causing it to use external tools (perplexity, serena, etc.) instead of only searching the local cloned repo.

Problem

When running btca ask -r <resource> -q "...", the agent would call MCP tools like:

  • perplexity_search
  • perplexity_reason
  • serena_get_current_config

This happened despite tools: { mcp: false } being set in the agent config, because MCP servers were still loaded from the global config.

Solution

Added mcp: {} at the top level of the OpenCode config to explicitly prevent any MCP servers from loading. Now btca only uses the intended tools: grep, glob, list, and read.

Testing

After this fix, btca ask only searches the local cloned repo without calling external MCP tools.

Greptile Overview

Greptile Summary

This PR re-applies a fix that was lost during a refactoring. When the CLI services were reorganized (commit 5c1ea54), the mcp: {} configuration that prevented external MCP servers from loading was removed. This caused btca ask to inherit MCP servers from the user's global ~/.config/opencode/opencode.jsonc, calling external tools like perplexity_search and serena_get_current_config instead of only using local file tools.

Changes:

  • Added mcp: {} to the OpenCode config in apps/server/src/agent/service.ts:125 to explicitly disable all MCP servers
  • Added execute permission to apps/cli/bin.js

The fix ensures btca's internal agent only uses the intended local tools (grep, glob, list, read) and doesn't make external API calls when searching collections.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is minimal and well-scoped. It adds a single configuration line (mcp: {}) that explicitly disables MCP servers, which is the intended behavior. The fix re-applies a previous solution that was accidentally removed during refactoring. The change doesn't affect existing functionality - it only prevents unwanted external tool calls.
  • No files require special attention

Important Files Changed

Filename Overview
apps/cli/bin.js Added execute permission to bin.js file (file mode change only)
apps/server/src/agent/service.ts Added mcp: {} to OpenCode config to prevent loading external MCP servers

btca's OpenCode instance was inheriting MCP servers from the user's
global opencode config, causing it to use perplexity/serena/etc
instead of only searching the local cloned repo.

Adding mcp: {} to the config ensures no MCP servers are loaded,
so btca only uses grep, glob, list, and read as intended.
@bmdavis419
Copy link
Collaborator

Ah nice, this is being fixed with the agent rewrite, but still a good stopgap, ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants