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.
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.
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.
The same operation, three ways¶
Here is goal decomposition performed through each interface:
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_componentdispatcher, which takes a component name, an operation, and a JSON parameter blob. Soformal_methodsisn't a tool you call directly — it's a component you reach viainvoke_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.