Skip to content

API Reference

G6 exposes its capabilities through three interfaces. This page helps you choose the right one and shows how the same operation looks in each.


Choosing your interface

MCP Protocol

Use this if you work inside an AI assistant (Claude Code, Cursor, or any MCP client). Tools are discovered automatically — you just ask your assistant to do something and G6 handles it behind the scenes.

MCP Protocol reference

REST API

Use this if you are building a web app or automation script. Standard HTTP/JSON — call endpoints with curl, fetch, or any HTTP client. No AI assistant required.

REST API reference

Core Types

Reference for understanding G6's type system — AIBlock, Result[T], protocols, and the component registry. The MCP and REST APIs are the standard integration paths.

Core type reference


The same operation, three ways

Here is goal decomposition performed through each interface:

You: Break down "Build an inventory API" into subtasks

Claude: I'll use the decompose_goal tool...
[Result: 5 subtasks with dependencies and resource bounds]
curl -X POST https://g6solver.com/api/v1/goals/decompose \
  -H "Authorization: Bearer $G6_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"goal": "Build an inventory API", "max_depth": 2}'
from mvp.goal_engine import GoalDecomposer, GoalInput

decomposer = GoalDecomposer()
result = decomposer.process(GoalInput(goal="Build an inventory API"))
print(result.value)  # SearchTree with subtasks

Source access required

Direct Python imports require access to the G6 source. The MCP and REST APIs are the standard integration paths for building on G6.


Common questions

"How do 262 tools cover 270 components?"
Most components aren't exposed as individual MCP tools. The server advertises 262 tools; the rest of the registry is reached through the invoke_component dispatcher, which takes a component name, an operation, and a JSON parameter blob. So formal_methods isn't a tool you call directly — it's a component you reach via invoke_component(component="formal_methods", op=...). This keeps the advertised tool list manageable for AI assistants while leaving the full component registry reachable.
"Which tools are free?"
The Free Trial includes core reasoning tools (decompose_goal, formal_verify, guide_ask, and others). Builder tools cover advanced ML, code synthesis, and alignment. See the tier breakdown for the full access table.
"Can I use REST and MCP at the same time?"
Yes. They are independent interfaces backed by the same component registry. Use MCP from your AI assistant and REST from your scripts — they share no state and don't interfere with each other.

For the complete component reference, see Component Reference.