Skip to Content
Mind Palace 0.3.1-alpha is out. Check it out →
FeaturesMCP Integration

MCP Integration

Mind Palace treats AI agents as first-class consumers. Schemas are contracts, not suggestions.


Two Integration Modes

ModeBest ForHow
MCPInteractive agents (Claude, Cursor)palace serve
Context PackBatch/CLI agentspalace explore --full "goal"

MCP Integration

Setup (Claude Desktop)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{ "mcpServers": { "mind-palace": { "command": "palace", "args": ["serve", "--root", "/path/to/project"] } } }

Setup (Cursor)

{ "mcp.servers": { "mind-palace": { "command": "palace", "args": ["serve", "--root", "${workspaceFolder}"] } } }

Available Tools

Explore Tools

ToolParametersReturns
explorequery, limit?, room?Search the codebase
explore_rooms-List all rooms with entry points
explore_contextgoal, diff?Generate context pack for a task
explore_impactfileAnalyze impact of changes to a file
explore_symbolsquery?, room?, limit?Search for symbols
explore_symbolname, file?Get symbol details
explore_filepathGet file metadata and structure
explore_depsfileGet file dependencies
explore_callerssymbol, file?, depth?Find callers of a symbol
explore_calleessymbol, file?, depth?Find callees of a symbol
explore_graphsymbol, file?, depth?Get full call graph

Store Tools

ToolParametersReturns
storecontent, kind?, scope?, scopePath?, confidence?, rationale?Store idea, decision, or learning

Recall Tools

ToolParametersReturns
recallquery?, scope?, scopePath?, limit?Search learnings
recall_decisionsscope?, scopePath?, status?, limit?List decisions
recall_ideasscope?, scopePath?, status?, limit?List ideas
recall_outcomeid, status, notes?Record decision outcome
recall_linksource, target, relation, reason?Link two records
recall_linksidGet links for a record
recall_unlinksource, targetRemove a link
recall_learning_linklearningId, file, line?Link learning to code
recall_obsoleteid, reason?Mark learning as obsolete
recall_archiveidArchive a record
recall_learnings_by_statusstatus, limit?Get learnings by status

Contradiction Detection Tools

ToolParametersReturns
recall_contradictionsscope?, resolved?, limit?List contradictions
recall_contradiction_checkidCheck for contradictions
recall_contradiction_summary-Contradiction statistics

Brief Tools

ToolParametersReturns
briefpathGet file briefing
brief_filepathGet detailed file intelligence
briefing_smartcontext, contextPath, style?LLM-generated smart briefing

Session Tools

ToolParametersReturns
session_startagentType, goal?Start a work session
session_logsessionId, kind, target, outcome?, details?Log activity
session_endsessionIdEnd session
session_conflictpathCheck for file conflicts
session_listactive?, limit?List sessions

Conversation Tools

ToolParametersReturns
conversation_storesessionId, messages, summary?Store conversation
conversation_searchquery?, sessionId?, limit?Search conversations
conversation_extractconversationIdExtract knowledge from conversation

Corridor Tools

ToolParametersReturns
corridor_learningsquery?, limit?Get personal learnings
corridor_links-List linked workspaces
corridor_stats-Corridor statistics
corridor_promotelearningIdPromote to personal corridor
corridor_reinforcelearningIdReinforce a learning

Semantic Search Tools

ToolParametersReturns
search_semanticquery, kinds?, limit?Semantic similarity search
search_hybridquery, kinds?, limit?Combined keyword + semantic
search_similarid, limit?Find similar records

Embedding Tools

ToolParametersReturns
embedding_syncforce?Sync embeddings for all records
embedding_stats-Embedding statistics

Decay Tools

ToolParametersReturns
decay_stats-Decay statistics
decay_previewdays?Preview what will decay
decay_apply-Apply confidence decay
decay_reinforceidReinforce a learning
decay_boostid, amount?Boost learning confidence

Context & Scope Tools

ToolParametersReturns
context_auto_injectfilePath, maxTokens?, includeLearnings?, includeDecisions?, includeFailures?Auto-inject context for file
scope_explainfilePathExplain scope inheritance for file

Postmortem Tools

