Dev Context Memory MCP
Integrates with GitHub Copilot via VS Code to store and retrieve project context information such as architecture decisions, API contracts, and conventions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Dev Context Memory MCP Add a decision to use PostgreSQL for the user database."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Dev Context Memory MCP
A local-first MCP server that gives AI coding assistants persistent, structured, human-readable memory for a software project.
Why?
AI coding assistants lose context between sessions. They re-read files, forget decisions, and miss conventions. RAG solutions index source code — but source code isn't the right unit of memory. What agents actually need is durable project knowledge: architecture decisions, API contracts, conventions, bugs, and todos.
Dev Context Memory stores this knowledge as Markdown files inside your project, in a .dev-context-memory/ folder. No database, no vector store, no cloud service. Just files you can read, edit, and commit.
How it differs from RAG
Aspect | Traditional RAG | Dev Context Memory |
Source | Indexes source code | Stores curated project knowledge |
Format | Embeddings in a vector DB | Human-readable Markdown |
Location | External service or local DB | Inside the project ( |
Persistence | Rebuilt on changes | Git-committed, always available |
Human-readable | No | Yes — edit with any text editor |
Content | Full code | Concise decisions, contracts, conventions |
Related MCP server: local-agent-context
Memory Sections
The server manages these Markdown files:
Section | File | Purpose |
|
| High-level project description |
|
| System architecture and design patterns |
|
| API endpoint contracts |
|
| Architecture Decision Records |
|
| Known bugs and issues |
|
| Planned work and tasks |
|
| Coding standards and style guides |
|
| Project-specific terminology |
MCP Tools
Tool | Description |
| List available memory sections |
| Read a memory section |
| Overwrite a memory section (use with care) |
| Add an Architecture Decision Record |
| Add an API endpoint contract |
| Search all sections by keyword |
| Get headings and excerpts from sections |
Installation
# Clone or copy into your tools directory
cd dev-context-memory-mcp
# Install dependencies
npm install
# Build
npm run buildRunning
The server communicates over stdio, which is the standard MCP transport:
node dist/index.jsThe server will create a .dev-context-memory/ folder in the current working directory if it doesn't exist.
MCP Configuration
VS Code GitHub Copilot
Add to your .vscode/mcp.json file:
{
"servers": {
"dev-context-memory": {
"command": "node",
"args": ["/absolute/path/to/dev-context-memory-mcp/dist/index.js"],
"cwd": "/absolute/path/to/your/project"
}
}
}Claude Desktop / Claude Code
Add to your MCP settings (e.g., claude_desktop_config.json or .claude/settings.json):
{
"mcpServers": {
"dev-context-memory": {
"command": "node",
"args": ["/absolute/path/to/dev-context-memory-mcp/dist/index.js"],
"cwd": "/absolute/path/to/your/project"
}
}
}Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"dev-context-memory": {
"command": "node",
"args": ["/absolute/path/to/dev-context-memory-mcp/dist/index.js"]
}
}
}Gemini CLI / Antigravity
Add to your .gemini/settings.json:
{
"mcpServers": {
"dev-context-memory": {
"command": "node",
"args": ["/absolute/path/to/dev-context-memory-mcp/dist/index.js"],
"cwd": "/absolute/path/to/your/project"
}
}
}Important: Set
cwdto the root of the project where you want memory stored. The.dev-context-memory/folder will be created there.
Example Tool Calls
List available sections
{
"tool": "list_memory_sections",
"arguments": {}
}Read a section
{
"tool": "read_memory",
"arguments": {
"section": "architecture"
}
}Record a decision
{
"tool": "append_decision",
"arguments": {
"title": "Use PostgreSQL for user data",
"context": "We need a relational database for user profiles, permissions, and audit logs. SQLite is too limited for concurrent access in production.",
"decision": "Use PostgreSQL 16 with Drizzle ORM. Deploy on Supabase for the MVP.",
"consequences": "Requires a running PostgreSQL instance. Adds Drizzle as a dependency. Migration tooling needed.",
"relatedFiles": ["src/db/schema.ts", "src/db/connection.ts", "docker-compose.yml"]
}
}Record an API contract
{
"tool": "append_api_contract",
"arguments": {
"name": "Create User",
"method": "POST",
"path": "/api/v1/users",
"purpose": "Creates a new user account and sends a welcome email.",
"auth": "Bearer token, admin role required",
"request": "{ email: string, name: string, role: 'admin' | 'user' }",
"response": "{ id: string, email: string, createdAt: string }",
"sideEffects": "Sends welcome email via SendGrid. Creates Stripe customer.",
"frontendUsage": "Called from the admin dashboard user creation form.",
"relatedFiles": ["src/routes/users.ts", "src/services/email.ts"]
}
}Search memory
{
"tool": "search_memory",
"arguments": {
"query": "PostgreSQL"
}
}Summarize all memory
{
"tool": "summarize_memory",
"arguments": {}
}Recommended Usage with AGENTS.md
To help AI agents understand how and when to use the Memory MCP server, it is highly recommended to include instructions in your project workspace.
We have provided a comprehensive example of these instructions in the AGENTS.md file included in this repository.
You can copy the contents of AGENTS.md and add them to your own project's AGENTS.md, .cursorrules, .github/copilot-instructions.md, or any equivalent agent instructions file supported by your editor. This ensures that the agent follows best practices regarding memory quality, security, and when to trust memory vs. source code.
Security Model
Dev Context Memory is designed to be safe by default:
Filesystem containment: All reads and writes are scoped to
.dev-context-memory/. Path traversal is blocked.Section whitelist: Only known section names are accepted. Unknown sections are rejected with clear errors.
No shell execution: The server never runs shell commands.
No network access: The server never makes network requests.
No silent deletion: Write operations are explicit and clearly documented.
No arbitrary file access: The server cannot read or write project source files.
Input validation: All inputs are validated before use.
Development
# Watch mode for development
npm run dev
# Build for production
npm run buildTesting Manually
Build the project:
npm run buildRun the server in a project directory:
cd /path/to/your/project node /absolute/path/to/memory-mcp/dist/index.jsThe server starts on stdio. You can test it using the MCP Inspector:
npx @modelcontextprotocol/inspector node /absolute/path/to/memory-mcp/dist/index.jsBonus Tip: Fixing the Rotating Token Problem
The MCP Inspector protects its local browser UI with an authorization token. When you start the Inspector withnpx @modelcontextprotocol/inspector, it may generate a new random token each time. That means every restart can require opening a new URL, copying a new token, or reconnecting the browser session, which gets annoying while repeatedly testing tools.This project includes an
inspectorscript that sets a stable local development token (stable-token-123) withMCP_PROXY_AUTH_TOKEN. Run it through npm's--prefixflag so you can launch the script from your target project while still using this repo's package script:npm --prefix /absolute/path/to/memory-mcp run inspectorCheck that
.dev-context-memory/was created with default template files.Use the Inspector UI to call tools like
list_memory_sections,read_memory, andappend_decision.
Future Improvements
Embedding-based search: Replace keyword matching with vector similarity for semantic search.
Git integration: Auto-commit memory changes, track history, detect drift.
Section versioning: Keep a changelog of memory edits.
Custom sections: Allow projects to define their own sections.
Memory validation: Lint memory files for structure and completeness.
Cross-project memory: Share conventions across multiple repositories.
Conflict resolution: Detect and surface conflicting decisions or outdated contracts.
MCP resources: Expose memory sections as MCP resources for read-only access.
Available Tools
7 toolsappend_api_contractA
Use this tool after creating or modifying an API endpoint. Store only the durable endpoint contract: method, path, auth, request shape, response shape, side effects, frontend usage, and related files. Do not store full source code.
Inputs: name (required), path (required), method (required), purpose (required), +6 more.
append_decisionA
Record an architecture or design decision. Use this after making a significant technical choice. Stores a structured ADR (Architecture Decision Record) with context, decision, consequences, and related files. Do not store full source code — store only the rationale and outcome.
Inputs: title (required), context (required), decision (required), consequences, +1 more.
list_memory_sectionsA
List all available memory sections. Use this to discover what project context is stored. Returns section names and descriptions.
Inputs: no named parameters.
read_memoryA
Read a memory section. Use this to retrieve stored project context such as architecture decisions, API contracts, conventions, bugs, todos, or glossary. Prefer reading memory before scanning unrelated source files.
Inputs: section (required).
search_memoryA
Use this tool before scanning the codebase when the user asks about project architecture, API contracts, decisions, bugs, conventions, or previous implementation choices. Searches all memory sections using keyword matching and returns matching lines with surrounding context.
Inputs: query (required).
summarize_memoryA
Get a compact overview of project memory. Returns headings and short excerpts for each section. Use this for a quick orientation before diving into specific sections with read_memory.
Inputs: sections.
write_memoryA
Overwrite a memory section with new content. WARNING: This replaces the entire section. Use with care. Prefer append_decision or append_api_contract for adding entries. Only use write_memory when you need to restructure or rewrite a full section.
Inputs: content (required), section (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clear, distinct purpose: append tools for adding structured entries, retrieval tools for accessing memory, and write for overwriting sections. No ambiguity between tools.
All tools follow a consistent verb_noun pattern in snake_case (e.g., append_api_contract, list_memory_sections), making the set predictable and easy to navigate.
With 7 tools covering creation, retrieval, and overwriting of memory sections, the set is well-scoped. Each tool earns its place without being redundant or excessive.
The tools support appending and reading memory, but lack explicit delete or edit functionality for sections or individual entries. write_memory can overwrite but not delete, and no tool allows partial updates.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Cloud-hosted MCP server for durable AI memory
shared AI-context layer for teams — persistent memory your agents search and update over MCP
Related MCP Servers
- AlicenseAqualityCmaintenanceLocal-first MCP server that gives any AI coding agent per-project memory, workflow intelligence, and always-on, lossless token & context optimization.3765 npm6MIT
- AlicenseNot gradedqualityDmaintenanceA local MCP server that gives AI coding agents persistent memory and context across sessions.4 npmMIT
- AlicenseNot gradedqualityDmaintenanceA local-first MCP server that turns a .context/ folder of markdown files into a searchable knowledge layer for AI coding agents.15 npm2MIT
- AlicenseAqualityBmaintenanceA local-first MCP server that provides a shared Markdown-based memory for AI coding agents, enabling cross-agent context persistence via tools like memory_search and memory_capture.161MIT