knowledge-base-mcp-server: Instructions file for Claude Code

CLAUDE.md

knowledge-base-mcp-server CLAUDE.md is an instructions file for Claude Code from jeanibarz/knowledge-base-mcp-server. It costs 1,564 tokens per session, scanned A, original, Unlicense.

Repository instructions for a local-first knowledge-base server and command-line tool. It uses searchable document indexes and can connect to several text-embedding providers.

In plain words
What is it for?
Building, testing, running, and changing the knowledge-base server or its command-line interface.
Why use it?
It gives an agent the commands, architecture, tools, and conventions needed to work on the repository correctly.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is jeanibarz/knowledge-base-mcp-server's own configuration. It tells Claude Code how to work on knowledge-base-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything knowledge-base-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jeanibarz/knowledge-base-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jeanibarz/knowledge-base-mcp-server/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/jeanibarz/knowledge-base-mcp-server

Made for: Claude Code.

Wrote 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.

agentmods badge for knowledge-base-mcp-server CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jeanibarz/knowledge-base-mcp-server/claude-md/github.svg)](https://agentmods.dev/instructions/jeanibarz/knowledge-base-mcp-server/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/jeanibarz/knowledge-base-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/jeanibarz/knowledge-base-mcp-server/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for knowledge-base-mcp-server CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/jeanibarz/knowledge-base-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/jeanibarz/knowledge-base-mcp-server/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,564 This file is loaded in full into every session.
When invoked 1,564 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01564 $0.01564
Opus 5.5 $0.00626 $0.00626
Sonnet 5.5 $0.00313 $0.00313
Haiku 4.5 $0.00156 $0.00156

Measured today against content hash 4ed4cd1ff8b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-base-mcp-server CLAUDE.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 today.

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.

CLAUDE.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

knowledge-base-mcp-server — Agent Instructions

Local-first knowledge-base MCP server and kb CLI backed by embedded FAISS indexes and pluggable embedding providers (HuggingFace, Ollama, or OpenAI).

Working on this repo

Build / test / run

npm install
npm run build          # tsc → build/index.js (chmod +x, stdio-executable)
npm test               # build + test:parallel (--maxWorkers=4) + test:serial (--runInBand) — must stay green
npm run dev            # node --watch --import tsx src/index.ts for iteration
node build/index.js    # runs the server over stdio (clients launch it this way)

Key architecture

  • Transport: src/KnowledgeBaseServer.ts starts stdio by default and can opt into SSE or streamable HTTP via MCP_TRANSPORT. HTTP/SSE mode requires MCP_AUTH_TOKEN and defaults to loopback.
  • MCP tool surface: tools are registered in KnowledgeBaseServer.registerTools(). Current tools include list_knowledge_bases, retrieve_knowledge, ask_knowledge, list_models, kb_stats, diff_index, find_related, list_facets, recommend_knowledge_base, export_citations, add_document, delete_document, and reindex_knowledge_base.
  • CLI surface: src/cli.ts is the kb dispatcher. Command-specific behavior lives in src/cli-*.ts; shared command-independent logic belongs in *-core.ts helpers.
  • Embeddings: FaissIndexManager is constructed for a concrete (provider, modelName) pair. Provider defaults come from EMBEDDING_PROVIDER plus provider-specific model env vars.
  • Index layout: $FAISS_INDEX_PATH/active.txt selects a model id. Each model stores metadata and versioned FAISS data under $FAISS_INDEX_PATH/models/<model_id>/. See model-storage-layout.ts (paths, sentinel) and model-resolution.ts (active-model resolution) — they decide and enforce this layout, so read them before changing any index path.
  • Indexing strategy: per-file SHA256 hashes and chunk manifests in <kb>/.index/ let a refresh skip content that has not changed, so re-indexing costs embedding calls only for what moved. To stop concurrent writers from corrupting an index, mutating refreshes take a per-model write lock and save new index versions atomically.
  • Logging: logger.ts writes only to stderr (and optionally LOG_FILE). Writing to stdout corrupts the JSON-RPC stream — this is a landed bug, never reintroduce console.log inside the server process.

Read the full file on GitHub · 68 lines

Changes

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.

  1. today Changed · +20 tokens per session 4ed4cd1ff8b6
  2. 11d ago Changed · +16 tokens per session 68de7b33fd28
  3. 14d ago Changed · +5 tokens per session bce7c883e6a8
  4. 2mo ago Changed · +43 tokens per session e08887c7f1f3
  5. 2mo ago First seen · 68 lines · 1,480 tokens per session scan A 0f2d523c9cfd

Subscribe to this mod's changes

knowledge-base-mcp-server CLAUDE.md is an instructions file published in the GitHub repository jeanibarz/knowledge-base-mcp-server (53 stars, last pushed yesterday), licensed Unlicense. It adds 1,564 tokens to every session, about $0.0063 per session on Opus 5.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-30.

Related

knowledge-base-mcp-server CLAUDE.md compared with instructions from other repositories

knowledge-base-mcp-server CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
knowledge-base-mcp-server CLAUDE.mdjeanibarz/knowledge-base-mcp-serverInstructions file53yesterdayUnlicenseA1,564Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode