Custom Agent
Any agent that speaks MCP (stdio transport) can consume Trurlic’s decision graph. This guide covers the integration pattern for custom agents and frameworks.
MCP server configuration
Section titled “MCP server configuration”Add Trurlic to your MCP client configuration:
{ "mcpServers": { "trurlic": { "command": "trurlic", "args": ["serve"] } }}The server uses stdio transport — it reads JSON-RPC from stdin and writes to stdout.
Integration pattern
Section titled “Integration pattern”Design mode — advance loop
Section titled “Design mode — advance loop”Use when the task requires new architectural decisions: new component, new concern area, design change.
1. advance(component, task_type) → { step, action, requires_user_input }2. Follow the action (get_step_prompt, add_component, etc.)3. If requires_user_input: ask the user, wait, pass their response4. advance again with step_evidence5. Repeat until ready: true6. get_context → implement constrained by the briefGated steps require evidence of at least 20 bytes — the agent must present the prompt to the user and collect a meaningful response.
Implementation mode — get_context directly
Section titled “Implementation mode — get_context directly”Use when implementing within existing constraints. No advance loop, no gates, fully autonomous.
1. get_context(component) → brief with all decisions and constraints2. Implement within the brief3. If undecided pattern encountered: check_pattern(description) → if uncovered: record_decision(component, choice, reason, attribution="agent") continue — the decision is flagged ⚠ for human review4. get_context(component, depth="constraints") → verify complianceChoosing the mode
Section titled “Choosing the mode”If the task says “add a feature,” “fix a bug,” or “implement X” and the component has existing decisions that cover the work — use implementation mode.
If the task says “design,” “architect,” “add a new component,” or the existing decisions don’t cover what needs to be done — switch to design mode.
MCP protocol details
Section titled “MCP protocol details”Trurlic implements the MCP JSON-RPC protocol over stdio:
tools/list— returns the twelve tool definitions with JSON Schema input specifications.tools/call— dispatches to read or write tools based on tool name. Returns a content envelope withtype: "text"containing the JSON payload.- Error responses include
isError: trueand an error message in the text field.
Multiple components
Section titled “Multiple components”When an implementation touches multiple components, call get_context for each component. The briefs include related decisions from connected components, ensuring cross-cutting constraints are visible.
Agent-attributed decisions
Section titled “Agent-attributed decisions”Decisions recorded by the agent during implementation carry attribution = "agent". These are flagged with ⚠ in context briefs and the interactive map, signaling that a human should review them.
For the full tool API, see MCP Tools Reference. For the advance loop and task types, see Workflow Engine.