Canon Keeper MCP Server
An MCP (Model Context Protocol) server that persists learnings from Copilot conversations to copilot-instructions.md.
No API key required! Copilot extracts learnings using its own LLM, this tool handles deduplication and formatting.
Quick Install
pip install canon-keeper-mcp
python -m canon_keeper_mcp install
# Or specify a workspace
python -m canon_keeper_mcp install --workspace /path/to/project
The installer will:
- ✅ Configure
.vscode/mcp.jsonwith the canon-keeper server - ✅ Enable MCP in
.vscode/settings.json - ✅ Create/update
.github/copilot-instructions.mdwith:- Memory Persistence Protocol (
@Historydirective) - Best practices template
- Session Learnings Log table
- Memory Persistence Protocol (
Features
- Zero Configuration: No API keys needed - uses Copilot's built-in LLM
- Smart Deduplication: Uses Jaccard similarity to avoid duplicate entries
- Simple Integration: Works with Copilot's existing capabilities
- Markdown Formatting: Returns properly formatted table rows for the Session Learnings Log
Usage
After installation, reload VS Code and use these trigger phrases in any Copilot chat:
User: @History save what we learned
User: save this learning
User: remember this
User: add to memory
Copilot will:
- Extract learnings from the conversation (using its own LLM)
- Call the MCP tool to deduplicate against existing entries
- Append new learnings to your
copilot-instructions.md - Report what was saved/skipped
Manual Installation
If you prefer to install manually:
1. Install the package
pip install canon-keeper-mcp
2. Configure MCP server
Add to .vscode/mcp.json:
{
"servers": {
"canon-keeper": {
"type": "stdio",
"command": "/path/to/your/python",
"args": ["-m", "canon_keeper_mcp"]
}
}
}
Note: Replace
/path/to/your/pythonwith the absolute path to your Python executable (e.g.,C:/Users/You/project/.venv/Scripts/python.exeon Windows or/home/you/project/.venv/bin/pythonon Linux/Mac).
3. Enable MCP in VS Code
Add to .vscode/settings.json:
{
"github.copilot.chat.modelContextProtocol.enabled": true
}
4. Add directive to copilot-instructions.md
Add this to your .github/copilot-instructions.md:
### Memory Persistence Protocol (@History)
**Rule:** When the user includes `@History`, `save this`, `remember this`, or `add to memory`:
1. Extract learnings from the conversation as an array of objects with: topic, decision, rationale
2. Read the current `copilot-instructions.md` file content
3. Call MCP tool `canon_keeper.extract_and_save_learnings` with:
- `learnings`: Array of extracted learnings
- `current_instructions`: The full content of copilot-instructions.md
4. If `markdown_to_append` is non-empty, append it to the Session Learnings Log table
5. Report what was saved and what was skipped as duplicates
**Trigger phrases:** `@History`, `save this`, `remember this`, `add to memory`
5. Add Session Learnings Log table
## Session Learnings Log
| Date | Topic | Decision | Rationale |
|------|-------|----------|----------|
MCP Tools
extract_and_save_learnings
Deduplicates learnings against existing entries and formats for markdown.
Input:
learnings(array): Array of learning objects, each with:topic(string): Short topic namedecision(string): The decision or learningrationale(string): Why this decision was made
current_instructions(string): Current copilot-instructions.md content
Example Input:
{
"learnings": [
{
"topic": "MCP Config Format",
"decision": "Use 'servers' key not 'mcpServers'",
"rationale": "VS Code MCP expects this exact format"
}
],
"current_instructions": "... content of copilot-instructions.md ..."
}
Output:
{
"status": "success",
"message": "Found 1 new learning(s), skipped 0 duplicate(s).",
"new_learnings": [...],
"duplicates_skipped": [],
"markdown_to_append": "| 2026-01-18 | MCP Config Format | Use 'servers' key not 'mcpServers' | VS Code MCP expects this exact format |",
"target_section": "Session Learnings Log"
}
check_learning_exists
Check if a specific learning already exists.
Input:
topic(string): Learning topicdecision(string): The decision/learningcurrent_instructions(string): Current copilot-instructions.md content
Output:
{
"exists": true,
"similar_to": "Existing Topic Name",
"similarity_score": 0.85,
"reason": "High similarity to existing entry"
}
How It Works
- Copilot extracts learnings from your conversation using its built-in LLM
- MCP tool deduplicates using Jaccard similarity (threshold: 0.6)
- Tool formats new learnings as markdown table rows
- Copilot appends the formatted rows to your copilot-instructions.md
This approach means:
- ✅ No API keys needed
- ✅ No external LLM calls
- ✅ Fast deduplication
- ✅ Works offline (except for Copilot itself)
License
MIT
Metadata
Release files for canon-keeper-mcp 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| canon_keeper_mcp-0.1.6.tar.gz | 13.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| canon_keeper_mcp-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.0 kB
Release files / canon_keeper_mcp-0.1.6.tar.gz
| Download URL | canon_keeper_mcp-0.1.6.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f117354a7e8e1953fa7858c1c1a33e64d9951b938a12226431ebaa3b8e4e7e15
|
|
BLAKE2b-256 checksum How to use checksums |
605cc11585eeceaabe895fe3d7882910e8462216acdf1f762ceb2b760ddd0eb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / canon_keeper_mcp-0.1.6-py3-none-any.whl
| Download URL | canon_keeper_mcp-0.1.6-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
151b14952e79910ed4f583f82bf7df7784b5929e6a3f2b6ac9c341f5c5a4698e
|
|
BLAKE2b-256 checksum How to use checksums |
c7a4e09e5d1159f008e273bf097e00e0104e18d471cbf104a41f6b689349ab5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for canon-keeper-mcp 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.