paseo.cafe
All plugins

opencode-mcp-toggle

by Davnn1

Manage and toggle OpenCode MCP servers on the fly directly from Paseo to save context tokens.

v1.0.0 Requires Paseo >=0.8.0

Gallery

Install

npmjs · Paseo 0.9+

paseo plugin add npm:opencode-mcp-toggle@1.0.0

GitHub · Paseo 0.8 fallback

paseo plugin add Davnn1/opencode-mcp-toggle --ref 51f7bf821f88bc04587f867e3cea4ecdbc32dccb

Git security status and fallback installation are pinned to commit 51f7bf821f88.

From the plugin's README

Ensure plugins are enabled in your Paseo daemon (pluginsEnabled: true in ~/.paseo/config.json).

From Git (Recommended)

paseo plugin add Davnn1/opencode-mcp-toggle

From Local Checkout

git clone https://github.com/Davnn1/opencode-mcp-toggle.git
cd ~
paseo plugin install ./opencode-mcp-toggle

Note: If installing from a local path on Linux AppImage, always provide a relative path (e.g. ./folder) from your working directory.

To verify the installation:

paseo plugin ls

README

opencode-mcp-toggle

Seamlessly toggle OpenCode MCP servers on the fly and save context tokens directly from Paseo.


The Problem: MCP Token Bloating

Every active Model Context Protocol (MCP) server injects its full tool schema (names, descriptions, parameters, validation JSON) into every single LLM request's system prompt.

Large MCP servers (like Jira, Playwright, Database inspectors, or Figma) easily consume 3,000 to 10,000+ tokens per turn. When these tools aren't actively needed for the current task, they waste money, degrade prompt attention, and shrink your useful context window.

While OpenCode's native terminal UI provides /mcps to enable/disable servers dynamically, Paseo currently has no native UI to manage or toggle third-party MCP servers.

opencode-mcp-toggle bridges this gap.


Features

  • 1-Click Dynamic Toggling: Enable or disable any MCP server in real time via OpenCode's internal server API. Disabling a server instantly purges its tool schemas from subsequent prompt requests.
  • 💾 Auto-Save as Default (opencode.json):
    • Keep "Save as default" checked (default) to persist the toggle state across restarts.
    • Uncheck it to toggle servers temporarily for the current session only.
  • 📱 Mobile & Desktop First:
    • Desktop: Compact, anchored inspector popover directly above the composer.
    • Mobile: Native adaptive bottom sheet with gesture support.
  • 🔒 Security Hardened:
    • Resolves target working directories server-side using trusted daemon agent state (prevents path traversal / CWE-22).
    • No secrets or credentials ever cross the client RPC boundary.
  • 🚀 Zero Configuration:
    • Automatically discovers running opencode serve daemon instances and their ports.
    • Automatically activates in the composer bar only when interacting with OpenCode agents.

Installation

Ensure plugins are enabled in your Paseo daemon (pluginsEnabled: true in ~/.paseo/config.json).

From Git (Recommended)

paseo plugin add Davnn1/opencode-mcp-toggle

From Local Checkout

git clone https://github.com/Davnn1/opencode-mcp-toggle.git
cd ~
paseo plugin install ./opencode-mcp-toggle

Note: If installing from a local path on Linux AppImage, always provide a relative path (e.g. ./folder) from your working directory.

To verify the installation:

paseo plugin ls

Usage

  1. Open any OpenCode agent session in Paseo (desktop or mobile).
  2. Look at the composer bar at the bottom: an [ • MCP ] pill will appear.
  1. Tap the pill to open the server manager:
  • Flip the switch: Instantly disconnects or reconnects the MCP server for the running session.
  • Save as default: When checked, your choices are automatically saved to your workspace or global opencode.json(c).
  • If a server is toggled only for the current session without saving, it will be clearly marked with a session only badge.

Mobile Experience

On mobile devices, the manager seamlessly adapts into a native bottom sheet:


How It Works

  1. Daemon Service: Scans active opencode serve instances and connects to their local HTTP management endpoints (GET /mcp, POST /mcp/{name}/connect|disconnect).
  2. Persistence: Parses and applies surgical edits to opencode.json / opencode.jsonc using jsonc-parser, preserving comments and formatting.
  3. Client UI: Built using React Native and Paseo's @getpaseo/plugin design primitives, automatically adjusting between desktop popovers and mobile bottom sheets.

License

MIT © 2026 Davnn

Scanned 19 Sep 2026, 04:41 UTC from Davnn1/opencode-mcp-toggle.