orcho-mcp
AGENTS.md4 starsChanged 5 months agoApache-2.0View on GitHub
This file applies to orcho-mcp/. orcho-mcp is the Apache-2.0 public Model Context Protocol server. It exposes orcho-core to Claude Code, Cursor, Zed, and other MCP-speaking clients. Also obey the workspace-level ../AGENTS.md. More specific instructions live near the code they govern: When working on this repo inside the Orcho workspace, follow ../DEVELOPMENT_PIPELINE.md. That manual pipeline governs direct source development only; it is separate from Orcho-managed worktree runs. Stable Orcho is a pipx install (venv at $HOME/.local/pipx/venvs/orcho, shims in $HOME/.local/bin). Do not…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- docs/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- orcho-mcpSkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 24
When working on this repo inside the Orcho workspace, follow ../DEVELOPMENT_PIPELINE.md.
- Very specific: line 49
Use python -m orcho_mcp in tests and smoke checks when reproducibility across pip-install state matters.
- Distinctive: line 54
Use the four-layer test pyramid.
- Very specific: line 72
Do not use print() in handler code paths.
- Very specific: line 74
Keep __main__.py present. Tests use python -m orcho_mcp.
- Very specific: line 76
Keep JSON Schema in tools/list aligned with Pydantic models.
- Distinctive: line 85
When adding or changing MCP behaviour:
- Very specific: line 92
Run pytest -q tests/unit/architecture before claiming a change commit-ready.
- Very specific: line 96
Every orcho-core change that can affect MCP-visible behaviour must ship with an orcho-mcp E2E mock smoke in the same commit, even when the …
- Very specific: line 113
If types or wire format change, update orcho-mcp in the same commit.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.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.
Files
orcho-mcp Instructions
Scope
This file applies to orcho-mcp/.
orcho-mcp is the Apache-2.0 public Model Context Protocol server. It exposes
orcho-core to Claude Code, Cursor, Zed, and other MCP-speaking
clients.
Also obey the workspace-level ../AGENTS.md.
Local Instruction Files
More specific instructions live near the code they govern:
docs/AGENTS.md— public documentation style and canonical doc ownership.tests/AGENTS.md— test layer rules, fixtures, and architecture contracts.src/orcho_mcp/AGENTS.md— source package boundaries and adapter rules.src/orcho_mcp/supervisor/AGENTS.md— subprocess lifecycle invariants.
Workspace Development Pipeline
When working on this repo inside the Orcho workspace, follow
../DEVELOPMENT_PIPELINE.md. That manual pipeline governs direct source
development only; it is separate from Orcho-managed worktree runs.
Stable Install Is Read-Only
Stable Orcho is a pipx install (venv at $HOME/.local/pipx/venvs/orcho,
shims in $HOME/.local/bin). Do not edit files inside that venv directly.
Change the canonical workspace repos and promote with orcho-promote; touch
the stable install only when the user explicitly asks to debug or repair it.
Build, Run, And Test
pip install -e ".[dev]"
pytest
pytest -m mcp_integration
orcho-mcp
python -m orcho_mcpThe default pytest suite covers L1 unit, L2 registration, and L3 stdio E2E.
The mcp_integration marker runs slower L4 subprocess and --mock pipeline
coverage.
Use python -m orcho_mcp in tests and smoke checks when reproducibility across
pip-install state matters.
Test Methodology
Use the four-layer test pyramid. Each layer catches a different class of bug:
| Layer | What | Catches | Misses |
| L1 pure unit | Call @mcp.tool handlers as plain Python functions with synthetic fixtures | Business logic, edge cases, error mapping, Pydantic round-trip | stdio, registration, capability negotiation, dual-import |
| L2 server registration | In-process await mcp.list_tools() against the FastMCP instance | Dual-import bugs, missed imports, JSON Schema generation failures | Wire format, stdio purity |
| L3 stdio E2E | Subprocess plus mcp.client.stdio.stdio_client, ClientSession.initialize(), call_tool, list_resources, list_prompts | stdout pollution, capability negotiation, JSON-RPC framing | Pipeline lifecycle |
| L4 mock integration | Real subprocess pipeline through Orcho's --mock provider | Subprocess lifecycle, watch/progress notifications, race conditions | — |
The detailed testing guide is docs/testing.md. Do not ship a change with only
L1 green when L2 or L3 applies. If the LLM client cannot see the MCP surface,
the change is not complete.
MCP Anti-Patterns
FastMCPmust be instantiated ininstance.py; everything imports the shared instance from there. Otherwise one import path can register tools on a different instance than the server process exposes.- Do not use
print()in handler code paths. stdout is reserved for protocol frames. Configure logging to stderr. - Keep
__main__.pypresent. Tests usepython -m orcho_mcp. - Preserve
progressTokenlifecycle behavior for progress notifications. - Keep JSON Schema in
tools/listaligned with Pydantic models. Snapshot-test againstdocs/mcp_schema.jsonand regenerate the snapshot when contracts intentionally change.
Architecture Boundary Contract
The current architecture is described in docs/architecture/mcp_boundaries.md
and enforced by the guards under tests/unit/architecture/.
When adding or changing MCP behaviour:
- Tool handlers stay in
tools.py; implementation lives in the matching domain module (services/,observe/,run_control/,inspection/,authoring/). - Resource handlers stay in
resources/; SDK and file reads go throughservices/. - New production domains add or update
tests/unit/<domain>/in the same commit. - Public MCP catalog changes keep
docs/mcp_schema.jsonin sync. - Run
pytest -q tests/unit/architecturebefore claiming a change commit-ready.
Cross-Repo Validation Rule
Every orcho-core change that can affect MCP-visible behaviour must ship with
an orcho-mcp E2E mock smoke in the same commit, even when the wire format
appears unchanged.
Completion requires:
- Code and tests green.
- Architecture note written when needed.
- Schema/API documented.
- An
orcho-mcpE2E mock smoke passes for at least one touched mode:
mcp__orcho__orcho_run_start(project_dir=<orcho-core>, mode=<full|task|review>, mock=true, max_rounds=1)Then call orcho_run_status(run_id) and verify the session shape.
If types or wire format change, update orcho-mcp in the same commit. Use a
bundle-style commit message such as:
feat(redesign,mcp): <core changes> + matching MCP surface.
Wire-format-changing work needs the matching schema snapshot and MCP smoke. Most behavioural-only work only needs the smoke.
Current API Status
For v0.1.0, read tools, resources, prompts, supervisor-backed run control,
progress over progressToken, phase-handoff decisions, inspection slices, and
authoring helpers are part of the active MCP surface. Keep the API additive
until the release line is cut.
Pointers
- MCP wire schema snapshot:
docs/mcp_schema.json - Core cross-project execution flow:
../orcho-core/docs/architecture/cross_project_pipeline.md
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
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.

