Context7
Up-to-date docs for AI agents
作者提供的说明(英文原文)
Memory for coding conventions and standing instructions that persists across sessions.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"conventions": {
"command": "npx",
"args": [
"-y",
"conventions-mcp"
]
}
}
}在终端中运行这条命令
claude mcp add conventions -- npx -y conventions-mcp粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"conventions": {
"command": "npx",
"args": [
"-y",
"conventions-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"conventions": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"conventions-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日
注册名称已通过 GitHub 账户 FedgeNo 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(3.1.1)于2个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:Context7, Codebase Memory, Exa
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况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、图片和脚本已被移除。链接会离开本站。
Personal memory for durable coding conventions and standing instructions — one store, any MCP-compatible AI client, available in every project. It holds rules like "always use 2-space indent in this language," "never force-push to main," lasting corrections, and long-lived workflow preferences that should carry across future sessions rather than get re-explained every time. It is deliberately not a history of individual jobs or a place for task-specific directions, temporary decisions, current status, or one-off commands.
There's no shortage of memory MCP servers — several well-established ones (mem0/OpenMemory, Zep/Graphiti, the official reference memory server, plus a long tail of smaller projects) already do "remember things across sessions." What's different here:
list_rules: SessionStart supplies the instruction, while PreToolUse denies every other tool until the call has happened.conventions-mcp warmup) and then runs locally. Classification (type/topics/projectScoped) is done by the calling agent at capture time, guided by the tool description — it already has the full conversation the thought came from, richer context than an isolated content string would give a separate extractor model.X-Conventions-Project header. The project identifier is never guessed by an LLM from free text.If what you want is a general-purpose "remember everything" store, or you're not on Claude Code and don't need the hook-driven determinism, one of the more general options above may fit better. This one is for someone who specifically wants a tight, coding-convention-focused memory that stays accurate and doesn't require trusting the model to remember to check it.
Every capture is classified into one of five types by the calling agent, guided by capture_thought's tool description (src/server.js):
| Type | What it means |
|---|---|
convention | A specific coding style/pattern rule (e.g. "always use 2-space indent") |
instruction | A standing directive on how to work/behave (e.g. "never force-push to main") |
correction | A lasting correction to future behavior |
preference | A long-lived softer preference, not a hard rule |
other | Another durable, future-facing rule that does not fit the four specific types |
Each thought also gets 1–3 topic tags for filtering. This is deliberately narrow — it's not a general note-taking store — but the taxonomy isn't hardcoded logic, it's just the wording of the tool description and its zod schema in src/server.js. Retuning what counts as a convention vs. an instruction, or adding a new type, is a matter of editing that description text, not restructuring the code. The one wrinkle: the five type names are also referenced in the type filter's enum in list_thoughts (src/server.js) — if you rename or add a type, update that enum too or the new type will get rejected as a filter value. Everything's stored as a JSON blob column, so none of this needs a schema migration.
Every thought gets a project field: null applies everywhere; otherwise it is the normalized absolute path prefixed by path:. Separators are preserved, so /work/a-b and /work/a/b identify different projects. The calling agent only decides *whether* a rule is project-scoped. Existing hyphen-based IDs require the explicit, backup-first project migration in upgrading.md.
better-sqlite3) + sqlite-vec for native vector search, FTS5 for keyword search, combined via reciprocal rank fusion. One file, no server, no daemon.Xenova/bge-small-en-v1.5 (384-dim, quantized, ~130MB). Downloads once to ~/.conventions-mcp/models, loads lazily, and needs no GPU.list_rules and semantic search return global rules plus the current project's rules; project-specific rules from other codebases stay out of normal retrieval. list_thoughts remains the explicit all-records management view.Installing with an AI coding agent? Give it this repository and ask it to
follow the canonical installation and client-integration runbook.
The runbook requires path discovery, config merging rather than overwriting,
a real capture/list/delete acceptance test, and cleanup of the test record.
Two ways to get this: a git checkout (if you want to read/modify the source) or the npm package (if you just want it running).
Git checkout:
npm install
npm run init-db # creates data/memory.db
npm package:
npm install -g conventions-mcp --onnxruntime-node-install-cuda=skip
conventions-mcp init-db # creates ~/.conventions-mcp/memory.db conventions-mcp warmup # downloads and verifies the embedding model
No API key or external service is required. Optional database, model-cache, transport, and timeout settings are listed in .env.example.
Use conventions-mcp --help to inspect the installed commands and conventions-mcp --version to confirm which release is on PATH. See SECURITY.md for the local trust model and private reporting instructions. Run conventions-mcp doctor for a non-downloading runtime, database, permission, vector-extension, and model-cache readiness report. Legacy databases without format metadata require the backup-first conventions-mcp migrate-storage command; declared incompatible formats are rejected rather than guessed.
Use Streamable HTTP when the MCP client should connect to one boot-managed server instead of launching a stdio child for every session:
MCP_TRANSPORT=http MCP_HTTP_HOST=127.0.0.1 MCP_HTTP_PORT=47123 conventions-mcp
Run that command under the operating system's service manager and configure the MCP client with http://127.0.0.1:47123/mcp. See docs/shared-service.md for complete systemd, launchd, and Windows setup and verification instructions. The server rejects non-local host headers when bound to localhost. MCP_HTTP_HOST defaults to 127.0.0.1 and MCP_HTTP_PORT defaults to 47123. The service exposes GET /healthz for loopback readiness checks and bounds retained sessions with MCP_HTTP_MAX_SESSIONS (default 100) and MCP_HTTP_SESSION_IDLE_MS (default 30 minutes).
HTTP clients that support MCP roots need no additional project configuration. For clients that do not, set X-Conventions-Project to the absolute project path in project-local MCP configuration. An HTTP session without either value receives global rules only and cannot create a project-scoped capture, which prevents one project's rules from leaking into another project.
Codex can supply the active workspace to a shared HTTP server dynamically:
[mcp_servers.conventions]
url = "http://127.0.0.1:47123/mcp" http_headers_helper = "conventions-mcp codex-project-header"
Codex runs the helper in the active workspace. The server normalizes that absolute path and prefixes it with path: for its project identifier.
Register at user scope so it's available in every project, not just one repo — use the claude mcp add CLI, not a hand-edited config file:
# Git checkout — an absolute path, since Claude Code may spawn this from an
claude mcp add --scope user conventions -- node /absolute/path/to/conventions-mcp/src/server.js
claude mcp add --scope user conventions -- conventions-mcp
Either way, this writes to ~/.claude.json's mcpServers key, which is what the CLI actually reads; a mcpServers entry placed directly in ~/.claude/settings.json is silently inert. Verify with claude mcp list. A new Claude Code session is required to pick up a newly-registered server.
hooks/hooks.json contains user-scoped Codex SessionStart and PreToolUse hooks. The first tells the agent to call list_rules; the second denies every other tool until that call happens. The gate is re-armed on every start, resume, /clear, and compaction, even if the restored conversation contains an earlier rule load. The rules themselves are not placed in hook output, so a large rule set cannot be truncated before the agent receives it from the MCP tool.
Install it as ~/.codex/hooks.json. If that file already contains hooks, merge this file's SessionStart and PreToolUse entries instead of replacing the existing configuration. The hook expects the MCP server to be registered as conventions, matching the setup command above, and the installed conventions-mcp command to be on PATH. Open /hooks once in Codex to review and trust the newly installed hooks; a new session is required before a startup hook can fire.
Checkout users can invoke the absolute Node executable and bin/cli.js path for Codex hooks too; see installation. A global npm copy is not required. Hook gates unlock on an attempted list_rules call, including a failed call; the calling agent must still handle failures and obtain the rules.
Three hooks in ~/.claude/settings.json enforce list_rules before tool use — the first two provide reminders, the third actually enforces it:
{
"hooks": { "SessionStart": [ { "hooks": [{ "type": "command", "command": "node /absolute/path/to/conventions-mcp/bin/session-rules.js", "timeout": 15 }] } ], "UserPromptSubmit": [ { "hooks": [{ "type": "command", "command": "node /absolute/path/to/conventions-mcp/bin/prompt-reminder.js", "timeout": 5 }] } ], "PreToolUse": [ { "matcher": "*", "hooks": [{ "type": "command", "command": "node /absolute/path/to/conventions-mcp/bin/pre-tool-check.js", "timeout": 5 }] } ] } }
bin/session-rules.js fires at session start and emits a short reminder to call list_rules first — rather than embedding rule content in the hook output directly, which doesn't scale (a larg只显示了开头部分;其余内容请在仓库中阅读