MCP Protocol¶
G6 implements the Model Context Protocol (MCP), enabling AI assistants like Claude Code, Cursor, and other MCP-compatible clients to use G6 tools natively.
Scope
This page covers using G6 via MCP — what happens when you call a tool, how tools are organized, and how to get the most from them. For server deployment and infrastructure details, see MCP Base.
What is MCP?¶
MCP is a standard that lets your AI assistant call external tools as naturally as its built-in capabilities. You don't write API calls or manage HTTP requests — the protocol handles tool discovery, invocation, and result formatting automatically.
When you connect G6 as an MCP server, your assistant sees G6's tools alongside its own. You simply describe what you want ("verify this formula", "decompose this goal", "analyse this dataset") and the assistant selects and calls the right tool. The result flows back into the conversation as if the assistant computed it itself.
G6 implements MCP via the FastMCP library, supporting both remote (SSE) and local (stdio) transports.
What happens when you call a tool¶
When you ask your assistant to use a G6 capability, here is the full chain of events:
- You ask — "Prove that this formula is satisfiable"
- Your assistant discovers the tool — MCP clients enumerate available tools at connection time. The assistant matches your request to
formal_methods - JSON call over transport — The assistant sends a structured JSON request over SSE (remote) or stdio (local) to the G6 server
- Middleware checks (SSE only) — The server validates your API key, checks your tier has access to the tool, and verifies rate limits
- Server routes to the component — For a directly advertised tool the server calls its handler. For anything else the
invoke_componentdispatcher takes the component name and operation and calls that component's function through the registry - Component executes — The component runs the operation (e.g., DPLL satisfiability check) and returns a
Result[T] - Result flows back — The result is serialized to JSON, sent back over the transport, and your assistant presents it in the conversation
The entire round-trip is invisible to you — you see the request and the answer.
Reaching components that aren't tools¶
G6 advertises 262 MCP tools to clients. Components without their own tool are reached through the invoke_component dispatcher, which takes a component name, an operation, and a JSON parameter blob.
For example, formal_methods isn't a tool you call directly — it's a component you reach via invoke_component(component="formal_methods", op=...). There is no per-component gateway tool. This keeps your assistant's tool list manageable while leaving the full component registry reachable.
When you're unsure which tool to use, ask guide_ask — it searches across all operations and recommends the right one.
Transport configuration¶
G6 supports two MCP transports, selected via the MCP_TRANSPORT environment variable.
Server-Sent Events over HTTP.
Tips for effective tool use¶
- Be specific in your requests — "Prove
(A ∧ B) → Ais a tautology" works better than "check this logic" - Use
guide_askwhen unsure — It searches the tool and component surface and suggests the right tool and parameters - Check your tier on errors — If you get an access error, the tool may require a higher license tier. See tools by tier
- Pipelines over individual calls — For multi-step workflows, describe the full task and let the assistant chain tools rather than calling them one by one
- Natural language works — You don't need to know tool names. Describe what you want and the assistant will find the right tool
Authentication¶
SSE transport requires a Bearer token in the Authorization header.
Obtain API keys from your g6solver.com account.
| Outcome | Response |
|---|---|
| Missing or invalid key | {"ok": false, "error": "Invalid or expired API key..."} |
| Tier access denied | {"ok": false, "error": "Tool 'X' requires a higher license tier..."} |
| Rate limit exceeded | {"ok": false, "error": "Rate limit exceeded (N req/min)..."} |
Rate limits by tier¶
| Tier | Requests / Minute |
|---|---|
| Free Trial | 10 |
| Researcher | 100 |
| Builder | 500 |
Rate limits use a Redis sorted-set sliding window. When exceeded, the error response includes retry_after_seconds. Limits are configurable via environment variables: MCP_RATE_LIMIT_FREE, MCP_RATE_LIMIT_BASIC (Researcher), MCP_RATE_LIMIT_PREMIUM (Builder).
Session management¶
- SSE transport: Each HTTP connection is a session. The server is stateless — no session state is persisted between connections.
- stdio transport: The process lifetime is the session. The server runs until the parent process terminates the subprocess.
Server configuration¶
| Variable | Default | Description |
|---|---|---|
MCP_TRANSPORT | stdio | Transport mode: stdio or sse |
MCP_HOST | 0.0.0.0 | SSE bind host |
MCP_PORT | 8080 | SSE bind port |
REDIS_URL | redis://redis:6379/0 | Redis URL for rate limiting |
POSTGRES_PASSWORD | (none) | Enables auth middleware when set |
See also¶
- MCP Tool Catalog — browse all 262 MCP tools
- Tools by Tier — tier breakdown and access table
- Bases: MCP — deployment and infrastructure details
- REST API — alternative HTTP interface