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

opencode-cli-mcp

CLAUDE.md2 starsChanged 2 months agoMITView on GitHub

MCP server that wraps opencode's opencode serve HTTP API into MCP tools, with a SOTA fleet webapp dashboard. Dashboard, Sessions, Projects, Tools Hub, OC Tools, Apps Hub, Chat, Help, Settings, Status Audit, API Docs

The file

We split this CLAUDE.md into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run MCP server: uv run -m opencode_cli_mcp.server

    line 8
  2. Very specific:

    Run webapp backend: uv run python -m api.main

    line 9
  3. Very specific:

    Run webapp frontend: cd web_sota && npm run dev

    line 10

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

opencode-cli-mcp

MCP server that wraps opencode's opencode serve HTTP API into MCP tools, with a SOTA fleet webapp dashboard.

Build & Test

  • Install: uv sync
  • Run MCP server: uv run -m opencode_cli_mcp.server
  • Run webapp backend: uv run python -m api.main
  • Run webapp frontend: cd web_sota && npm run dev
  • Start all: .\start.ps1
  • Lint: uv run ruff check .
  • Test: uv run pytest
  • TypeScript check: cd web_sota && npx tsc --noEmit

Architecture

  • MCP server talks to opencode serve HTTP API (default http://127.0.0.1:4097)
  • Webapp backend (FastAPI, port 10951) bridges MCP tools to REST
  • Webapp frontend (Vite, port 10950) proxies /api to backend
  • Tools in src/opencode_cli_mcp/tools/: sessions, runs, agent, status
  • Shared tool registry in src/opencode_cli_mcp/registry.py
  • ensure_server() is wired into all session/status tools
  • OpenCode custom tools in .opencode/tools/ - TS definitions calling backend API
  • Docs served via GET /api/docs, tool source via GET /api/opencode-tools
  • Ports: 10950 frontend / 10951 backend / 4097 opencode

Key Patterns

  • opencode_run_agent(prompt, wait=false) launches background agent
  • opencode_get_run_status(job_id) polls for completion
  • opencode_session_diff(session_id) reviews changes
  • opencode_cancel_run(job_id) kills stuck agent

API Routes

PrefixPurpose
/api/capabilitiesHealth + runtime introspection
/api/opencode/*Proxy to opencode serve
/api/runs/*Agent run tracking
/api/toolsTool definitions
/api/fleetFleet app status
/api/systemOS/GPU/memory info
/api/docs/*Documentation serving
/api/opencode-tools/*OpenCode custom tool definitions
/api/settingsApp settings CRUD

Webapp Pages (11)

Dashboard, Sessions, Projects, Tools Hub, OC Tools, Apps Hub, Chat, Help, Settings, Status Audit, API Docs

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.