Copilot Memory Store
Allows storing and retrieving contextual memories for GitHub Copilot, enabling context engineering by managing memories, searching, compressing context, and injecting shaped context via MCP tools.
Click on "Install 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., "@Copilot Memory StoreRemember that I use TypeScript for all projects."
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.
Copilot Memory Store
A local JSON memory store for context engineering with GitHub Copilot and MCP clients.
Documentation
Guide | When to read |
Start here - npm commands cheatsheet | |
50+ copy-paste prompts for Copilot Chat | |
Deep dive into LLM memory types and how this project works | |
Architectural overview with flow diagrams | |
Interactive REPL command reference | |
Using the memory tools from GitHub Copilot |
Features
CLI (
memory>) - Interactive REPL for managing memoriesMCP Server - Stdio server exposing tools, resources, and prompts
Custom VS Code Agent - Pre-configured "Memory" agent for natural language usage
Context Compression - Budget-constrained context injection with optional LLM summarization
Auto-Keywords - Automatic keyword extraction for improved search relevance
Why This Exists
LLMs have limited context windows. This tool helps you:
Store important information as searchable memories with auto-extracted keywords
Search memories by relevance scoring (keywords + tags + recency)
Compress relevant memories into a character budget for context injection
Perfect for teaching context engineering - the art of fitting the right information into limited LLM context.
Quick Start
# Install dependencies
npm install
# Copy environment config (tweak MEMORY_PATH / DeepSeek settings as needed)
cp .env.example .env
# Build the project
npm run build
# Run the CLI
npm run dev
# Or run the MCP server
npm run mcp
# Debug presets live in `.vscode/launch.json` (Run → Start Debugging → pick a config)Heads-up:
project-memory.jsoncontains a few demo memories for workshops. Delete it (or pointMEMORY_PATHelsewhere) before your first real run if you want to start with an empty store.
VS Code GitHub Copilot Integration
1. Build the project
npm run build2. Configure MCP server
The project includes a pre-configured .vscode/mcp.json:
{
"servers": {
"copilot-memory": {
"type": "stdio",
"command": "node",
"args": ["./dist/mcp-server.js"],
"env": {
"MEMORY_PATH": "project-memory.json"
}
}
}
}Run npm run build whenever you change the server so the compiled dist/mcp-server.js stays current.
3. Use the Memory Agent (Recommended)
The project includes a custom Memory agent at .github/agents/memory-agent.agent.md that makes using the memory tools natural.
To use:
Open Copilot Chat in VS Code
Click the agent dropdown (shows "Agent", "Ask", etc.)
Select "Memory"
Chat naturally!
Example conversations:
You: Remember that I prefer functional components over class components
Agent: [Calls memory_write] Saved your preference for functional React components.
You: What preferences do I have stored?
Agent: [Calls memory_search] Based on your stored memories, you prefer...
You: Help me refactor auth.ts
Agent: [Calls memory_search first for context] I found some relevant context about your authentication preferences...4. Direct Tool References (Alternative)
You can also reference tools directly with #:
#memory_write text: "We use PostgreSQL" tags: ["decision", "database"]
#memory_search query: "database"5. Reload VS Code
After any configuration changes, reload VS Code:
Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac)Run "Developer: Reload Window"
MCP Server Features
Tools (7)
Tool | Description |
| Add, save, store, or remember information to project memory |
| Search, find, recall, or look up information from project memory |
| Create compact context from relevant memories within a budget |
| Soft-delete a memory (tombstone, recoverable) |
| Hard-delete by id, tag, or substring match |
| Export all records as JSON |
| Auto-inject shaped context for a task (uses DeepSeek LLM) |
Resources (2)
Resource | URI | Description |
|
| Live statistics (counts, top tags) |
|
| Last 10 memories added |
Prompts (3)
Note: VS Code GitHub Copilot does not currently support MCP prompts. Use the MCP Inspector or other MCP clients to test prompts.
Prompt | Description |
| Generate a summary of memories on a topic |
| Structured template for architectural decisions |
| Auto-inject relevant memories as context for a task |
Context Shaping with DeepSeek
The inject-context prompt supports LLM-powered context shaping via DeepSeek:
{
"task": "refactor the auth module",
"budget": 1500,
"shape": true
}When shape: true:
Raw memories are transformed into task-specific actionable guidance
Output is structured with clear headers (
## Context for:,### Key Constraints)Irrelevant memories are filtered out
Falls back to deterministic compression if DeepSeek isn't configured
This makes context injection more intuitive - instead of raw memory dumps, you get focused guidance like:
## Context for: Auth Module Refactor
### Preferences
- Use JWT tokens (15min access, 7 day refresh)
- Passwords hashed with bcrypt, cost factor 12
### Key Constraints
- Three-layer architecture: Controller → Service → Repository
- All validation via Zod at API boundaryConfiguration
Edit .env:
# Required: where memories are stored
MEMORY_PATH=.copilot-memory.json
# Optional: for LLM-assisted compression
DEEPSEEK_API_KEY=your-key-here
DEEPSEEK_BASE_URL=https://api.deepseek.com
DEEPSEEK_MODEL=deepseek-chatThe MCP configuration in .vscode/mcp.json points at project-memory.json so you can ship a pre-filled sample store. Override MEMORY_PATH in your environment if you want the CLI and MCP server to share a different file.
MCP Inspector
Debug and test the MCP server interactively:
# Launch inspector (opens web UI)
npm run inspect
# Or with live TypeScript reloading
npm run inspect:devThe inspector lets you:
Browse all tools, resources, and prompts
Execute tools and see responses
View raw JSON-RPC message traffic
CLI Commands
See docs/CLI_GUIDE.md for detailed usage and examples.
Command | Description |
| Add a memory |
| Search memories |
| Compress for context |
| Soft-delete |
| Hard-delete |
| Dump JSON |
| Show statistics |
Context Engineering Demo
The memory_compress tool demonstrates key context engineering concepts:
Relevance Scoring - Memories ranked by keyword matches + tag matches + recency
Budget Constraints - Fit context into character limits (200-8000 chars)
Deterministic Compression - Predictable truncation without LLM
LLM-Assisted Compression - Optional DeepSeek summarization for smarter compression
Architecture
.github/
├── agents/
│ └── memory-agent.agent.md # Custom VS Code agent definition
├── prompts/ # Reusable Copilot prompt files
│ ├── add-memory.prompt.md
│ ├── retrieve-memory.prompt.md
│ └── inject-memory.prompt.md
└── copilot-instructions.md # Onboarding for AI coding agents
.vscode/
├── launch.json
├── mcp.json
└── settings.json
docs/
├── CODE_WALKTHROUGH.md # Architecture walkthrough + diagrams
├── CLI_GUIDE.md # CLI usage guide
└── COPILOT_GUIDE.md # VS Code Copilot usage guide
examples/
├── QUICKSTART.md # npm commands cheatsheet
├── COPILOT_CHAT_EXAMPLES.md # 50+ prompt examples
└── scenarios/ # Pre-built memory files for workshops
├── react-developer.json
├── api-backend.json
└── team-decisions.json
src/
├── cli.ts # Interactive REPL
├── mcp-server.ts # MCP stdio server (tools, resources, prompts)
├── memoryStore.ts # Core storage, search, compression
└── deepseek.ts # Optional LLM compression + context shapingnpm Scripts
Script | Description |
| Run CLI with tsx (dev mode) |
| Compile TypeScript to dist/ |
| Run MCP server with tsx |
| Launch MCP Inspector |
| Inspector with tsx (live reload) |
Development Workflow
Task | Recommended action |
Edit + run CLI locally |
|
Serve MCP tools to Copilot |
|
Explore MCP surface area |
|
Update docs/instructions | Keep docs/ and .github/copilot-instructions.md in sync |
External Resources
Author
Tim Warner
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/timothywarner-org/copilot-memory-store'
If you have feedback or need assistance with the MCP directory API, please join our Discord server