stockroom
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
stockroom
A tiny, open-source context system. It catalogs everything your agents need to know (code, design tokens, written rules, and approved and rejected examples) into one SQLite file, and gives agents eight small tools to ask it precise questions.
It's the companion to the kirupa.com article Building Your Own Context System, which walks through how and why every piece works. The short version of the idea is in Context Systems: How an AI Factory Knows What It Needs.
No dependencies. It uses the SQLite that ships inside Node.js (22.13 or newer).
One file. The whole catalog is
.stockroom/context.db. Delete it and rebuild any time.Works with any agent.
stockroom serveis a Model Context Protocol (MCP) server.Honest about what it doesn't know. A stale index refuses to answer, and files it skipped on purpose say why.
Try it in a minute
git clone https://github.com/kirupa/stockroom.git
cd stockroom/examples/crumb-and-co
node ../../bin/stockroom.js build
node ../../bin/stockroom.js report
node ../../bin/stockroom.js rules illustration arrow
node ../../bin/stockroom.js symbol --primaryThe examples/crumb-and-co folder is a pretend bakery's Context Environment: a small website, a slide deck, a figure library, icons, five guidance files, and approved and rejected examples. A few problems are planted in it on purpose, and stockroom report finds them.
Related MCP server: tero-mcp-lite
Lay out your shelves
A Context Environment is a folder. A stockroom.json at its top level says which subfolders (shelves) to catalog and what kind of work each one is for:
{
"name": "Crumb & Co.",
"shelves": [
{ "path": "site", "kind": "code", "for": ["web"] },
{ "path": "decks", "kind": "code", "for": ["slides"] },
{ "path": "figures", "kind": "code", "for": ["illustration"] },
{ "path": "icons", "kind": "code", "for": ["illustration", "slides", "web"] },
{ "path": "guidance", "kind": "guidance" },
{ "path": "examples", "kind": "example" }
],
"maxFileBytes": 262144
}Without a stockroom.json, everything under the folder is cataloged, Markdown files count as guidance, and everything else counts as code.
Guidance is Markdown. Front matter says which kinds of work it applies to, and every heading becomes a section an agent can read on its own:
---
for: [illustration, slides]
summary: How arrows start, bend, and land in figures and slides.
---
# Arrows
## Callout arrows
- A callout arrow starts at the middle of its caption...Examples go in examples/<kind of work>/<approved or rejected>/. A Markdown file with the same name next to an example (a sidecar) holds the reason:
examples/illustration/rejected/order-flow-v1.svg
examples/illustration/rejected/order-flow-v1.md <- verdict, note, and the storyCommands
Command | What it does |
| Catalogs every shelf into |
| Rebuilds whenever a file on a shelf changes. |
| Shows what's in the index and which files changed since the last build. |
| Lists broken references, classes, ids, and tokens that are used but never defined, figure colors that aren't in the palette, and files skipped on purpose. |
| Checks that a file still matches the hash an edit was based on. |
| Runs the MCP server over stdio. |
Every tool is also a command, so you can ask the same questions your agents ask: search, symbol, read, ls, uses, used-by, rules, and examples. Run stockroom help for the details. Add --json for structured output, and --root=<dir> to point at a different Context Environment.
The tools
Tool | The question it answers |
| Which files and lines contain this text? |
| Where is this class, id, token, function, or color defined, and where is it used? |
| Show me these lines of this file, or this one section of a guidance file. |
| What's in this folder, with a one-line summary of each file? |
| What does this file pull in, and does each one exist? |
| Which files pull in this file? |
| Which rules apply to this kind of work, about this topic? |
| What has been approved and rejected for this kind of work, and why? |
Each MCP session gets 40 lookups by default (set STOCKROOM_MAX_CALLS to change it), and each answer is capped at 16,000 characters. read_source returns at most 200 lines and always includes the file's sha256.
Plug in an agent
Install it once:
npm install -g github:kirupa/stockroomGitHub Copilot CLI (~/.copilot/mcp-config.json):
{
"mcpServers": {
"stockroom": {
"type": "local",
"command": "stockroom",
"args": ["serve", "--root=/path/to/your/context"],
"tools": ["*"]
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"stockroom": {
"type": "stdio",
"command": "stockroom",
"args": ["serve", "--root=${workspaceFolder}"]
}
}
}Claude Code:
claude mcp add stockroom -- stockroom serve --root=/path/to/your/contextKeep it current
An out-of-date index is worse than none, because agents trust it. stockroom guards against that in three ways:
Every tool call compares the shelves with the fingerprint the index recorded. If anything changed, the tool refuses to answer and names the files that changed.
A rebuild writes a new file next to the old one and renames it into place, so a reader never sees a half-built index. A running MCP server notices the new file and switches to it.
read_sourcereturns a sha256 for the file it read. Keep it with any edit you propose, and runstockroom verifybefore applying the edit.
Tie stockroom build to the one path every change already takes, like a Git hook, a CI step, or stockroom watch on the machine your agents run on.
Benchmark
npm install && npm run bench runs eight tasks against the Crumb & Co. sample twice: once with plain ls, grep, and cat, and once through stockroom. It counts tokens with the o200k_base encoding and checks that each world actually found the evidence the task needed. The sample is small, so the timing difference is too small to matter there. The token difference is the part that carries over to bigger projects.
How it works
src/walk.js walks the shelves. src/extract.js pulls names, references, sections, and summaries out of HTML, SVG, CSS, JavaScript, Markdown, and JSON with regular expressions (accurate enough for "where is this defined?" without a parser per language). src/build.js writes them into the tables in src/schema.sql, including a trigram full-text index. src/counter.js answers the questions, and src/mcp.js serves them over MCP.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for StyleKit styles, tokens, recipes, lint and repair over stdio or HTTP.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
MCP server for querying Forkast documentation
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server for querying multi-repo engineering documentation artifacts from a SQLite corpus.5 npmAGPL 3.0
- AlicenseBqualityCmaintenanceA lightweight MCP server that enables querying a project's corpus (docs, decisions, issues, skills) with cited answers and typed refusals via stdio JSON-RPC 2.0.9MIT
- AlicenseNot gradedqualityBmaintenanceServes a repository's code knowledge graph over stdio (MCP) so coding agents can look up symbols, trace callers and callees, compute blast radius, list file symbols, run hybrid lexical-plus-graph search, and get citation-grounded answers from file:line evidence instead of guessing from text chunks. All tools work offline straight from the graph, with prose synthesis only when an OpenAI-compatible LLM endpoint is configured.17MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients such as Claude Desktop and Claude Code to query an indexed source repository through path-guarded tools for hybrid keyword-and-vector code search, file snippets, symbol explanations, reference lookups, and test-skeleton suggestions. Serves those results over stdio with cited file:line locations so agents can answer questions about a codebase and drive grounded code review.MIT