MCP Setup
Configure Prime as an MCP server for Claude Desktop with auto-inject, per-project memory, and advanced options.
Install
Get the binary from crates.io. Builds standalone — no AllSource server required.
cargo install allsource-prime allsource-prime --version # allsource-prime 0.21.3
Claude Desktop
Add to ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"prime": {
"command": "allsource-prime",
"args": ["--data-dir", "~/.prime/memory"]
}
}
}Restart Claude Desktop after saving. Prime will persist all knowledge to ~/.prime/memory.
Claude Code
One command, no config file to edit:
claude mcp add prime allsource-prime \ --data-dir ~/.prime/memory \ --auto-inject
Run claude mcp list to confirm the server registered.
v0.21.3 — text-only embedding
prime_embed and prime_recall now accept plain text and embed it server-side via the bundled fastembed model (AllMiniLML6V2, 384 dims). Agents no longer need a precomputed vector — pass text and Prime handles the rest. The first call in a process downloads the model (~25 MB) into the fastembed cache; subsequent calls take ~1–3 ms.
Auto-Inject Configuration
Auto-inject feeds the compressed index into every conversation automatically, so the agent always knows what it knows. Add the --auto-inject flag:
{
"mcpServers": {
"prime": {
"command": "allsource-prime",
"args": [
"--data-dir", "~/.prime/memory",
"--auto-inject"
]
}
}
}When enabled, Prime exposes a prime://auto-context resource that Claude reads at conversation start. This resource contains the compressed index — a token-efficient markdown summary of all stored knowledge (~500-1000 tokens).
Control the maximum token budget with --auto-inject-max-tokens:
"args": [ "--data-dir", "~/.prime/memory", "--auto-inject", "--auto-inject-max-tokens", "2000" ]
Per-Project Memory
Use separate --data-dir paths for isolated project contexts:
{
"mcpServers": {
"prime-work": {
"command": "allsource-prime",
"args": ["--data-dir", "~/projects/acme/.prime", "--auto-inject"]
},
"prime-personal": {
"command": "allsource-prime",
"args": ["--data-dir", "~/.prime/personal", "--auto-inject"]
}
}
}Each instance maintains its own graph, index, and vector store. No data leaks between projects.
Tool Reference
Prime exposes 13 MCP tools. Claude selects and calls them automatically based on conversation context.
| Tool | Description |
|---|---|
prime_add_node | Create a knowledge node (person, concept, project, decision, …) |
prime_add_edge | Create a directed relationship between two nodes |
prime_neighbors | BFS the graph around a node (depth + relation filters) |
prime_search | List all nodes of a given type |
prime_shortest_path | Find the chain of relationships between two entities |
prime_forget | Soft-delete a node (preserved in event history) |
prime_history | Full event audit trail for any entity |
prime_stats | Graph statistics (node/edge counts, types, relations) |
prime_index | Compressed knowledge index — token-efficient markdown summary by domain |
prime_context | Tiered retrieval (L0 stats / L1 conversation / L2 full hybrid) |
prime_embed | Store a vector. Pass text alone (server embeds) or pass vector directly |
prime_similar | Find semantically similar embeddings to a stored vector |
prime_recall | Hybrid recall: vectors + graph + temporal recency. Text or vector input. |
Agent Prompt Template
For best results, include a system prompt that teaches Claude how to use Prime. Add to your CLAUDE.md or system prompt:
You have access to Prime, a persistent knowledge graph for long-term memory. ## When to store - Facts about people, projects, decisions, or relationships - User preferences and corrections - Important context that should persist across conversations ## When to recall - Before answering questions about people, projects, or history - When the user asks "what do you know about X" - When you need context from previous conversations ## Workflow 1. Check prime_index at conversation start (or use auto-inject) 2. Use prime_recall for specific queries 3. Use prime_context for cross-domain questions 4. Store new facts with prime_add_node + prime_add_edge 5. Always set a domain (engineering, product, revenue, etc.)
Cookbook Resource
Prime exposes a prime://cookbook MCP resource containing worked examples and best practices for common memory patterns (team directories, decision logs, project tracking). Claude can read this resource on demand to learn advanced usage patterns.
Troubleshooting
- Binary not found: Ensure
allsource-primeis in your$PATH. Runwhich allsource-primeto verify. If installed viacargo install, check that~/.cargo/binis in your PATH. - Data directory permissions: Prime needs read/write access to the
--data-dirpath. Runmkdir -p ~/.prime/memory && ls -la ~/.prime/memoryto verify. On macOS, Claude Desktop may need Full Disk Access for paths outside~. - Tools not appearing:After editing the config, fully quit and relaunch Claude Desktop (not just close the window). Check Claude Desktop's MCP logs for connection errors.
- Auto-inject not working: Verify the
--auto-injectflag is present in your args array. Theprime://auto-contextresource only appears when the graph has at least one node.
