Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/cmwen/min-kb-mcp/copilot-instructionsgit clone --depth 1 https://github.com/cmwen/min-kb-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/cmwen/min-kb-mcp/copilot-instructions)<a href="https://agentmods.dev/instructions/cmwen/min-kb-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/cmwen/min-kb-mcp/copilot-instructions.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00937 | $0.00937 |
| Opus 5 | $0.00468 | $0.00468 |
| Sonnet 5 | $0.00187 | $0.00187 |
| Haiku 4.5 | $0.00094 | $0.00094 |
Grade A, and why
min-kb-mcp copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Copilot instructions for this repo
Purpose: This is an LLM-first MCP server that manages a file-based knowledge base with a SQLite (WASM via sql.js) index. The CLI starts the server; MCP tools read/write Markdown files and keep the index in sync.
Key modules (read these first)
- src/cli.ts: Commander CLI entry. start --kb is required. Transport is stdio (default) or HTTP when MCP_TRANSPORT=http. CLI can accept --port; MCP_PORT overrides too.
- src/server.ts: MCPServer wiring (stdio or Streamable HTTP transport), Express-based /mcp endpoint for HTTP, tool and resource registration. Uses zod schemas for tool inputs. Maintains session via mcp-session-id header for HTTP.
- src/core/config.ts: Resolves KB paths with appdata-path. KB root: /min-kb-mcp/ with .sqlite and articles/; ensures directories exist.
- src/core/file-manager.ts: Creates/reads/updates/deletes Markdown files under articles/. IDs are uuid v4; filenames are .md. Throws FileOperationError.
- src/db/database.ts: sql.js (WASM) database. Tables: articles(id, filePath, title, keywords) and articles_content(id, content). Tries FTS5 (porter tokenizer, fallback variants) then falls back to LIKE search when FTS5 is unavailable. Throws DatabaseError.
Data flow & responsibilities
- create/update/delete: FileManager writes files; DatabaseService indexArticle/deindexArticle keeps tables+FTS in sync then persists DB to disk.
- search: Prefer FTS5 with bm25(...) ordering; fallback returns rank=0 and simple LIKE matches.
- resources: Articles exposed via article://{id}; resource handler reads the Markdown file from articles/.
Tool implementation pattern (follow this shape)
- Define input schema with zod and register via server.registerTool.
- Perform file op(s) via FileManager, then index via DatabaseService.
- Return MCP content: include a minimal text message and a resource entry like { type: 'resource', uri: 'article://', resource: { text, uri, mimeType: 'text/markdown' } }.
- On failure, return { content: [{ type: 'text', text: msg }], isError: true } (see createArticle/updateArticle/deleteArticle). Keep responses short.
HTTP transport specifics
- Express routes: POST /mcp handles requests; GET/DELETE /mcp handle session notifications/termination. Multiple sessions tracked by sessionId; client supplies mcp-session-id header.
- CORS is permissive for dev (origin: '*'). Lock down in production.
Developer workflows
- Install: pnpm i
- Lint/format: pnpm run lint, pnpm run format (Biome)
- Build: pnpm run build (tsc to dist/). Tests are excluded from build (see tsconfig exclude).
- Tests: pnpm test (Vitest; src/**/*.spec.ts). Example: src/db/database.spec.ts bootstraps the DB by indexing once to await async init.
- Run (stdio MCP): pnpm start -- --kb my-kb
- Run (HTTP dev): MCP_TRANSPORT=http MCP_PORT=9876 pnpm run dev, then connect MCP Inspector to http://localhost:9876/mcp
Conventions & gotchas
- TypeScript strict mode; Node ≥22. Errors use FileOperationError/DatabaseError. Avoid leaking low-level errors in tool responses; use isError with succinct text.
- IDs are UUIDs; filenames are .md; title is derived from first H1 if not provided (DatabaseService.extractTitle).
- sql.js FTS5 support may be absent in some WASM builds; code transparently falls back to LIKE. Ranking may be 0 and order less meaningful in fallback.
- Publishing targets GitHub Packages (publishConfig.registry). prepublishOnly runs build; CLI bin is dist/cli.js.
Add new features by mirroring existing patterns
- New tool: add zod schema, use FileManager/DatabaseService, return a resource when appropriate, and register in server.registerTools().
- New resource: extend registerResources() with a ResourceTemplate and read via FileManager.
Reference examples
- createArticle/searchArticles/updateArticle/deleteArticle in src/server.ts show the canonical tool structure and error handling.
- DatabaseService.indexArticle/search/listArticles in src/db/database.ts show schema, FTS/LIKE dual-path search, and persistence.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 48 lines · 937 tokens per session scan A 0ecc7debf796
min-kb-mcp copilot-instructions.md is an instructions file published in the GitHub repository cmwen/min-kb-mcp (3 stars, last pushed 28d ago), licensed MIT. It adds 937 tokens to every session, about $0.0047 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
aeon CLAUDE.md
Claude Code instructions for aeonfun/aeon, covering aeon, how aeon works, strategy, voice and soul file hierarchy (read in this order).
cognirepo CLAUDE.md
Claude Code instructions for ashlesh-t/cognirepo, covering claude.md, key rules, session start sequence (run in this order), behavioral confirmation rule and personas (cognirepo-402, cognirepo-403).
wayland-core copilot-instructions.md
Copilot instructions for FerroxLabs/wayland-core, covering ijfw rules, output discipline, memory routing, context discipline and cross-audit.
mcp-structured-memory CLAUDE.md
Claude Code instructions for nmeierpolys/mcp-structured-memory, a project described as: Structured Memory MCP Server.
inkwell-memory CLAUDE.md
Instructions for veronchenko/inkwell-memory, covering claude.md — inkwellmemory, layout, multi-tenant mode (inkwellmultitenant=1), conventions and testing.
RNR-Enhanced-Cognee AGENTS.md
AGENTS.md instructions for vincentspereira/RNR-Enhanced-Cognee, covering rnr enhanced cognee implementation for codex, critical requirements, 1. ascii-only output (no unicode encoding), 2. dynamic categories (no hardcoded categories) and 3. standard memory mcp interface.