agentleFS
sandraschisandraschi/opencode-cli-mcp/AGENTS.md

opencode-cli-mcp

AGENTS.md3 starsChanged 2 months agoMITView on GitHub

MCP server wrapping the opencode CLI (opencode serve) for AI agent orchestration: launch/poll/review agent runs, session CRUD + diff, offline session depot over the opencode SQLite DB, .mcpb installs, and graceful shutdown. Ships a unified FastAPI backend (REST /api/* + FastMCP /mcp on one port) and a Vite/React fleet-standard dashboard. - FastMCP 3.2+ portmanteau tool pattern - tools use operation enum param; responses are structured dicts with success, message, domain-specific fields. - 6 primary tools (opencode_runs, opencode_sessions, opencode_depot, opencode_system, opencode_mcpb_install,…

The file

Files
AGENTS.md

opencode-cli-mcp - Agent Guide

Overview

MCP server wrapping the opencode CLI (opencode serve) for AI agent orchestration: launch/poll/review agent runs, session CRUD + diff, offline session depot over the opencode SQLite DB, .mcpb installs, and graceful shutdown. Ships a unified FastAPI backend (REST /api/* + FastMCP /mcp on one port) and a Vite/React fleet-standard dashboard.

Quick-Ref Commands

CommandWhat it does
just serveRun MCP server (stdio)
just apiRun unified backend (api.main, :10951)
just webRun Vite frontend (:10950)
just certifyAll gates: ruff, pytest, pyright, tsc, biome
just test / just checkpytest / ruff check + format
.\start.ps1Full stack: opencode serve + backend + frontend

Ports

PortService
10950Frontend (Vite)
10951Unified backend (REST /api/* + MCP /mcp)
4097backend-owned opencode serve (NOT 4096 — the desktop app's password-locked serve lives there)

Standards

  • FastMCP 3.2+ portmanteau tool pattern - tools use operation enum param; responses are structured dicts with success, message, domain-specific fields.
  • 6 primary tools (opencode_runs, opencode_sessions, opencode_depot, opencode_system, opencode_mcpb_install, opencode_shutdown) + 15 legacy atomic aliases (0.3.0 removes them).
  • Dual transport: stdio (Claude Desktop) + unified HTTP backend (api.main).
  • See mcp-central-docs for fleet-wide standards.

Key Files

FilePurpose
src/opencode_cli_mcp/server.pyFastMCP app + http_app (CORS-wrapped ASGI)
src/opencode_cli_mcp/client.pyhttpx client → opencode serve; OPENCODE_BINARY resolution
src/opencode_cli_mcp/depot.pySession depot (direct SQLite on opencode.db)
src/opencode_cli_mcp/registry.pyShared tool definitions
api/main.pyUnified ASGI app (REST + MCP /mcp)
api/routes/capabilities.py/api/health, /api/v1/health, /api/v1/diagnostics
web_sota/src/store.tsZustand store (incl. shared llmProvider/llmModel)
run_server.pyPyInstaller entry point (OPENCODE_CLI_MCP_PORT → HTTP)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.