alfredoizdev/contextforge-mcp

🧠 Knowledge & Memory🟢 Verified Active
0 Views
0 Installs

📇 ☁️ - Persistent memory for Claude Code, Cursor, and GitHub Copilot via MCP. Semantic search, Git commit/PR sync, project-based organization, team collaboration. Free tier available. npx contextforge-mcp

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "alfredoizdev-contextforge-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "alfredoizdev-contextforge-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

ContextForge MCP — Persistent Memory for Claude, Cursor & Copilot

npm version License: MIT Node.js Glama MCP

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

No install step needed — the setup below runs the server via npx -y contextforge-mcp, which fetches it on demand and keeps it up to date.

Prefer a global install for slightly faster cold starts? npm install -g contextforge-mcp is optional; if you do it, you can drop the npx -y prefix from the commands below.

2. Get your API key

  1. Go to contextforge.dev
  2. Sign up (free tier available)
  3. Settings → API Keys → Generate API Key
  4. 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": "npx",
      "args": ["-y", "contextforge-mcp"],
      "env": {
        "CONTEXTFORGE_API_KEY": "your-api-key-here"
      }
    }
  }
}

Restart Claude Desktop.

Claude Code (CLI)

claude mcp add contextforge -s user \
  -e CONTEXTFORGE_API_KEY=your-api-key-here \
  -- npx -y contextforge-mcp

Restart Claude Code and run /mcp to verify it's connected.

Cursor

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "contextforge": {
      "command": "npx",
      "args": ["-y", "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": ["-y", "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 init

By default, init auto-detects which editor your project uses and writes three 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
  • Startup Context rules — load a short project summary (overview, open tasks, live sessions) from ContextForge at the start of every conversation

Files written:

  • CLAUDE.md for Claude Code (signals: existing CLAUDE.md or .claude/ directory)
  • .cursorrules for Cursor (signals: existing .cursorrules or .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

FlagBehavior
--editor=claudeGenerate only CLAUDE.md
--editor=cursorGenerate only .cursorrules
--editor=allGenerate 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 Startup Context section without touching the rest of your file.


Available Tools

ContextForge provides tools for Knowledge Management, GitHub Integration, Issue Tracking, and Collaboration.

Knowledge Management

ToolDescription
memory_ingestSave knowledge to memory
memory_querySearch your knowledge semantically
memory_list_itemsList all stored items
memory_deleteRemove specific items
memory_ingest_batchSave multiple items at once
memory_delete_batchDelete items by filter

Spaces & Projects

ToolDescription
memory_list_spacesList your spaces
memory_create_spaceCreate a new space
memory_delete_spaceDelete a space
memory_move_spaceMove space to project
memory_list_projectsList your projects
memory_create_projectCreate a new project
memory_delete_projectDelete a project
memory_link_projectLink directory to project
memory_unlink_projectUnlink directory
memory_current_projectShow linked project

GitHub Integration

ToolDescription
memory_git_connectConnect a GitHub repo
memory_git_listList connected repos
memory_git_activateActivate/deactivate webhook
memory_git_syncImport existing history
memory_git_commitsList synced commits
memory_git_prsList synced PRs
memory_git_disconnectDisconnect a repo

Issue Tracking

ToolDescription
issues_listList your issues
issues_createCreate a new issue
issues_startMark as in progress
issues_resolveMark as resolved
issues_resolve_by_nameResolve by title
issues_assignAssign to collaborator
issues_what_nextGet recommendation

Collaboration

ToolDescription
project_shareShare project by email
collaborators_listList collaborators

Snapshots & Export

ToolDescription
memory_snapshot_createCreate a backup
memory_snapshot_listList all snapshots
memory_snapshot_restoreRestore from backup
memory_snapshot_deleteDelete a snapshot
memory_exportExport to JSON/MD/CSV
memory_importImport from file

Utility

ToolDescription
memory_statsView usage statistics
memory_relateLink two items
memory_helpShow 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:

ToolWhat it does
session_updateDeclare what this session is working on ("working on the auth module")
session_listSee other live sessions in the same project and their focus before touching shared areas (pass all_projects: true for the whole org)
session_endExplicitly 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

VariableRequiredDescription
CONTEXTFORGE_API_KEYYesYour API key from the dashboard
CONTEXTFORGE_API_URLNoAPI endpoint (defaults to production)
CONTEXTFORGE_DEFAULT_SPACENoDefault 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 dev

Contributing

Issues and pull requests are welcome at github.com/alfredoizdev/contextforge-mcp.


Support


License

MIT © Alfredo Izquierdo

Related MCP Servers

modelcontextprotocol/server-memoryVerified

📇 🏠 - Knowledge graph-based persistent memory system for maintaining context

🧠 Knowledge & Memory2 views
0xshellming/mcp-summarizer

📕 ☁️ - AI Summarization MCP Server, Support for multiple content types: Plain text, Web pages, PDF documents, EPUB books, HTML content

🧠 Knowledge & Memory0 views
20alexl/claude-engram

🐍 🏠 - Persistent memory and session intelligence for Claude Code. Auto-tracks mistakes, decisions, and context via hooks. Mines session history for patterns and cross-session search. Loop detection, pre-edit warnings, context compaction survival. Runs locally with Ollama.

🧠 Knowledge & Memory0 views
a2cr/a2cr

🐍 ☁️ 🏠 🍎 🪟 🐧 - MCP server for AI-agent handoffs. Saves client-encrypted WorkBaton checkpoints and WorkStash notes so Codex, Claude Code, Roo Code, and other MCP clients can resume work without passing full chat history.

🧠 Knowledge & Memory0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Active

Recent health check succeeded.

Last checked: 7/28/2026, 10:45:27 AM

Unclaimed listing (imported or pending owner verification). Claim it →
★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.