Get persistent memory working with GitHub Copilot in VS Code.
- VS Code 1.102+ (MCP support is GA as of this version)
- GitHub Copilot subscription (Individual, Business, or Enterprise)
- GitHub Copilot Chat extension installed
- Python 3.10+
- pipx installed (
pip install --user pipx && pipx ensurepath)
pipx install memorygraphMCPVerify installation:
memorygraph --versionCreate .vscode/mcp.json in your workspace root:
{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": []
}
}
}For user-level configuration (all workspaces), create the file at:
- macOS/Linux:
~/.vscode/mcp.json - Windows:
%USERPROFILE%\.vscode\mcp.json
- Open VS Code
- Open the Command Palette (
Cmd/Ctrl + Shift + P) - Run: MCP: List Servers
- Find
memorygraphand click Start
Alternatively, MCP servers auto-start when you open Copilot Chat in agent mode.
MCP tools are available in Copilot's Agent mode:
- Open Copilot Chat (
Cmd/Ctrl + Shift + Ior click the Copilot icon) - Click Agent at the top of the chat panel
- Or type
@workspaceto use agent capabilities
In Copilot Chat (Agent mode), ask:
What MCP tools do you have available?
You should see MemoryGraph tools like store_memory, search_memories.
Store a memory:
@workspace Store this for later: The API rate limit is 100 requests per minute
Retrieve it later:
@workspace What's the API rate limit for this project?
{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": ["--profile", "extended"]
}
}
}{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": ["--profile", "extended"],
"env": {
"MEMORY_SQLITE_PATH": "${workspaceFolder}/.vscode/memory.db"
}
}
}
}{
"mcpServers": {
"memorygraph": {
"command": "/Users/yourname/.local/bin/memorygraph",
"args": []
}
}
}Find your path with: which memorygraph
GitHub Copilot Enterprise admins can control MCP access via policies:
- Organization policies may restrict which MCP servers can be used
- Allowed servers list may need to include
memorygraph - Check with your admin if MCP servers aren't working
- MemoryGraph stores data locally by default (
~/.memorygraph/memory.db) - No data is sent to external servers in default configuration
- For enterprise, consider project-scoped databases to isolate data
- MCP tool calls are logged by VS Code
- View logs: Help > Toggle Developer Tools > Console
- Memory data can be exported for compliance review
-
Check VS Code version: Must be 1.102 or later
Help > About > Version -
Verify Copilot Chat extension: Ensure it's installed and enabled
-
Check MCP configuration:
- Command Palette > MCP: List Servers
- Verify memorygraph is listed
-
Test memorygraph manually:
memorygraph --version memorygraph --show-config
-
Check PATH:
which memorygraph
-
Use full path in configuration if command isn't found
- Must use Agent mode - Regular chat doesn't have MCP access
- Restart the MCP server: Command Palette > MCP: Restart Server
- Reload VS Code window: Command Palette > Developer: Reload Window
On macOS:
- System Preferences > Security & Privacy > Privacy > Full Disk Access
- Add VS Code to the list
- Command Palette > MCP: Show Server Logs
- Select
memorygraph - Check for error messages
- Use
@workspaceprefix for memory operations in chat - Store coding conventions - Remember project-specific patterns
- Track debugging solutions - Store what fixed tricky bugs
- Project-scoped memory - Use
.vscode/mcp.jsonper repository
Add this to .github/copilot-instructions.md for automatic memory usage:
## Memory Protocol
### REQUIRED: Before Starting Work
You MUST use `recall_memories` before any task. Query by project, tech, or task type.
### REQUIRED: Automatic Storage Triggers
Store memories on ANY of:
- **Git commit** → what was fixed/added
- **Bug fix** → problem + solution
- **Version release** → summarize changes
- **Architecture decision** → choice + rationale
- **Pattern discovered** → reusable approach
### Timing Mode (default: on-commit)
`memory_mode: immediate | on-commit | session-end`
### Memory Fields
- **Type**: solution | problem | code_pattern | fix | error | workflow
- **Title**: Specific, searchable (not generic)
- **Content**: Accomplishment, decisions, patterns
- **Tags**: project, tech, category (REQUIRED)
- **Importance**: 0.8+ critical, 0.5-0.7 standard, 0.3-0.4 minor
- **Relationships**: Link related memories when they exist
Do NOT wait to be asked. Memory storage is automatic.File locations:
- Project-specific:
.github/copilot-instructions.mdin repo - User-level: VS Code Settings > Copilot > Instructions
- 128 tools max per chat request (MemoryGraph core mode has 9, extended has 11)
- Agent mode required for MCP access
- Workspace trust must be enabled for MCP servers to run
Works with: VS Code 1.102+ with GitHub Copilot Transport: stdio Profiles: core (9 tools), extended (11 tools) Requirements: GitHub Copilot subscription, Agent mode