Skip to main content
Glama
FedgeNo

conventions-mcp

by FedgeNo

conventions-mcp

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.

Why this one

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:

  • Narrow taxonomy, not a general note-taking store. Every capture must be a durable rule for future work and gets classified into one of five purpose-built types — convention, instruction, correction, preference, other — plus a project field and topic tags. Task-specific procedures and work history are excluded so retrieval stays precise instead of noisy.

  • Deterministic retrieval, not best-effort. Most memory MCPs rely entirely on the calling model noticing a tool description is relevant and deciding to call it — which fails silently and inconsistently. Codex and Claude Code hooks force the agent to call list_rules: SessionStart supplies the instruction, while PreToolUse denies every other tool until the call has happened.

  • Transparent by default, not silent. Every capture and update echoes the verbatim stored content and whether it's global or project-scoped back immediately, so a misheard or misclassified rule is visible and correctable on the spot — not something you discover three sessions later via search.

  • Fully local at runtime. SQLite + local embeddings, no hosted service, no per-token costs, no API key. The embedding model is downloaded once on first use (or explicitly with 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.

  • Project-scoped without fuzzy matching. A rule can be global (the default) or tied to one specific codebase. Stdio clients derive the project from their working directory; HTTP clients provide an MCP root or an 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.

Related MCP server: project-brain-mcp

What it's tuned to store

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.

Separately, every thought gets a project field — null by default (applies everywhere), or a specific project id if it's scoped to the current codebase. The calling agent only judges whether it's project-scoped (projectScoped); the actual project id is derived deterministically from the working directory — the absolute path with separators turned into dashes, e.g. /var/www/html-var-www-html, matching the per-project directory name Claude Code itself uses under ~/.claude/projects/. The model never names the project, so retrieval can do an exact match instead of fuzzy text comparison.

  • Storage: SQLite (better-sqlite3) + sqlite-vec for native vector search, FTS5 for keyword search, combined via reciprocal rank fusion. One file, no server, no daemon.

  • Embeddings: local, via Xenova/bge-small-en-v1.5 (384-dim, quantized, ~130MB). Downloads once, loads lazily, and needs no GPU.

  • Classification: done by the calling agent (Claude Code, or any MCP client) at capture time, guided by the tool description — no network call, no external model, no API key.

  • Transport: MCP over stdio by default, with an optional localhost-only Streamable HTTP mode for running it as a persistent service.

  • Proactive retrieval: Codex and Claude Code hooks (see below) load or enforce standing rules at every context boundary — no project instruction file to keep in sync, no dependence on the model happening to notice a tool description is relevant.

  • Scoped retrieval: 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.

Setup

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
conventions-mcp init-db    # creates ~/.conventions-mcp/memory.db
conventions-mcp warmup     # downloads and verifies the embedding model

Nothing to configure — there's no API key and no external service. MEMORY_DB_PATH is the only environment variable this reads, and it's optional (see .env.example).

Persistent local service

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.

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.

Register with Claude Code

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
# arbitrary working directory:
claude mcp add --scope user conventions -- node /absolute/path/to/conventions-mcp/src/server.js

# npm package — already on PATH:
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.

Codex standing-rule hook

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 after /clear and compaction, when the loaded rules leave context. 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.

Claude Code standing-rule hooks

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 large enough stored rule set gets silently truncated to a small preview before it ever reaches the model). It also re-arms the enforcement gate after a compaction or /clear (the two events that drop the already-loaded rules from context), so a reload is forced then too.

  • bin/prompt-reminder.js fires on every turn with a static reminder to follow the loaded conventions and to capture only genuinely durable rules intended for future sessions or repeated work. It explicitly excludes task-specific directions, temporary choices, current status, incident history, one-job commands, and records of how an individual job was completed.

  • bin/pre-tool-check.js fires before every tool call and denies it outright until list_rules has run this session — the first two hooks are advisory (reminders only), so this is the layer that actually enforces the requirement. It's forced once per session, not once per turn.

None of the three touch the database directly. list_rules resolves the current project from the stdio working directory, an MCP root, or the HTTP project's X-Conventions-Project header.

npm package: the scripts live inside the global install rather than a known clone path — resolve it first with npm root -g, then point the hook at $(npm root -g)/conventions-mcp/bin/session-rules.js the same way.

Windows: point the command at the .cmd wrapper instead of the .js file directly (no node prefix — the batch file invokes it) — bin\session-rules.cmd / bin\prompt-reminder.cmd / bin\pre-tool-check.cmd for a git checkout, or the equivalent path under npm root -g for the npm package.

