Context7
Up-to-date docs for AI agents
作者による説明(英語の原文)
Persistent memory MCP server for Claude Code, Cursor, and GitHub Copilot.
この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。
このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。
使っているAIアプリを選んで、設定をコピーしてください。
CONTEXTFORGE_API_KEY, CONTEXTFORGE_API_URL「秘密」と表示された値は、あなたのアカウントの鍵です。絶対に人に教えたり、チャットに貼り付けたりしないでください。
必要なもの
どのアプリを使っていますか?
上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。
Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": [
"-y",
"contextforge-mcp"
],
"env": {
"CONTEXTFORGE_API_KEY": "your-value",
"CONTEXTFORGE_API_URL": "your-value"
}
}
}
}ターミナルでこれを実行します
claude mcp add contextforge --env CONTEXTFORGE_API_KEY=your-value --env CONTEXTFORGE_API_URL=your-value -- npx -y contextforge-mcp動かす前に、空欄の値を入力してください。
プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": [
"-y",
"contextforge-mcp"
],
"env": {
"CONTEXTFORGE_API_KEY": "your-value",
"CONTEXTFORGE_API_URL": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
プロジェクトの .vscode/mcp.json に貼り付けます
{
"servers": {
"contextforge": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"contextforge-mcp"
],
"env": {
"CONTEXTFORGE_API_KEY": "your-value",
"CONTEXTFORGE_API_URL": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。
選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。
CONTEXTFORGE_API_URL envこの設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月6日にチェック
レジストリ名は、リポジトリを所有するGitHubアカウント alfredoizdev で確認済みです
このリポジトリはまだGitHubから読み取っていません
このリポジトリはまだGitHubから読み取っていません
これはパソコンで動くため、インターネット上のエンドポイントはありません
パソコンで動き、代わりにローカルの設定を使います
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
入力が必要なもの:CONTEXTFORGE_API_KEY
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
GitHubリポジトリの最終更新は–、最新バージョン(0.13.3)がレジストリに届いたのは一昨日です。
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにNode.jsも必要です。
同じカテゴリには:Context7, Codebase Memory, Exa
同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。
カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
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.
[!NOTE]
Works automatically, no config needed (v0.5.1+). On connect, the server sends startup instructions to your AI client. Clients that honor them (Claude Desktop, Claude Code) load your project memory at the start of every session and save new decisions proactively — without you editing any settings. Running
init(Step 4) is now a reinforcement, not a requirement, and still helps on clients that don't yet honor server instructions (e.g. Cursor).
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-mcpis optional; if you do it, you can drop thenpx -yprefix from the commands below.
cf_)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 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.
Add to your Cursor MCP settings:
{
"mcpServers": { "contextforge": { "command": "npx", "args": ["-y", "contextforge-mcp"], "env": { "CONTEXTFORGE_API_KEY": "your-api-key-here" } } } }
Add to your Copilot MCP config:
{
"servers": { "contextforge": { "command": "npx", "args": ["-y", "contextforge-mcp"], "env": { "CONTEXTFORGE_API_KEY": "your-api-key-here" } } } }
With v0.5.1+ the server auto-loads memory on supporting clients (see the note at the top), so this step is optional but recommended: it reinforces the behavior, covers clients that don't honor server instructions, and fully overrides the built-in file-based memory.
Set up your project so your AI editor always prefers ContextForge memory:
npx contextforge-mcp init
By default, init auto-detects which editor your project uses and writes three rule sections and two hooks:
SessionStart hook with matcher compact in .claude/settings.json. When Claude Code compacts a long conversation, the hook runs npx -y contextforge-mcp recall and re-injects the session objective, memories relevant to what you are working on, your project's 10 most recent memories and pending tasks, so decisions saved in ContextForge survive the summary.UserPromptSubmit hook that runs the generated script .claude/hooks/contextforge-objective.cjs with plain node (~50 ms). It records your prompts to ~/.contextforge-mcp/sessions/ .jsonl on your machine, so recall can put the session's objective back after a compaction. The log is pruned after 14 days and never uploaded; see the privacy note below for what recall sends.Files written:
CLAUDE.md for Claude Code (signals: existing CLAUDE.md or .claude/ directory).cursorrules for Cursor (signals: existing .cursorrules or .cursor/ directory).claude/settings.json for Claude Code — merged, never overwritten; only the two ContextForge hook groups are added.claude/hooks/contextforge-objective.cjs for Claude Code — the generated objective hook script (safe to commit; refreshed by init when a new version ships; Claude Code's own system turns — prompts that start with an XML-like tag and contain a closing tag — are not logged)If no editor is detected, both files are generated.
On clients that honor server instructions (Claude Desktop, Claude Code), ContextForge is used automatically even without this step. On other clients — or to guarantee the built-in file-based auto-memory never wins — run init: it writes explicit rules that always route memory to ContextForge.
--editor| Flag | Behavior |
|---|---|
--editor=claude | Generate only CLAUDE.md |
--editor=cursor | Generate only .cursorrules |
--editor=all | 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 Startup Context section without touching the rest of your file.
npx contextforge-mcp --version # also: -v, version
Prints the installed version (e.g. contextforge-mcp 0.5.2).
Long sessions get compacted: Claude Code summarizes the conversation to free space, and the summary keeps the gist but drops details — usually the decisions, and often the task itself. init installs two hooks that fix both:
UserPromptSubmit) — records each prompt locally so the session's first real request is never lost to the summary.SessionStart, matcher compact) — fires right after every compaction and prints back, in this order: the session objective and the latest request before the cut; up to 5 memories relevant to the current work (semantic search over the objective, git branch, recent commit subjects and changed files, whatever their age); the project's 10 most recent memories; up to 5 pending tasks; and a reminder to call memory_query for anything older. The whole block stays around 4 KB and is injected once, never pinned, so it does not move the compaction trigger.The relevance search is one metered query per compaction. It only runs when there is a session objective or you are on a non-default branch (git-only context on main is noise), it runs in parallel with the other fetches under the same 6-second stage deadline, so a slow search can never drop the rest of the block, and CONTEXTFORGE_RECALL_RELEVANCE=0 in the environment turns it off entirely.
The hooks run as plain shell commands, so recall reads your API key from CONTEXTFORGE_API_KEY if set, otherwise from the contextforge server entry in ~/.claude.json (where claude mcp add stores it), otherwise from a project .mcp.json. It needs a linked project (.contextforge in the repo root). If anything is missing it prints nothing and never blocks the session. Note that a CONTEXTFORGE_API_KEY exported in your shell profile wins over ~/.claude.json: if it holds an old key, recall silently prints nothing.
Try it by hand from your project directory:
npx contextforge-mcp recall # prints the block for the newest session in this directory
npx contextforge-mcp recall --stats # local numbers: recalls, objective coverage, follow-up queries
Privacy: the prompt log and the recall stats live under ~/.contextforge-mcp/ on your machine and are never uploaded. What leaves the machine: after a compaction, recall sends the session objective (at most 600 characters, together with the git branch, recent commit subjects and changed file names) to ContextForge as the search query, the same way memory_query sends a query; it is not stored. Note that .claude/settings.json is usually committed, so teammates who pull the repo get the prompt hook too; they can remove the UserPromptSubmit group to opt out.
Nothing to reconfigure. Update to the latest and restart your AI client:
npm update -g contextforge-mcp # only if you installed globally; npx users get it on next launch
You do not need to re-run init for the auto-load behavior. To get the post-compaction recall hook and the session objective hook, run npx contextforge-mcp init once in each project; it only adds what is missing. Since 0.13.2 the server reminds you once per project when the recall hook is installed but the objective hook is missing or outdated.
ContextForge defines 69 tools across Knowledge Management, GitHub Integration, Issue Tracking, and Collaboration. No capability was ever removed — every tool below is fully callable — but since v0.11.0 your AI client sees only a small subset by default — 15 since v0.13.3 (11 in 0.11.0–0.13.2) (CONTEXTFORGE_TOOLS=lean, the default):
memory_query, memory_ingest, memory_check_freshness, memory_confirm, memory_correct, memory_forget, tasks_list, tasks_what_next, session_list, memory_help — plus the four that CLAUDE.md / .cursorrules files generated before 0.11.0 call by name, kept visible so those files keep working without re-running init: session_update, memory_current_project, memory_link_project, memory_list_items.Set CONTEXTFORGE_TOOLS=full to expose all 69 tools directly to your client instead, matching the behavior of versions before 0.11.0. See Environment Variables.
Why lean by default: 69 tool schemas cost ~15,000 tokens of context on every session, push past Cursor's 40-tool cap, and contribute to the accuracy degradation several clients show past ~50 tools. The lean set cuts that to ~3,500 tokens (~77% less) while keeping every tool one call away via cf_tools.
##
冒頭だけを表示しています。続きはリポジトリで読めます