MCP Integration
Mind Palace treats AI agents as first-class consumers. Schemas are contracts, not suggestions.
Two Integration Modes
| Mode | Best For | How |
|---|---|---|
| MCP | Interactive agents (Claude, Cursor) | palace serve |
| Context Pack | Batch/CLI agents | palace 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
| Tool | Parameters | Returns |
|---|---|---|
explore | query, limit?, room? | Search the codebase |
explore_rooms | - | List all rooms with entry points |
explore_context | goal, diff? | Generate context pack for a task |
explore_impact | file | Analyze impact of changes to a file |
explore_symbols | query?, room?, limit? | Search for symbols |
explore_symbol | name, file? | Get symbol details |
explore_file | path | Get file metadata and structure |
explore_deps | file | Get file dependencies |
explore_callers | symbol, file?, depth? | Find callers of a symbol |
explore_callees | symbol, file?, depth? | Find callees of a symbol |
explore_graph | symbol, file?, depth? | Get full call graph |
Store Tools
| Tool | Parameters | Returns |
|---|---|---|
store | content, kind?, scope?, scopePath?, confidence?, rationale? | Store idea, decision, or learning |
Recall Tools
| Tool | Parameters | Returns |
|---|---|---|
recall | query?, scope?, scopePath?, limit? | Search learnings |
recall_decisions | scope?, scopePath?, status?, limit? | List decisions |
recall_ideas | scope?, scopePath?, status?, limit? | List ideas |
recall_outcome | id, status, notes? | Record decision outcome |
recall_link | source, target, relation, reason? | Link two records |
recall_links | id | Get links for a record |
recall_unlink | source, target | Remove a link |
recall_learning_link | learningId, file, line? | Link learning to code |
recall_obsolete | id, reason? | Mark learning as obsolete |
recall_archive | id | Archive a record |
recall_learnings_by_status | status, limit? | Get learnings by status |
Contradiction Detection Tools
| Tool | Parameters | Returns |
|---|---|---|
recall_contradictions | scope?, resolved?, limit? | List contradictions |
recall_contradiction_check | id | Check for contradictions |
recall_contradiction_summary | - | Contradiction statistics |
Brief Tools
| Tool | Parameters | Returns |
|---|---|---|
brief | path | Get file briefing |
brief_file | path | Get detailed file intelligence |
briefing_smart | context, contextPath, style? | LLM-generated smart briefing |
Session Tools
| Tool | Parameters | Returns |
|---|---|---|
session_start | agentType, goal? | Start a work session |
session_log | sessionId, kind, target, outcome?, details? | Log activity |
session_end | sessionId | End session |
session_conflict | path | Check for file conflicts |
session_list | active?, limit? | List sessions |
Conversation Tools
| Tool | Parameters | Returns |
|---|---|---|
conversation_store | sessionId, messages, summary? | Store conversation |
conversation_search | query?, sessionId?, limit? | Search conversations |
conversation_extract | conversationId | Extract knowledge from conversation |
Corridor Tools
| Tool | Parameters | Returns |
|---|---|---|
corridor_learnings | query?, limit? | Get personal learnings |
corridor_links | - | List linked workspaces |
corridor_stats | - | Corridor statistics |
corridor_promote | learningId | Promote to personal corridor |
corridor_reinforce | learningId | Reinforce a learning |
Semantic Search Tools
| Tool | Parameters | Returns |
|---|---|---|
search_semantic | query, kinds?, limit? | Semantic similarity search |
search_hybrid | query, kinds?, limit? | Combined keyword + semantic |
search_similar | id, limit? | Find similar records |
Embedding Tools
| Tool | Parameters | Returns |
|---|---|---|
embedding_sync | force? | Sync embeddings for all records |
embedding_stats | - | Embedding statistics |
Decay Tools
| Tool | Parameters | Returns |
|---|---|---|
decay_stats | - | Decay statistics |
decay_preview | days? | Preview what will decay |
decay_apply | - | Apply confidence decay |
decay_reinforce | id | Reinforce a learning |
decay_boost | id, amount? | Boost learning confidence |
Context & Scope Tools
| Tool | Parameters | Returns |
|---|---|---|
context_auto_inject | filePath, maxTokens?, includeLearnings?, includeDecisions?, includeFailures? | Auto-inject context for file |
scope_explain | filePath | Explain scope inheritance for file |
Postmortem Tools
| Tool | Parameters | Returns |
|---|---|---|
store_postmortem | title, whatHappened, rootCause?, lessonsLearned?, preventionSteps?, severity?, affectedFiles?, relatedDecision? | Create failure postmortem |
get_postmortems | status?, severity?, limit? | List postmortems |
get_postmortem | id | Get postmortem details |
resolve_postmortem | id | Mark postmortem resolved |
postmortem_stats | - | Postmortem statistics |
postmortem_to_learnings | id | Convert lessons to learnings |
Available Resources
| URI | Returns |
|---|---|
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 agentThe context pack contains:
- Goal and scope
- Referenced files with content
- Room context
- Provenance (scan ID, timestamp)
- Relevant learnings
Agent Rules
Must Read
| File | Contains |
|---|---|
palace.jsonc | Project config, guardrails |
rooms/*.jsonc | Entry points, scope |
context-pack.json | Current goal, findings |
Must Not Touch
| Path | Reason |
|---|---|
.palace/index/* | Generated by CLI |
.palace/outputs/* | Generated by CLI |
| Files matching guardrails | Protected |
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 changesVerification Loop
Agent proposes → Human reviews → Save → Observer checks → Fresh ✓ or Stale ✗With Observer (VS Code)
- Agent queries via MCP or reads context pack
- Agent proposes changes
- Human saves files
- Observer runs
palace check - HUD shows Fresh (green) or Stale (red)
- If stale, auto-heal runs
scan
Without Observer (CLI)
# After agent changes
palace check --fast
# If stale:
palace scan && palace explore "next goal" --fullHandling 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..HEADAgents should:
- Check if
change-signal.jsonexists - Use its file list to scope work
- 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
- Start a session - Always begin with
start_sessionto enable tracking - Log activities - Record reads, edits, and commands for file intelligence
- Capture learnings - Store patterns and heuristics discovered during work
- Check for conflicts - Before editing, verify no other agent is working on the file
- End sessions properly - Call
end_sessionwhen done - Respect guardrails - Never touch protected files
- Honor scope - Stay within the requested scope (diff or full)
Last updated on