Tools

Tool

Description

capture_thought

Save a convention, instruction, correction, or preference. Embeds locally; classification is provided by the calling agent.

update_thought

Correct/refine an existing thought in place — same id, re-embedded and re-tagged from the new content.

search_thoughts

Hybrid semantic + keyword search.

list_thoughts

List all captures, optionally filtered by type.

list_rules

Every global + current-project rule in one deterministic call — no embeddings, no ranking, ordered by id. What the hooks use under the hood.

thought_stats

Totals, type breakdown, top topics, and per-project counts.

delete_thought

Permanently delete a thought by id.

Notes

  • If a single message states several distinct rules, capture_thought gets called once per rule, each relayed individually — not merged into one capture or summarized together.

  • The database lives at data/memory.db in a git checkout, or ~/.conventions-mcp/memory.db for the npm package (override either with MEMORY_DB_PATH). It's gitignored and created with private permissions. Use conventions-mcp backup <absolute-destination> for a live-safe, integrity-checked backup. docs/shared-service.md shows a scheduled setup.

  • To upgrade embedding quality later without re-architecting, swap MODEL_NAME in src/embeddings.js — but re-embed existing thoughts if the new model's vector space isn't compatible with the old one (different models' embeddings aren't comparable, even at the same dimension).

Available Tools

4 tools
capture_thoughtCapture Convention or InstructionA

Save a coding convention, standing instruction, correction, or workflow preference for future reference — e.g. style rules ('always use 2-space indent'), standing directives ('never force-push to main'), a correction after getting something wrong, or a stated preference for how work should be done. Call this whenever the user states a rule or preference for how you should work, corrects your approach, or explicitly asks you to remember something — don't wait to be asked to 'save' it. Occasional non-coding notes are fine too, but this store is primarily for conventions and instructions that should carry across future sessions and projects. Classify it yourself using the type/scope/topics/projectSpecific fields below, based on the conversation the thought came from. If a single message states multiple distinct rules, call this once per rule — don't merge them into one capture — and relay each one individually the same as a single capture, not summarized together. After every successful call, state the captured content verbatim and its scope back to the user (the response text already contains both) — this is how they catch a misinterpreted rule and correct or delete it immediately, rather than discovering it wrong much later.

ParametersJSON Schema
NameRequiredDescriptionDefault
typeYesClassify using the conversation this thought came from: 'convention' — a specific coding style/pattern rule; 'instruction' — a standing directive on how to work/behave; 'correction' — a past mistake and the corrected approach; 'preference' — a softer preference, not a hard rule; 'other' — anything else that still belongs in this store.
scopeYesThe language, framework, or general topic this applies to (e.g. 'PHP', 'SQL', 'git') — or 'global' if it isn't tied to a particular language/framework.
topicsYes1-3 short topic tags (e.g. 'git', 'testing', 'naming').
contentYesThe convention, instruction, or thought to capture — a clear, standalone statement that will make sense when retrieved later, in a different session, with no other context
projectSpecificYesTrue ONLY if this explicitly names one project/codebase or is obviously about its specific files/architecture — false (the default assumption) for anything that could apply across projects.

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, description carries full burden. It explains the store persists across sessions and is primarily for conventions. It also instructs agent to echo captured content back. However, it does not disclose potential side effects (e.g., overwrites or appends, storage limits, error handling).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is moderately concise; it front-loads purpose and usage but contains some redundancy (e.g., multiple examples of conventions). Could be trimmed without losing critical guidance. Still, every sentence serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 required parameters and no output schema, description covers purpose, usage, parameter classification, and post-call behavior. However, it lacks details on error conditions, duplicate handling, and storage limits, which would be needed for full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers all 5 parameters with descriptions, so baseline is 3. Description adds value by advising on classification based on conversation and emphasizing that content must be a clear, standalone statement. This goes beyond schema to guide agent on proper use.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool saves coding conventions, instructions, corrections, and preferences for future reference. It provides specific examples and distinguishes itself from siblings (delete_thought, search_thoughts, thought_stats) by focusing on capture.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit guidance on when to call: 'whenever the user states a rule or preference...' and what not to do: 'don't wait to be asked to save it.' Also covers handling multiple rules: call once per rule. Distinguishes primary use from occasional non-coding notes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

delete_thoughtDelete a Captured ThoughtA

