@mempalace/mcp-dev
mempalace-mcp-dev
An MCP (Model Context Protocol) server that gives AI coding assistants grounded, branch-scoped context about your codebase. It provides semantic code search via my MemPalace fork, git change tracking, a persistent change ledger, TypeScript/Jest dev lifecycle tools, and a built-in Project Tracks (Conductor) methodology for structured feature work.
Features
Feature | Description |
Semantic code search | Natural-language queries over your indexed codebase via MemPalace embeddings |
Branch context | Current branch, SHA, recent commits — always oriented |
Change ledger | Append-only JSONL log of every AI-assisted change with full provenance |
Dev lifecycle | Run |
Git diff | Full or file-scoped diff output |
Project Tracks | Create and manage markdown-based feature tracks (plan/spec/index/metadata) |
Prerequisites
Node.js ≥ 18
Python ≥ 3.9
A git repository to point at
Important: MemPalace Fork Required
⚠️ This MCP server requires a custom fork of MemPalace with multi-branch exclude-patterns support. The official
pip install mempalacepackage will not work — you must use my fork (branchfeat/exclude-patterns-config).
The easiest way to get this set up is the setup script (see Quick Start).
Quick Start
1. Run the setup script (recommended)
The fastest way to get up and running is the bootstrap script at
scripts/setup-mempalace.sh. It handles the entire MemPalace setup:
Clones my fork with the required exclude-patterns support
Creates a Python virtual environment
Installs the fork in editable mode
Symlinks the
mempalaceCLI to~/.local/binPrepares the palace data directory
Optionally runs the initial codebase index
# From the repo root:
./scripts/setup-mempalace.sh
# To also index your codebase right away:
./scripts/setup-mempalace.sh --mineThe script is fully configurable via environment variables:
Env var | Default | Description |
|
| My fork with required exclude-patterns support |
|
| Branch containing the feature |
|
| Where to clone the fork |
|
| Python venv location |
|
| Palace data directory |
|
| Palace wing (namespace) |
|
| Source code to mine |
After the script finishes, check that everything works:
mempalace --version
mempalace --palace ~/.mempalace/active status2. Clone and build the MCP server
This is not published to npm. Clone and build locally:
git clone https://github.com/2loch-ness6/mempalace-mcp-dev
cd mempalace-mcp-dev
npm install
npm run buildAfter building, you can use npm link to make mempalace-mcp-dev available globally:
npm link
# Now this works from anywhere:
mempalace-mcp-dev3. Configure environment variables
export MCP_REPO_DIR=/path/to/your/repo # defaults to process.cwd()
export MCP_PALACE_DIR=~/.mempalace/active # MemPalace data directory
export MCP_PALACE_WING=code # wing name (namespace) for your repo
export MEMPALACE_PYTHON=/path/to/venv/bin/python3 # python with fork installedIf you used the setup script, set
MEMPALACE_PYTHONto$HOME/.mempalace/bin/python3(or whereverMEMPALACE_VENV_DIRpoints).
4. Add to your MCP client config
For Claude Desktop and other MCP clients:
{
"mcpServers": {
"mempalace-mcp-dev": {
"command": "node",
"args": ["/path/to/mempalace-mcp-dev/dist/index.js"],
"env": {
"MCP_REPO_DIR": "/path/to/your/repo",
"MCP_PALACE_DIR": "/home/you/.mempalace/active",
"MCP_PALACE_WING": "code",
"MEMPALACE_PYTHON": "/home/you/.mempalace/bin/python3"
}
}
}
}If you ran npm link, you can also use the shorter form:
{
"mcpServers": {
"mempalace-mcp-dev": {
"command": "mempalace-mcp-dev",
"env": {
"MCP_REPO_DIR": "/path/to/your/repo",
"MCP_PALACE_DIR": "/home/you/.mempalace/active",
"MCP_PALACE_WING": "code",
"MEMPALACE_PYTHON": "python3"
}
}
}
}Environment Variables
Variable | Default | Description |
|
| Absolute path to your git repository root |
|
| MemPalace data directory |
|
| Wing (namespace) name within the palace |
|
| Path to the change ledger file |
|
| Directory containing project track folders |
|
| Python binary (must have the MemPalace fork installed) |
MCP Tools Reference
Code Search
Tool | Description |
| Semantic search over indexed codebase. Accepts |
| Re-index files changed since the last git commit. Call after editing to keep search current |
Branch & Git
Tool | Description |
| Returns current branch, SHA, short SHA, and last 5 commit messages |
| Files changed vs |
| Full diff output. Optional |
Change Ledger
Tool | Description |
| Append an entry to the ledger (files affected, description, reason, tags, optional track link) |
| Read recent ledger entries. Optional |
Dev Lifecycle
Tool | Description |
| Run |
| Run Jest in a service directory. Returns pass/fail counts and structured failure details |
Project Tracks (Conductor)
Tool | Description |
| List all live tracks (directories containing |
| Read |
| Overwrite |
| Read |
| Overwrite |
| Read |
| Overwrite |
| Scaffold a new track directory with all four files |
Project Tracks Methodology (Conductor)
Project Tracks is a lightweight, file-based feature management system. Each track is a directory containing up to four files:
conductor/tracks/
└── my-feature-20260501/
├── plan.md ← living task list; the status source of truth
├── spec.md ← technical spec, design decisions, acceptance criteria
├── index.md ← short summary and linked resources
└── metadata.json ← machine-readable metadata (id, owner, status, dates)Rules:
A directory is a live track only if it contains
plan.md.plan.mdis always read/written live from disk (never via MemPalace — no staleness).Track slugs must match
[a-zA-Z0-9][a-zA-Z0-9_-]*(max 100 chars).
Bootstrapping tracks in a new project:
# Create the tracks directory
mkdir -p conductor/tracks
# Use the MCP tool to scaffold a track
# (or copy from templates/track/ in this package)Template files are included in templates/track/ for manual scaffolding.
MemPalace Configuration (mempalace.yaml)
Place a mempalace.yaml at the root of MCP_REPO_DIR to control how files are indexed. A generic example is provided in mempalace.yaml.example.
Key sections:
wing— must matchMCP_PALACE_WINGexclude_patterns— gitignore-syntax patterns to skip during miningrooms— semantic routing rules (keyword → room name) for search scoping
Development
git clone https://github.com/2loch-ness6/mempalace-mcp-dev
cd mempalace-mcp-dev
npm install
npm run build
npm testSee CONTRIBUTING.md for contribution guidelines.
License
MIT — see LICENSE.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/2loch-ness6/mempalace-mcp-dev'
If you have feedback or need assistance with the MCP directory API, please join our Discord server