CodeMode¶
CodeMode is a Go library that exposes registered, typed Go capabilities to Model Context Protocol (MCP) clients through Starlark programs. Clients use three MCP tools: search_api, describe_api, and execute. Each execute call runs Starlark in a fresh worker process, and only the final converted value returned by zero-argument main() is exposed to the caller. The pages below are organized by reader need.
Tutorials¶
Learn the workflow by building a working server.
- Build your first CodeMode server — register one typed capability and run a real stdio MCP server that an agent can call.
How-to guides¶
Complete a specific host-configuration task.
- Use Rego for authorization — replace
authz.AllowAll()with a prepared in-process Rego decision. - Disable capabilities for a deployment — remove registered capabilities from every live surface by stable capability ID.
Reference¶
Look up exact contracts, defaults, and wire shapes.
- Public API reference — exported Go types, builder lifecycle, limits, and authorization contracts.
- MCP tool reference — inputs, listed descriptions, successful outputs, and errors for the three MCP tools.
Explanation¶
Understand why the trust boundaries exist and what they do not cover.
- Understanding CodeMode's security model — identity, authorization order, worker containment, cancellation, and tenant-isolation limits.