contextforge-mcp
ContextForge MCP gives AI coding assistants (Claude, Cursor, Copilot) persistent, searchable memory across sessions via the Model Context Protocol. Here's what you can do:
Knowledge Management
Save, search (semantically), retrieve, list, relate, and delete memory items, including batch operations
Link related items with typed relationships (e.g. references, depends_on, supersedes)
View memory usage statistics
Spaces & Projects
Create, list, move, and delete spaces and projects
Link/unlink local directories to projects for automatic query scoping; check the current linked project
GitHub Integration
Connect repositories to sync commits and pull requests into memory
List connected repos, activate/deactivate webhooks, trigger manual syncs, and browse synced commits/PRs
Task / Issue Tracking
Create, list, update, assign, start, resolve, and delete tasks (with priorities, due dates, tags)
Add and view task comments; get AI-driven next-task recommendations
Collaboration
List project collaborators and share projects via email invitation
Snapshots & Export/Import
Create, list, restore, and delete memory snapshots for backup/recovery
Export memory to JSON, Markdown, or CSV; import from ContextForge, Markdown, Notion, or Obsidian formats
AI Skills (Prompt Templates)
Create, list, update, delete, and execute reusable prompt templates with configurable variables, LLM model selection, and optional output saving to memory
Routines (Scheduled Automation)
Schedule Skills to run automatically via cron expressions or presets (hourly/daily/weekly/monthly)
List, update, toggle, run immediately, and delete routines
Session Coordination & Help
Declare session focus, list live sessions, end sessions (for multi-session environments)
Get usage instructions via
memory_help
Allows syncing GitHub commits and pull requests into the memory system.
Provides persistent memory for GitHub Copilot, enabling knowledge retention across sessions.
ContextForge MCP — Persistent Memory for Claude, Cursor & Copilot
Give Claude Code, Cursor, and GitHub Copilot persistent memory across sessions via the Model Context Protocol (MCP). Stop re-explaining your project every time.
ContextForge MCP is an open-source MCP server that connects your AI coding assistants to long-term, searchable memory. Decisions, architecture notes, debugging context, and project knowledge stay available across every session — across every tool that supports MCP.
🧠 Persistent memory — your AI remembers everything across sessions, days, and weeks
🔍 Semantic search — find knowledge by meaning, not keywords
🔗 One memory, every tool — Claude Code, Cursor, Copilot, Claude Desktop, Windsurf
🐙 Git integration — sync commits and PRs automatically
✅ Task tracking — issues, assignments, and project status
👥 Team collaboration — share projects and memory with your team
🆓 Free tier — get started without a credit card
Quick Start
1. Install
npm install -g contextforge-mcp2. Get your API key
Go to contextforge.dev
Sign up (free tier available)
Settings → API Keys → Generate API Key
Copy your key (starts with
cf_)
3. Connect to your AI tool
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"contextforge": {
"command": "contextforge-mcp",
"env": {
"CONTEXTFORGE_API_KEY": "your-api-key-here"
}
}
}
}Restart Claude Desktop.
Claude Code (CLI)
claude mcp add contextforge \
-e CONTEXTFORGE_API_KEY=your-api-key-here \
-- contextforge-mcpRestart Claude Code and run /mcp to verify it's connected.
Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": ["contextforge-mcp"],
"env": {
"CONTEXTFORGE_API_KEY": "your-api-key-here"
}
}
}
}GitHub Copilot (VS Code)
Add to your Copilot MCP config:
{
"servers": {
"contextforge": {
"command": "npx",
"args": ["contextforge-mcp"],
"env": {
"CONTEXTFORGE_API_KEY": "your-api-key-here"
}
}
}
}4. Initialize your project (required)
Set up your project so your AI editor knows to use ContextForge memory:
npx contextforge-mcp initBy default, init auto-detects which editor your project uses and writes two rule sections:
Memory rules — route memory questions to ContextForge instead of the built-in file memory
Session Presence rules — make parallel sessions check for each other at conversation start and before big changes
Files written:
CLAUDE.mdfor Claude Code (signals: existingCLAUDE.mdor.claude/directory).cursorrulesfor Cursor (signals: existing.cursorrulesor.cursor/directory)
If no editor is detected, both files are generated.
Without this step, your AI will silently ignore ContextForge for memory queries — even though the MCP is connected — because the built-in auto-memory wins by default.
Override with --editor
Flag | Behavior |
| Generate only |
| Generate only |
| Generate both, skip detection |
Re-running init is idempotent per section — sections you already have are left untouched; missing ones are appended. Upgrading from an older version? Just re-run npx contextforge-mcp init: it adds the new Session Presence section without touching the rest of your file.
Related MCP server: AIVectorMemory
Available Tools
ContextForge provides tools for Knowledge Management, GitHub Integration, Issue Tracking, and Collaboration.
Knowledge Management
Tool | Description |
| Save knowledge to memory |
| Search your knowledge semantically |
| List all stored items |
| Remove specific items |
| Save multiple items at once |
| Delete items by filter |
Spaces & Projects
Tool | Description |
| List your spaces |
| Create a new space |
| Delete a space |
| Move space to project |
| List your projects |
| Create a new project |
| Delete a project |
| Link directory to project |
| Unlink directory |
| Show linked project |
GitHub Integration
Tool | Description |
| Connect a GitHub repo |
| List connected repos |
| Activate/deactivate webhook |
| Import existing history |
| List synced commits |
| List synced PRs |
| Disconnect a repo |
Issue Tracking
Tool | Description |
| List your issues |
| Create a new issue |
| Mark as in progress |
| Mark as resolved |
| Resolve by title |
| Assign to collaborator |
| Get recommendation |
Collaboration
Tool | Description |
| Share project by email |
| List collaborators |
Snapshots & Export
Tool | Description |
| Create a backup |
| List all snapshots |
| Restore from backup |
| Delete a snapshot |
| Export to JSON/MD/CSV |
| Import from file |
Utility
Tool | Description |
| View usage statistics |
| Link two items |
| Show help |
Session Presence (multi-session coordination)
Running several Claude Code sessions in parallel (worktrees, agent teams)? Each MCP process automatically registers itself as a live session and heartbeats while it runs. On a clean exit the session is removed at once (a detached helper delivers the goodbye even while the host process is being killed); if the process dies hard, the session expires ~10 minutes after its last heartbeat. Three tools let the agent coordinate:
Tool | What it does |
| Declare what this session is working on ("working on the auth module") |
| See other live sessions in the same project and their focus before touching shared areas (pass |
| Explicitly end this session's presence (also automatic on exit) |
By default session_list is scoped to the current project — where work
actually collides. In a multi-project organization, pass all_projects: true
to see every session, or project: "<name-or-id>" to scope elsewhere.
Recommended pattern for your CLAUDE.md: call session_list when a
conversation starts; call session_update when starting or switching tasks.
Natural Language Examples
You don't need to memorize commands — just talk naturally to your AI:
# Knowledge
"Save this: we use PostgreSQL for the main database"
"What database do we use?"
"List my spaces"
# GitHub
"Connect my repo github.com/myuser/myproject"
"What commits did I make today?"
"Show PRs merged this week"
# Issues
"Create an issue: Update the login page design"
"What's pending?"
"What should I work on next?"
"Mark the login issue as done"Environment Variables
Variable | Required | Description |
| Yes | Your API key from the dashboard |
| No | API endpoint (defaults to production) |
| No | Default space for operations |
How it works
ContextForge MCP is a thin client that translates Model Context Protocol tool calls into authenticated HTTP requests against the ContextForge API. Your knowledge is stored, indexed (semantic embeddings), and retrieved on the server side — the MCP client itself is stateless.
This means:
No infra to manage — no local databases, no embeddings to run, no vector stores to maintain
Works everywhere your AI works — same memory across Claude Code, Cursor, Copilot, etc.
Team collaboration — shared projects sync in real time
Dashboard
Manage your memory visually at contextforge.dev:
View and organize your knowledge
Search and filter memories
Manage API keys and billing
Track issues and collaborate
Export and backup data
Development
# Clone and install
git clone https://github.com/alfredoizdev/contextforge-mcp.git
cd contextforge-mcp
npm install
# Build
npm run build
# Run tests
npm test
# Watch mode
npm run devContributing
Issues and pull requests are welcome at github.com/alfredoizdev/contextforge-mcp.
Support
💬 Questions: support@contextforge.app
License
MIT © Alfredo Izquierdo
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/alfredoizdev/contextforge-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server