Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Reference Overview

m1nd exposes the live MCP tool surface over JSON-RPC 2.0 via stdio. Every tool requires agent_id as a parameter. The exported MCP schema uses underscore-based canonical names such as trail_resume, perspective_start, and apply_batch. Use tools/list for the exact count in your current build.

The grouped pages below still keep historical prefixed anchors for stable links, but executable tools/call examples use the canonical bare names returned by tools/list.

Several tools now do more than return raw results. On the main structural flows you should expect some combination of:

  • proof_state
  • next_suggested_tool
  • next_suggested_target
  • next_step_hint

That matters for how you integrate m1nd into an agent loop: treat many responses as workflow guidance, not just data blobs.

Tool Index

Core Activation

ToolDescription
activateSpreading activation query across the graph
warmupTask-based warmup and priming
resonateResonance analysis: harmonics, sympathetic pairs, and resonant frequencies

Analysis

ToolDescription
impactImpact radius / blast analysis for a node
predictCo-change prediction for a modified node
counterfactualWhat-if node removal simulation
fingerprintActivation fingerprint and equivalence detection
hypothesizeGraph-based hypothesis testing against structural claims
differentialFocused structural diff between two graph snapshots
divergeStructural drift between a baseline and current graph state

Memory, Trails, and Learning

ToolDescription
learnExplicit feedback-based edge adjustment
driftWeight and structural drift analysis
whyPath explanation between two nodes
trail_savePersist current investigation state
trail_resumeRestore a saved investigation with next-step guidance
trail_listList saved investigation trails
trail_mergeCombine two or more investigation trails

Exploration

ToolDescription
seekIntent-aware semantic code search
scanPattern-aware structural code analysis
missingDetect structural holes and missing connections
traceMap runtime errors to structural root causes
timelineGit-based temporal history for a node
federateMulti-repository federated graph ingestion
federate_autoDiscover repo candidates from external path evidence and optionally federate them

Perspectives

ToolDescription
perspective_startEnter a perspective: navigable route surface from a query
perspective_routesBrowse the current route set with pagination
perspective_inspectExpand a route with metrics, provenance, and affinity
perspective_peekExtract a code/doc slice from a route target
perspective_followFollow a route: move focus to target, synthesize new routes
perspective_suggestGet the next best move suggestion
perspective_affinityDiscover probable connections a route target might have
perspective_branchFork navigation state into a new branch
perspective_backNavigate back to previous focus
perspective_compareCompare two perspectives on shared/unique nodes
perspective_listList all perspectives for an agent
perspective_closeClose a perspective and release associated locks

Lifecycle, Search, and Surgical

ToolDescription
ingestIngest or re-ingest a codebase, descriptor, or memory corpus
document_resolveResolve canonical local artifacts for a universal document
document_provider_healthReport optional document provider availability and install hints
document_bindingsShow deterministic document-to-code bindings
document_driftDetect stale, missing, or ambiguous document/code links
auto_ingest_startStart local-first document auto-ingest watchers
auto_ingest_statusInspect the document auto-ingest runtime and counters
auto_ingest_tickDrain queued document changes immediately
auto_ingest_stopStop document watchers and persist manifest state
healthServer health and statistics
searchLiteral, regex, or semantic-graph-aware content search
globGraph-aware file globbing
viewFast line-numbered file inspection
validate_planValidate a modification plan against the code graph
surgical_context_v2Pull connected edit context with proof-oriented options
apply_batchAtomic multi-file write with progress, verification, and handoff

The grouped reference pages below still organize the surface by area, but the current best operational map is in help, the README tool table, and the live tools/list response.


Common Parameters

Every tool requires the agent_id parameter:

ParameterTypeRequiredDescription
agent_idstringYesIdentifier for the calling agent. Used for session tracking, perspective ownership, lock ownership, and multi-agent coordination.

Agent IDs are free-form strings. Convention: use the agent’s name or role identifier (e.g. "jimi", "hacker-auth", "forge-build").

JSON-RPC Request Format

m1nd uses the MCP protocol over JSON-RPC 2.0 via stdio. All tool calls use the tools/call method.

Request structure

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
        "name": "activate",
    "arguments": {
      "agent_id": "jimi",
      "query": "session management"
    }
  }
}

Successful response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ ... pretty-printed JSON result ... }"
      }
    ]
  }
}

The text field contains the tool-specific output as a pretty-printed JSON string. Parse it to get the structured result.

Error response (tool execution error)

Tool execution errors are returned as MCP isError content, not as JSON-RPC errors. Many current errors are recovery-oriented and may include fields such as hint, workflow_hint, example, or suggested_next_step.

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ \"error\": \"...\", \"hint\": \"...\", \"suggested_next_step\": \"...\" }"
      }
    ],
    "isError": true
  }
}

Error response (protocol error)

JSON-RPC protocol errors use standard error codes:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found: bad_method"
  }
}

Error Codes

CodeMeaning
-32700Parse error – invalid JSON
-32601Method not found – unknown JSON-RPC method
-32603Internal error – server-level failure

Tool-specific errors (node not found, perspective not found, lock ownership violation, etc.) are returned via isError: true in the content, not as JSON-RPC errors.

Transport

m1nd supports two stdio transport modes, auto-detected per message:

  • Framed: Content-Length: N\r\n\r\n{json} – standard MCP/LSP framing. Used by Claude Code, Cursor, and most MCP clients.
  • Line: {json}\n – one JSON object per line. Used by simple scripts and testing.

The server auto-detects which mode each incoming message uses and responds in the same mode.

Tool Name Normalization

The exported MCP schema uses underscore-based canonical names, but the server still accepts legacy transport aliases when possible:

  • activate is canonical
  • transport-prefixed aliases are accepted where normalization applies

If you are generating tool calls from an MCP client, prefer the canonical schema names returned by tools/list.

Protocol Handshake

Before calling tools, MCP clients perform a handshake:

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{}}

Response:

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "protocolVersion": "2024-11-05",
    "serverInfo": { "name": "m1nd-mcp", "version": "0.8.0" },
    "capabilities": { "tools": {} }
  }
}

Then list available tools:

{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}

This returns the full schema for the live tool surface with inputSchema for each entry. Treat tools/list as the source of truth for the exact count in your current build.