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

Quick Start

Five minutes from zero to your first query.

Prerequisites

  • Rust toolchain: 1.75+ (install via rustup)
  • A codebase: Any project with Python, Rust, TypeScript/JavaScript, Go, or Java files. Other languages use a generic fallback extractor.

Installation

git clone https://github.com/cosmophonix/m1nd.git
cd m1nd
cargo build --release

The binary is at ./target/release/m1nd-mcp (~8MB). Copy it wherever you want:

cp target/release/m1nd-mcp /usr/local/bin/

From crates.io

cargo install m1nd-mcp

Verify the build

m1nd-mcp --help

The binary should start and wait for JSON-RPC input on stdin. Press Ctrl+C to exit.

Configuration

m1nd is an MCP server that communicates over stdio using JSON-RPC. You configure it in your AI client’s MCP settings.

Claude Code

Add to your Claude Code MCP configuration (.mcp.json in your project root, or ~/.claude/mcp.json globally):

{
  "mcpServers": {
    "m1nd": {
      "command": "/path/to/m1nd-mcp",
      "env": {
        "M1ND_GRAPH_SOURCE": "/tmp/m1nd-graph.json",
        "M1ND_PLASTICITY_STATE": "/tmp/m1nd-plasticity.json"
      }
    }
  }
}

Cursor

In Cursor settings, navigate to MCP Servers and add:

{
  "m1nd": {
    "command": "/path/to/m1nd-mcp",
    "env": {
      "M1ND_GRAPH_SOURCE": "/tmp/m1nd-graph.json",
      "M1ND_PLASTICITY_STATE": "/tmp/m1nd-plasticity.json"
    }
  }
}

Windsurf / Cline / Roo Code / Continue

Any MCP-compatible client works. The pattern is the same: point the client at the m1nd-mcp binary and optionally set the environment variables for persistence.

Environment Variables

VariablePurposeDefault
M1ND_GRAPH_SOURCEPath to persist graph state between sessionsIn-memory only (lost on exit)
M1ND_PLASTICITY_STATEPath to persist learned edge weightsIn-memory only (lost on exit)

Recommendation: Always set both variables. Without persistence, every restart discards learned weights and you lose the graph’s accumulated intelligence.

Advanced Configuration

The server accepts these configuration parameters (set via environment):

ParameterDefaultPurpose
learning_rate0.08How aggressively the graph learns from feedback
decay_rate0.005Rate of edge weight decay over time
xlr_enabledtrueEnable XLR noise cancellation
auto_persist_interval50Persist state every N queries
max_concurrent_reads32Maximum concurrent read operations
domain“code”Domain preset: code, music, memory, or generic

First Run: Ingest a Project

Once your MCP client is configured and m1nd is running, ingest your codebase. This is the foundation for everything else.

If you are using m1nd through an MCP client like Claude Code, the client sends the JSON-RPC calls for you when you invoke the tools. The raw JSON-RPC is shown here for clarity.

Step 1: Ingest

// Ingest your project
{
  "method": "tools/call",
  "params": {
    "name": "m1nd.ingest",
    "arguments": {
      "path": "/path/to/your/project",
      "agent_id": "dev"
    }
  }
}

Expected response (times will vary by project size):

{
  "files_processed": 335,
  "nodes_created": 9767,
  "edges_created": 26557,
  "languages": {"python": 335},
  "elapsed_ms": 910
}

What happened: m1nd parsed every file, extracted structural elements (modules, classes, functions, imports), resolved references between them, built a compressed graph, and computed PageRank centrality for every node.

Step 2: Verify with Health Check

{
  "method": "tools/call",
  "params": {
    "name": "m1nd.health",
    "arguments": {
      "agent_id": "dev"
    }
  }
}

Expected response:

{
  "status": "ok",
  "nodes": 9767,
  "edges": 26557,
  "finalized": true,
  "plasticity_records": 0,
  "agents_seen": ["dev"],
  "queries_served": 1,
  "uptime_seconds": 12
}

If you see "nodes": 0, re-check the path you passed to ingest.

Step 3: Your First Query

{
  "method": "tools/call",
  "params": {
    "name": "m1nd.activate",
    "arguments": {
      "query": "authentication",
      "agent_id": "dev",
      "top_k": 5
    }
  }
}

Expected response:

{
  "activated": [
    {
      "node_id": "file::auth.py",
      "score": 0.89,
      "dimension_scores": {
        "structural": 0.92,
        "semantic": 0.95,
        "temporal": 0.78,
        "causal": 0.71
      }
    },
    {"node_id": "file::middleware.py", "score": 0.72},
    {"node_id": "file::session.py", "score": 0.61}
  ],
  "ghost_edges": [
    {"from": "file::auth.py", "to": "file::rate_limiter.py", "confidence": 0.34}
  ]
}

What happened: m1nd fired a signal into the graph from nodes matching “authentication” and let it propagate across structural, semantic, temporal, and causal dimensions. Noise was cancelled via XLR differential processing. The results are ranked by multi-dimensional activation score, not just text matching.

What Next

You now have a working m1nd instance. From here:

  • First Query Tutorial: Step-by-step walkthrough of the full activate-learn-activate cycle, counterfactual simulation, and structural hole detection.
  • Multi-Agent Tutorial: How to use m1nd with multiple agents sharing one graph.
  • FAQ: Common questions and answers.

Troubleshooting

“No graph snapshot found, starting fresh” – This is normal on first run. The graph is empty until you call ingest.

Ingest returns 0 files – Check that the path is correct and contains supported source files. m1nd currently has extractors for Python (.py), Rust (.rs), TypeScript/JavaScript (.ts/.js/.tsx/.jsx), Go (.go), and Java (.java). Other files use a generic fallback extractor.

MCP client does not see m1nd tools – Verify the binary path is correct and the binary is executable (chmod +x m1nd-mcp). Check your client’s MCP server logs for connection errors.

Permission denied – Ensure the M1ND_GRAPH_SOURCE and M1ND_PLASTICITY_STATE paths are writable.