Permanently delete a specific captured thought by its ID. This is destructive and irreversible — no undo, no trash. Only call this when the user explicitly asks to delete, remove, or forget a specific thought. Never call it proactively, as a side effect of another action, or on a guess at which ID they mean — if the ID isn't already known from context, use search_thoughts or list_thoughts first and confirm with the user which one before deleting.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe numeric ID of the thought to delete, as shown in search_thoughts/list_thoughts output (e.g. the '#4' in a result)

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that deletion is 'destructive and irreversible — no undo, no trash'. Since no annotations provided, description fully addresses behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose, no wasted words. Structured effectively.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with 1 param, no annotations, no output schema, the description covers all essential aspects: purpose, irreversibility, proper usage, and alternative actions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and schema already explains the 'id' parameter well. Description adds no additional meaning for the parameter itself, staying at baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'permanently delete a specific captured thought by its ID' with specific verb and resource. Distinguishes from siblings by emphasizing destructive nature.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use (user asks to delete/remove/forget) and when not (proactively, as side effect, on guess). Provides alternative: use search_thoughts/list_thoughts first and confirm with user.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_thoughtsSearch Conventions and InstructionsA

Look up previously stored coding conventions, standing instructions, and preferences, by meaning and by exact keyword match (hybrid search). Call this proactively before starting unfamiliar coding work, or when uncertain about a style/convention choice in a project — don't wait for the user to ask. Also call it when the user references a past preference or rule ('like we discussed', 'the usual way', 'you know how I like it').

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYesWhat to search for

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Describes hybrid search (by meaning and exact keyword), which is key behavioral info. Lacks details on performance or return format, but adequate for a search tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first defines purpose, second gives usage guidance. Concise and front-loaded. Second sentence is slightly long but still efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With two simple parameters and no output schema, description covers purpose and usage well. Lacks return format or parameter details, but overall sufficient for an agent to understand when and how to use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50% (query has description, limit does not). Description adds no parameter-specific details beyond schema. Does not explain limit or query context further, so baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'look up' and resource 'previously stored coding conventions, standing instructions, and preferences'. Distinguishes from sibling tools like capture_thought (store) and delete_thought (delete).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance: 'Call this proactively before starting unfamiliar coding work' and 'when the user references a past preference or rule'. Even advises against waiting for user request.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

thought_statsThought StatisticsA

Get a summary of everything captured: totals, types, top topics, and scopes (which languages/projects/contexts have the most stored conventions).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It states what the summary includes but lacks details on performance, data freshness, or side effects. As a read-only tool, this is minimally adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the purpose and lists key output components without unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no input parameters and no output schema, the description adequately outlines what the tool returns. It could specify limitations like the number of top topics, but is sufficient for a simple aggregation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has no parameters, and the input schema coverage is 100%. The description adds value by detailing the content of the summary, meeting the baseline expectation for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool provides a summary of captured data including totals, types, top topics, and scopes. It effectively distinguishes from sibling tools (capture_thought, delete_thought, search_thoughts) by focusing on aggregation and statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for obtaining an overview of captured conventions, but does not explicitly compare to alternatives or give exclusions. However, the purpose is straightforward with no parameters, making usage clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv2.1.0
    • First observedcapture_thought
    • First observeddelete_thought
    • First observedsearch_thoughts
    • First observedthought_stats

TDQS

A4.1/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a distinct purpose: capture saves new thoughts, deletes removes by ID, search retrieves by meaning/keyword, and stats provides an overview. No overlap in functionality.

Naming Consistency4/5

Three tools use verb_noun pattern (capture_thought, delete_thought, search_thoughts) while thought_stats uses noun_verb, but all consistently include 'thought' as the base noun, making them readable.

Tool Count4/5

Four tools is a reasonable count for a convention management server. It covers creation, deletion, search, and statistics without being excessive.

Completeness3/5

Missing update functionality for existing thoughts; users can only delete and recapture. Also lacks a 'list all' tool, though search can approximate it. The gaps may force agents to work around them.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server that provides persistent memory and contextual awareness to language models, enabling project onboarding, recall of architectural rules, and code consistency across sessions.
    32
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that provides CLI coding agents with persistent decision memory, codebase dependency-graph awareness, plan validation against architectural constraints, and a self-bootstrapping constraints.md file.
    22
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    A local, cross-editor MCP server that provides persistent memory for coding agents, capturing and recalling decisions, conventions, and fixes across sessions without API keys.
    -