Contributing¶
Thanks for helping! Bug reports, MCP server compatibility reports (please include
codemode-mcp stats output) and pull requests are all welcome.
Setup¶
git clone https://github.com/shivamkr09/codemode-mcp.git && cd codemode-mcp
uv sync --all-extras # Python 3.11+; Deno comes from the `deno` wheel
uv run codemode-mcp setup # downloads Pyodide once
uv run pytest
Layout¶
| Path | What |
|---|---|
src/codemode_mcp/core.py |
CodeMode API: tool definitions, run_code, approvals, hybrid tools, accounting |
src/codemode_mcp/sandbox.py, sandbox_runner.ts |
Deno + Pyodide sandbox host and worker (JSON-lines protocol) |
src/codemode_mcp/catalog.py |
JSON Schema to Python stubs, tool search |
src/codemode_mcp/upstream.py, oauth.py |
Connections to real MCP servers (stdio / HTTP / SSE, OAuth) |
src/codemode_mcp/server.py |
MCP proxy server (tools, prompts, resources, elicitation) |
src/codemode_mcp/usage.py, dashboard.py, benchmark.py |
Token accounting, dashboard, benchmarks |
src/codemode_mcp/cli.py, clients.py |
CLI and client config import/install |
examples/ |
Demo servers (shop, 300-tool cloud, OAuth) and a benchmark |
Guidelines¶
- Run
uv run ruff check . && uv run ruff format .before pushing. - Add a focused test for every behaviour change. Integration tests start real MCP servers
from
examples/. - Anything that touches the sandbox or permissions needs a matching escape test in
tests/test_codemode.py::test_sandbox_blocks_host_access, and a note inSECURITY.md. - Keep the LLM-facing text (tool descriptions, stubs, errors) short: every token counts.
- Update
CHANGELOG.mdfor user-visible changes.
Docs¶
The documentation site (MkDocs Material) lives in docs/ and mkdocs.yml.
uv run --group docs mkdocs serve # live preview at http://127.0.0.1:8000
./scripts/deploy-docs.ps1 # or ./scripts/deploy-docs.sh: build + deploy to Vercel
vercel.json also lets Vercel build the docs straight from a Git repository (pinned
dependencies in docs/requirements.txt).
Releasing¶
- Bump
versioninpyproject.tomland__version__insrc/codemode_mcp/__init__.py, and updateCHANGELOG.md. - Rehearse on TestPyPI with
./scripts/publish-pypi.ps1 -Target testpypi, then publish with./scripts/publish-pypi.ps1 -Target pypi. The script runs the tests, builds, runstwine checkand asks for the token without showing it. - Alternatively, once the project is on GitHub, publish a GitHub release:
publish.ymluploads to PyPI with Trusted Publishing and pushes a Docker image to GHCR. - Redeploy the docs with
./scripts/deploy-docs.ps1.