{"id":"opencode-mcp-toggle","repo":"Davnn1/opencode-mcp-toggle","url":"https://github.com/Davnn1/opencode-mcp-toggle","package":"opencode-mcp-toggle","npm":{"package":"opencode-mcp-toggle","version":"1.0.0","integrity":"sha512-/1B/QbVrXuPnzmqP4hsh3TiNYgliBYwEmdqPsjqw95uSSxRNerOn4PL3tknwE0Z8RdkgNi0VLdNx5u5Og7c8cA==","publishedAt":"2026-09-18T18:02:05.632Z","downloadsLast30Days":0},"name":"opencode-mcp-toggle","description":"Manage and toggle OpenCode MCP servers on the fly directly from Paseo to save context tokens.","categories":["orchestration","productivity"],"platforms":[],"caveats":["Requires OpenCode and Paseo >= 0.8.0"],"images":["https://raw.githubusercontent.com/Davnn1/opencode-mcp-toggle/51f7bf821f88bc04587f867e3cea4ecdbc32dccb/images/composer-pill.png","https://raw.githubusercontent.com/Davnn1/opencode-mcp-toggle/51f7bf821f88bc04587f867e3cea4ecdbc32dccb/images/mcp-manager.png","https://raw.githubusercontent.com/Davnn1/opencode-mcp-toggle/51f7bf821f88bc04587f867e3cea4ecdbc32dccb/images/mobile-sheet.jpeg"],"health":{"manifestValid":true,"hasReadme":true,"hasLicense":true,"hasTests":false,"hasTypecheckScript":true,"updatedRecently":true},"scannedAt":"2026-09-19T07:35:27.560Z","addedAt":"2026-09-19T04:17:25Z","npmSecurity":{"status":"passed","blockingFindings":0,"advisoryFindings":0,"scannedAt":"2026-09-19T07:33:01.647Z","version":"1.0.0","integrity":"sha512-/1B/QbVrXuPnzmqP4hsh3TiNYgliBYwEmdqPsjqw95uSSxRNerOn4PL3tknwE0Z8RdkgNi0VLdNx5u5Og7c8cA=="},"version":"1.0.0","security":{"status":"passed","blockingFindings":0,"advisoryFindings":0,"scannedAt":"2026-09-19T07:33:01.647Z","commit":"51f7bf821f88bc04587f867e3cea4ecdbc32dccb"},"license":"MIT","paseoVersionRequirement":">=0.8.0","manifest":{"id":"opencode-mcp-toggle","requirements":{"paseo":">=0.8.0"},"build":[["npm","install","--omit=dev"]]},"repoMeta":{"stars":0,"defaultBranch":"main","pushedAt":"2026-09-18T17:25:42Z"},"owner":{"login":"Davnn1","avatarUrl":"https://avatars.githubusercontent.com/u/128177533?v=4"},"installNotesHtml":"<p>Ensure plugins are enabled in your Paseo daemon (<code>pluginsEnabled: true</code> in <code>~/.paseo/config.json</code>).</p>\n<h3>From Git (Recommended)</h3>\n<pre><code class=\"language-bash\">paseo plugin add Davnn1/opencode-mcp-toggle\n</code></pre>\n<h3>From Local Checkout</h3>\n<pre><code class=\"language-bash\">git clone https://github.com/Davnn1/opencode-mcp-toggle.git\ncd ~\npaseo plugin install ./opencode-mcp-toggle\n</code></pre>\n<blockquote>\n<p><strong>Note</strong>: If installing from a local path on Linux AppImage, always provide a relative path (e.g. <code>./folder</code>) from your working directory.</p>\n</blockquote>\n<p>To verify the installation:</p>\n<pre><code class=\"language-bash\">paseo plugin ls\n</code></pre>\n<hr>","readmeText":"# opencode-mcp-toggle\n\n> Seamlessly toggle OpenCode MCP servers on the fly and save context tokens directly from [Paseo](https://paseo.sh).\n\n[![Paseo](https://img.shields.io/badge/Paseo-Plugin-blue)](https://paseo.sh)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\n---\n\n## The Problem: MCP Token Bloating\n\nEvery active Model Context Protocol (MCP) server injects its full tool schema (names, descriptions, parameters, validation JSON) into **every single LLM request's system prompt**. \n\nLarge 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.\n\nWhile 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**.\n\n**`opencode-mcp-toggle` bridges this gap.**\n\n---\n\n## Features\n\n- ⚡ **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.\n- 💾 **Auto-Save as Default (`opencode.json`)**:\n  - Keep **\"Save as default\"** checked (default) to persist the toggle state across restarts.\n  - Uncheck it to toggle servers temporarily for the current session only.\n- 📱 **Mobile & Desktop First**:\n  - **Desktop**: Compact, anchored inspector popover directly above the composer.\n  - **Mobile**: Native adaptive bottom sheet with gesture support.\n- 🔒 **Security Hardened**:\n  - Resolves target working directories server-side using trusted daemon agent state (prevents path traversal / CWE-22).\n  - No secrets or credentials ever cross the client RPC boundary.\n- 🚀 **Zero Configuration**:\n  - Automatically discovers running `opencode serve` daemon instances and their ports.\n  - Automatically activates in the composer bar only when interacting with OpenCode agents.\n\n---\n\n## Installation\n\nEnsure plugins are enabled in your Paseo daemon (`pluginsEnabled: true` in `~/.paseo/config.json`).\n\n### From Git (Recommended)\n\n```bash\npaseo plugin add Davnn1/opencode-mcp-toggle\n```\n\n### From Local Checkout\n\n```bash\ngit clone https://github.com/Davnn1/opencode-mcp-toggle.git\ncd ~\npaseo plugin install ./opencode-mcp-toggle\n```\n\n> **Note**: If installing from a local path on Linux AppImage, always provide a relative path (e.g. `./folder`) from your working directory.\n\nTo verify the installation:\n\n```bash\npaseo plugin ls\n```\n\n---\n\n## Usage\n\n1. Open any **OpenCode agent session** in Paseo (desktop or mobile).\n2. Look at the composer bar at the bottom: an **`[ • MCP ]`** pill will appear.\n\n<p align=\"center\">\n  <img src=\"images/composer-pill.png\" alt=\"OpenCode Composer MCP Pill\" width=\"600\" />\n</p>\n\n3. Tap the pill to open the server manager:\n\n<p align=\"center\">\n  <img src=\"images/mcp-manager.png\" alt=\"MCP Servers Manager Popover\" width=\"360\" />\n</p>\n\n   - **Flip the switch**: Instantly disconnects or reconnects the MCP server for the running session.\n   - **Save as default**: When checked, your choices are automatically saved to your workspace or global `opencode.json(c)`.\n   - If a server is toggled only for the current session without saving, it will be clearly marked with a `session only` badge.\n\n### Mobile Experience\n\nOn mobile devices, the manager seamlessly adapts into a native bottom sheet:\n\n<p align=\"center\">\n  <img src=\"images/mobile-sheet.jpeg\" alt=\"Mobile Bottom Sheet\" width=\"300\" />\n</p>\n\n---\n\n## How It Works\n\n1. **Daemon Service**: Scans active `opencode serve` instances and connects to their local HTTP management endpoints (`GET /mcp`, `POST /mcp/{name}/connect|disconnect`).\n2. **Persistence**: Parses and applies surgical edits to `opencode.json` / `opencode.jsonc` using `jsonc-parser`, preserving comments and formatting.\n3. **Client UI**: Built using React Native and Paseo's `@getpaseo/plugin` design primitives, automatically adjusting between desktop popovers and mobile bottom sheets.\n\n---\n\n## License\n\n[MIT](LICENSE) © 2026 Davnn\n"}