ToolParametersReturns
store_postmortemtitle, whatHappened, rootCause?, lessonsLearned?, preventionSteps?, severity?, affectedFiles?, relatedDecision?Create failure postmortem
get_postmortemsstatus?, severity?, limit?List postmortems
get_postmortemidGet postmortem details
resolve_postmortemidMark postmortem resolved
postmortem_stats-Postmortem statistics
postmortem_to_learningsidConvert lessons to learnings

Available Resources

URIReturns
palace://files/{path}File content
palace://rooms/{name}Room manifest JSON

Why MCP?

  • Targeted queries - Search, don’t dump
  • Room-aware - Results grouped by Room
  • Entry point boosting - Important files surface first
  • Live index - No stale context packs
  • Session tracking - Monitor agent activity
  • Learning capture - Store and retrieve knowledge

Context Pack Integration

For agents that can’t use MCP:

palace explore "Fix auth bug" --full # Provide .palace/outputs/context-pack.json to agent

The context pack contains:

  • Goal and scope
  • Referenced files with content
  • Room context
  • Provenance (scan ID, timestamp)
  • Relevant learnings

Agent Rules

Must Read

FileContains
palace.jsoncProject config, guardrails
rooms/*.jsoncEntry points, scope
context-pack.jsonCurrent goal, findings

Must Not Touch

PathReason
.palace/index/*Generated by CLI
.palace/outputs/*Generated by CLI
Files matching guardrailsProtected

Scope Discipline

If scope is "diff": Only modify files in the diff Request broader scope explicitly if needed If scope is "full": Still respect guardrails Prefer Room-scoped changes

Verification Loop

Agent proposes → Human reviews → Save → Observer checks → Fresh ✓ or Stale ✗

With Observer (VS Code)

  1. Agent queries via MCP or reads context pack
  2. Agent proposes changes
  3. Human saves files
  4. Observer runs palace check
  5. HUD shows Fresh (green) or Stale (red)
  6. If stale, auto-heal runs scan

Without Observer (CLI)

# After agent changes palace check --fast # If stale: palace scan && palace explore "next goal" --full

Handling Staleness

When palace check fails:

Agent: "Index is stale. Please run `palace scan` or approve auto-heal."

Never proceed with stale context. Request refresh.


Change Signal

For diff-scoped work:

palace ci signal --diff HEAD~1..HEAD palace explore "fix bug" --full --diff HEAD~1..HEAD

Agents should:

  1. Check if change-signal.json exists
  2. Use its file list to scope work
  3. Treat deleted files as non-editable

Session Memory Integration

Track agent work with sessions:

{ "tool": "session_start", "arguments": { "agentType": "claude-code", "goal": "Implement user authentication" } }

During work, log activities:

{ "tool": "session_log", "arguments": { "sessionId": "session-123", "kind": "file_edit", "target": "src/auth/login.go", "outcome": "success" } }

Capture learnings:

{ "tool": "store", "arguments": { "content": "This module requires null checks", "kind": "learning", "scope": "file", "scopePath": "src/auth/login.go", "confidence": 0.85 } }

Before editing, check for conflicts:

{ "tool": "session_conflict", "arguments": { "path": "src/auth/login.go" } }

Failure Tracking

Record failures for learning:

{ "tool": "store_postmortem", "arguments": { "title": "Authentication bypass bug", "whatHappened": "JWT validation was bypassed due to missing signature check", "rootCause": "Signature verification was disabled in test config and deployed to production", "lessonsLearned": [ "Always validate JWT signatures", "Separate test and production configs" ], "severity": "high", "affectedFiles": ["src/auth/jwt.go", "src/middleware/auth.go"] } }

Scope-Aware Context

Get context for any file with scope inheritance:

{ "tool": "context_auto_inject", "arguments": { "filePath": "src/auth/login.go", "maxTokens": 2000, "includeLearnings": true, "includeDecisions": true, "includeFailures": true } }

Understand what scope applies:

{ "tool": "scope_explain", "arguments": { "filePath": "src/auth/login.go" } }

Best Practices

  1. Start a session - Always begin with start_session to enable tracking
  2. Log activities - Record reads, edits, and commands for file intelligence
  3. Capture learnings - Store patterns and heuristics discovered during work
  4. Check for conflicts - Before editing, verify no other agent is working on the file
  5. End sessions properly - Call end_session when done
  6. Respect guardrails - Never touch protected files
  7. Honor scope - Stay within the requested scope (diff or full)
Last updated on