How to Use MCP in OpenCode Without Eating Into Your LLM Context Window

by HarshJan 12, 20261 min read
MCP

OpenCode has recently gained significant popularity in the open-source space. It’s an alternative to Claude Code.

But what if I told you could 100x your Opencode experience with just one MCP? Yes, with Rube, that’s totally possible. But wait, what is possible?

After building a thousand managed MCP integrations and speaking with countless users, we found that while MCP is a force multiplier, it still has physical limitations. Adding even a single GitHub server will take 20k tokens from your LLM's context window; adding Jira/Linear, Supabase, etc., will essentially choke the models. There is nothing novel in it; most industry folks are already aware of this.

So, how do we solve this?

By exposing a few meta tools (Search, Planner, Bash, Remote Workbench, etc). When the agent searches for tools, the search tool fetches only relevant tools from Composio-managed apps, ensuring the LLM's context space remains clean.

For complex issues, it uses a remote workbench or a bash script to chain multiple tools together, and instead of dumping the large artefacts directly into the context, Rube stores them in a file system and fetches the results as needed.

There’s more to it: OAuth handling, healing loop when tool execution fails, and more.

H
AuthorHarsh

Share