Copilot Memory
БесплатноНе проверенCross-session memory layer for GitHub Copilot agent mode that stores fixes/decisions in SQLite and provides tools for save, search, and recall via MCP.
Описание
Cross-session memory layer for GitHub Copilot agent mode that stores fixes/decisions in SQLite and provides tools for save, search, and recall via MCP.
README
Cross-session memory layer for GitHub Copilot agent mode: SQLite for storage, an MCP server (Python SDK) for on-demand recall, and hooks for automatic capture — so a new Copilot session doesn't re-read the whole project or re-diagnose a bug you already fixed.
No Node required, and no LLM API key required either — Copilot does its
own summarizing (see "Capture strategy" below). The only third-party
dependency is mcp (the official Python SDK), and only server.py needs
it — db.py and cli.py are pure stdlib (sqlite3, subprocess), so the
hooks work with plain python3 and no virtualenv activation needed at
hook-run time if you point them at a venv's interpreter directly.
Capture strategy
Copilot itself calls save_memory before finishing a substantial task —
it's instructed to in copilot-instructions.md, and since it already has
full conversation context, it writes a better summary than any script
staring at a bare diff could. This needs no external API call.
The Stop hook is a safety net only: if a session ends without any
memory saved (Copilot forgot, or the task was trivial), it records a plain
"these files changed" fallback — no summarization, just enough to grep
later. It checks session_has_memory() first so it never duplicates a
proper entry Copilot already wrote.
Two files handle two different problems, deliberately kept separate:
PROJECT_MAP.md— static-ish reference (module structure, entry points). Always loaded, cheap, updated manually when structure changes..copilot-memory/memory.db(SQLite) — episodic fix/decision history. Only a short recent-index is always loaded; full detail is pulled viasearch_memoryonly when relevant.
Setup
Copy this folder into your repo as
.copilot-memory-mcp/(or wherever — just keep paths in.vscode/mcp.jsonandhooks/hooks.jsonconsistent).Create a venv and install the one dependency:
cd .copilot-memory-mcp python3 -m venv venv venv/bin/pip install -r requirements.txtIf your VS Code
python3on PATH already hasmcpinstalled globally (e.g. viapip install --user mcp), you can skip the venv and usepython3directly in the configs below.Register the MCP server — copy
.vscode/mcp.jsoninto your repo's.vscode/folder (merge if one exists). If you used a venv, pointcommandat${workspaceFolder}/.copilot-memory-mcp/venv/bin/python3instead of the barepython3. Commit this file so your whole team gets the same server.Wire up the hooks —
hooks/hooks.jsonuses the sameSessionStart/Stophook schema as Claude Code / Copilot CLI. Hook registration location has moved around across VS Code releases, so confirm the exact spot for your version via the/hooksslash command in chat, orDeveloper: Open Agent Debug Panelto verify it's actually firing. Same venv note applies here if you used one — pointpython3at the venv's interpreter.Drop in the templates — copy
templates/PROJECT_MAP.mdand the contents oftemplates/copilot-instructions.mdinto your repo root and.github/copilot-instructions.mdrespectively. Fill inPROJECT_MAP.mdfor real (have Copilot draft it, then trim).Gitignore the database:
.copilot-memory/ __pycache__/It's personal/session history, not something to commit — unlike the MCP config, instructions, and project map, which should all be checked in.
Tools exposed to Copilot
save_memory— record a fix/decision, called by Copilot itself before finishing a substantial task (see "Capture strategy" above).search_memory— look up past fixes by keyword, filename, or error signature before re-investigating something.get_recent_context— short recent-fix index (normally already injected by theSessionStarthook, but callable directly too).
Schema
CREATE TABLE memories (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
session_id TEXT,
summary TEXT NOT NULL,
root_cause TEXT,
fix TEXT,
files_touched TEXT, -- JSON array
error_signature TEXT, -- normalized string for lookup
tags TEXT -- JSON array
);
Notes / known rough edges
- MCP for Copilot Business/Enterprise requires the org-level "MCP servers in Copilot" policy to be enabled — already the case for you, but worth knowing if you take this to other teams.
- Hooks are a newer VS Code feature (landed 1.109, Jan 2026) — behavior and config location may still shift between releases. Re-check after any VS Code update if capture silently stops firing.
- Quality of memory depends on Copilot actually following the instruction
to call
save_memory— it's a prompt, not a guarantee. Skimsearch_memoryresults occasionally and see how many are taggedunsummarized/fallback; a high rate means the instruction isn't landing and may need to be more prominent or repeated closer to task completion. - Verified locally:
db.pyround-trips insert/search/recent correctly, andserver.pystarts cleanly under themcpSDK.
Установка Copilot Memory
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/pradeeps/copilot-mem-mcpFAQ
Copilot Memory MCP бесплатный?
Да, Copilot Memory MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Copilot Memory?
Нет, Copilot Memory работает без API-ключей и переменных окружения.
Copilot Memory — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Copilot Memory в Claude Desktop, Claude Code или Cursor?
Открой Copilot Memory на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
автор: wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
автор: madhurprashPostgres
Query your database in natural language
автор: AnthropicPostgreSQL
Read-only database access with schema inspection.
автор: modelcontextprotocolCompare Copilot Memory with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data
