Skip to content

Ground rules

Section 1 · From docs/MCP_INTERNALS.md on GitHub

These hold across the package, and reviews check for them.

  1. One path for every request. Adapters never call handlers. They call CloudGMCPLayer.call_tool, read_resource, get_prompt or complete, so policy, transforms, middleware, timeouts and audit apply the same way everywhere.
  2. Framework-free core. core.py, schema.py, context.py, layer.py, state.py, policy.py, transforms/ and native/ use the standard library, pydantic and cloudg only. mcp, fastmcp, starlette and uvicorn are imported inside functions.
  3. Wire shapes come from cloudg. Every adapter lists primitives from the layer's to_wire() dicts, so no framework re-derives a schema from a Python signature.
  4. Python 3.11 compatible, typed, line length 100 (ruff, target py311).
  5. Tests run without network access or cloud credentials. Live tools are tested with the engine monkeypatched.