{"slug": "pipe-docs-mcp-your-entire-codebase-as-a-semantic-search-inside-your-ai-ide", "title": "🔍 pipe-docs MCP — Your Entire Codebase as a Semantic Search, Inside Your AI IDE", "summary": "Pipe Language released pipe-docs, a semantic search and RAG MCP server that turns documentation and Go/Pipe source code into a searchable index for AI IDEs, offering seven tools with zero dependencies and published on the MCP Registry. The server uses heading-aware chunking and hybrid search to provide cited answers, indexing 28 files into 317 chunks for the English docs, and supports code symbol lookup across Go and Pipe files.", "body_md": "[← All posts← Alle Beiträge](../blog.html)\n\n# 🔍 pipe-docs MCP — Your Entire Codebase as a Semantic Search, Inside Your AI IDE\n\n**A semantic search and RAG MCP server for the Pipe language — 7 tools, zero dependencies, published on the MCP Registry. Point your AI at your docs, your source code, or both, and get cited answers in seconds.**\n\n> **Related:** [docs-pipe dashboard](docs-pipe-dashboard.html) · [RAG in ~10 lines](tutorial-local-rag.html) · [Your first MCP server](tutorial-first-mcp-server.html)\n\nMost AI coding assistants can read files — but they read them *blindly*. They don't know that `docs/en/17-compiler.md`\n\nexplains the register allocator, or that `pkg/compiler/compiler.go:738`\n\ncontains the `lastInstructionIsTerminator`\n\nfunction. They don't know which chunk of documentation answers a question about sandbox profiles, and they certainly can't trace a claim back to a specific heading in a specific file.\n\n`pipe-docs`\n\nfixes that. It's a Pipe-native MCP server that turns your entire documentation tree *and* your Go/Pipe source code into a semantic search engine that any MCP-aware AI can query — with cited answers, code symbol lookup, and heading-aware chunking. No vector database, no embedding SDK, no framework. One binary, seven tools.\n\n## Seven tools, one server\n\n```\nimport \"docs-pipe\"\n\n-- 1. index your docs\nidx: doc_index \"docs/en\" {lang: \"en\", db: \"docs-en.db\"}\n\n-- 2. search by meaning\nresults: doc_search idx \"How does the bytecode VM work?\" 5\n\n-- 3. ask with cited sources\nres: doc_ask idx \"What is MCP?\" 4\nprint (get res \"answer\")     -- answers with [1], [2], [3] citations\nprint (get res \"sources\")    -- [{path, line_start, heading}, ...]\n```\n\nThat's the core API — six functions: `doc_index`\n\n, `doc_search`\n\n, `doc_ask`\n\n, `doc_index_status`\n\n, `doc_reindex`\n\n, `doc_close`\n\n. The MCP server wraps them into seven tools:\n\n| Tool | What it does |\n|---|---|\n`search_docs` | Semantic + keyword hybrid search across EN, DE, and blog docs |\n`ask_docs` | RAG answer with cited sources — the AI gets context, you get traceability |\n`search_code` | Find Go/Pipe functions, types, structs by name or keyword |\n`read_doc` | Read a specific documentation file by path |\n`list_docs` | List all files in EN, DE, and blog directories |\n`index_status` | Report stats: files, chunks, symbols, has_ai flag |\n`refresh` | Re-fetch the source repo and rebuild the index |\n\nThe server runs as a single Pipe process over stdio — the same transport Claude Desktop, Cursor, opencode, and every other MCP client already speaks.\n\n## How it works: heading-aware chunking, hybrid search\n\nA naive approach embeds every paragraph and calls `nearest`\n\n. That misses context. `pipe-docs`\n\ndoes three things differently:\n\n**Heading-aware chunking.** Documents are split on `#`\n\n/`##`\n\n/`###`\n\nboundaries, fenced code blocks stay intact, and every chunk remembers its file, line range, and heading path — so a search for \"sandbox profiles\" surfaces the `Security > Sandbox Profiles > Locking`\n\nsection, not just a passing mention. Indexing `docs/en`\n\nyields **28 files → 317 chunks**.\n\n**Hybrid search.** A TF-IDF keyword score and a cosine-similarity score are fused — and the weights adapt automatically: local 128-dim embeddings lean on keywords, OpenAI's 1536-dim embeddings lean on semantics. Identifiers stay single tokens (`try_ai`\n\n, not `try`\n\n+ `ai`\n\n), and a query term matching a chunk's *heading* gets a boost.\n\n**Cited answers.** `doc_ask`\n\ndoesn't just answer — it cites. Every answer comes with a `sources`\n\narray: `path:line — heading`\n\n, so you can always trace a claim back to the exact doc section. The AI gets context, you get accountability.\n\n## The code index: Go and Pipe, together\n\nBeyond documentation, `pipe-docs`\n\nscans your Go and Pipe source code and builds a searchable symbol index. Functions, types, structs, enums, tests — all indexed with file, kind, symbol name, and line number.\n\n```\nsearch_code \"sandbox\" →\n  pkg/compiler/compiler.go:738  func  lastInstructionIsTerminator\n  pkg/object/builtins_process.go:1  func  proc_start\n  pkg/sandbox/sandbox.go:42   struct  Sandbox\n```\n\nThis means when you ask an AI \"where is the sandbox gate for proc_start?\", it doesn't just guess — it finds the exact file and line, reads the surrounding code, and answers with context.\n\n## Publishing to the MCP Registry\n\n`pipe-docs`\n\nis published on the [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.MachuraHarry/pipe-docs`\n\n. One command installs it:\n\n```\n# opencode (mcp.json)\n{\n  \"pipe-docs\": {\n    \"type\": \"local\",\n    \"command\": [\"pipe\", \"examples/pipe_docs_server.pipe\"],\n    \"environment\": { \"DEEPSEEK_API_KEY\": \"sk-...\" }\n  }\n}\n```\n\nThe MCPB bundle ships five platform variants (linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64), each ~3 MB, containing the pipe binary and the server script. No runtime, no npm, no pip — just one process.\n\nThe server is built in pure Pipe: ~500 lines of server logic, ~900 lines of the `docs-pipe`\n\nmodule, and the MCP protocol handling is three builtins: `ai_tool`\n\n, `mcp_server`\n\n, `mcp_serve_stdio`\n\n. That's the entire dependency tree.\n\n## First startup: build once, cache forever\n\nThe first time the server starts, it clones the source repo and builds the docs index. This takes ~70 seconds and produces three SQLite databases (`docs-en.db`\n\n, `docs-de.db`\n\n, `docs-blog.db`\n\n). On subsequent starts, it loads from cache in ~5 seconds. The AI provider is configured lazily — `search_code`\n\n, `search_docs`\n\n, `read_doc`\n\n, and `list_docs`\n\nwork without an API key. Only `ask_docs`\n\nneeds one, and a full answer costs a fraction of a cent.\n\n```\nindex_status →\n  ready: true\n  has_ai: true\n  source_files: 173\n  code_symbols: 2731\n  docs_en: {files: 28, chunks: 317}\n  docs_de: {files: 28, chunks: 267}\n  docs_blog: {files: 15, chunks: 198}\n```\n\n## What this means for Pipe users\n\nIf you're building with Pipe, your AI assistant can now *understand* your codebase — not just read files, but reason about them. Ask \"how do sandbox profiles work?\" and get a cited answer pointing to the exact section in the docs. Ask \"where is the register allocator?\" and get the file, line, and function name. Ask \"what changed in the compiler?\" and get the diff context.\n\nIt's the same Pipe binary serving the MCP server that you use to write your pipelines. That's the whole point: when the language *is* the runtime, the server is just another script.\n\n# 🔍 pipe-docs MCP — Deine gesamte Codebase als semantische Suche, direkt in deiner KI-IDE\n\n**Ein semantischer Suche- und RAG-MCP-Server für die Pipe-Sprache — 7 Tools, null Abhängigkeiten, veröffentlicht auf dem MCP Registry. Richte deine KI auf deine Doku, deinen Quellcode oder beides und erhalte in Sekunden zitierte Antworten.**\n\n> **Verwandt:** [docs-pipe Dashboard](docs-pipe-dashboard.html) · [RAG in ~10 Zeilen](tutorial-local-rag.html) · [Dein erster MCP-Server](tutorial-first-mcp-server.html)\n\nDie meisten KI-Coding-Assistenten können Dateien lesen — aber sie lesen sie *blind*. Sie wissen nicht, dass `docs/en/17-compiler.md`\n\nden Register-Allocator erklärt, oder dass `pkg/compiler/compiler.go:738`\n\ndie Funktion `lastInstructionIsTerminator`\n\nenthält. Sie wissen nicht, welcher Dokumentations-Chunk eine Frage über Sandbox-Profile beantwortet, und können eine Aussage sicherlich nicht auf eine bestimmte Überschrift in einer bestimmten Datei zurückführen.\n\n`pipe-docs`\n\nlöst das. Es ist ein Pipe-nativer MCP-Server, der deinen gesamten Dokumentationsbaum *und* deinen Go/Pipe-Quellcode in eine semantische Suchmaschine verwandelt, die jeder MCP-fähige AI abfragen kann — mit zitierten Antworten, Code-Symbol-Lookup und Heading-bewusstem Chunking. Keine Vektor-DB, kein Embedding-SDK, kein Framework. Eine Binary, sieben Tools.\n\n## Sieben Tools, ein Server\n\n```\nimport \"docs-pipe\"\n\n-- 1. Doku indexieren\nidx: doc_index \"docs/en\" {lang: \"en\", db: \"docs-en.db\"}\n\n-- 2. nach Bedeutung suchen\nresults: doc_search idx \"Wie funktioniert die Bytecode-VM?\" 5\n\n-- 3. mit Quellenangaben antworten\nres: doc_ask idx \"Was ist MCP?\" 4\nprint (get res \"answer\")     -- Antworten mit [1], [2], [3] Zitaten\nprint (get res \"sources\")    -- [{path, line_start, heading}, ...]\n```\n\nDas ist die Kern-API — sechs Funktionen: `doc_index`\n\n, `doc_search`\n\n, `doc_ask`\n\n, `doc_index_status`\n\n, `doc_reindex`\n\n, `doc_close`\n\n. Der MCP-Server wickelt sie in sieben Tools:\n\n| Tool | Was es macht |\n|---|---|\n`search_docs` | Semantische + Keyword-Hybrid-Suche über EN-, DE- und Blog-Doku |\n`ask_docs` | RAG-Antwort mit Quellenangaben — die KI bekommt Kontext, du Nachvollziehbarkeit |\n`search_code` | Finde Go/Pipe-Funktionen, Typen, Structs nach Name oder Keyword |\n`read_doc` | Lies eine bestimmte Dokumentationsdatei nach Pfad |\n`list_docs` | Liste aller Dateien in EN-, DE- und Blog-Verzeichnissen |\n`index_status` | Statistiken: Dateien, Chunks, Symbole, has_ai-Flag |\n`refresh` | Quellrepo neu laden und Index neu aufbauen |\n\nDer Server läuft als einzelner Pipe-Prozess über stdio — dasselbe Transport-Protokoll, das Claude Desktop, Cursor, opencode und jeder andere MCP-Client bereits spricht.\n\n## So funktioniert's: Heading-bewusstes Chunking, Hybrid-Suche\n\nEin naiver Ansatz bettet jeden Absatz ein und ruft `nearest`\n\n. Das verliert Kontext. `pipe-docs`\n\nmacht drei Dinge anders:\n\n**Heading-bewusstes Chunking.** Dokumente werden an `#`\n\n/`##`\n\n/`###`\n\n-Grenzen geteilt, Code-Blöcke bleiben intakt, und jeder Chunk merkt sich seine Datei, seinen Zeilenbereich und seinen Heading-Pfad — also findet eine Suche nach \"Sandbox-Profile\" den Abschnitt `Security > Sandbox Profiles > Locking`\n\n, nicht nur eine beiläufige Erwähnung. Das Indexieren von `docs/en`\n\nergibt **28 Dateien → 317 Chunks**.\n\n**Hybrid-Suche.** Ein TF-IDF-Keyword-Score und ein Kosinus-Ähnlichkeits-Score werden fusioniert — und die Gewichte passen sich automatisch an: lokale 128-dim-Embeddings stützen sich auf Keywords, OpenAIs 1536-dim-Embeddings stützen sich auf Semantik. Bezeichner bleiben einzelne Tokens (`try_ai`\n\n, nicht `try`\n\n+ `ai`\n\n), und ein Suchbegriff, der auf die *Überschrift* eines Chunks trifft, bekommt einen Boost.\n\n**Zitierte Antworten.** `doc_ask`\n\nantwortet nicht nur — es zitiert. Jede Antwort kommt mit einem `sources`\n\n-Array: `path:line — heading`\n\n, damit du eine Aussage immer bis zur exakten Dokumentations-Section zurückverfolgen kannst. Die KI bekommt Kontext, du bekommst Verantwortlichkeit.\n\n## Der Code-Index: Go und Pipe zusammen\n\nNeben der Dokumentation scannt `pipe-docs`\n\ndeinen Go- und Pipe-Quellcode und baut einen durchsuchbaren Symbol-Index auf. Funktionen, Typen, Structs, Enums, Tests — alles indexiert mit Datei, Art, Symbolname und Zeilennummer.\n\n```\nsearch_code \"sandbox\" →\n  pkg/compiler/compiler.go:738  func  lastInstructionIsTerminator\n  pkg/object/builtins_process.go:1  func  proc_start\n  pkg/sandbox/sandbox.go:42   struct  Sandbox\n```\n\nDas bedeutet: Wenn du eine KI fragst \"wo ist der Sandbox-Gate für proc_start?\", errät sie nicht — sie findet die exakte Datei und Zeile, liest den umgebenden Code und antwortet mit Kontext.\n\n## Veröffentlichung im MCP Registry\n\n`pipe-docs`\n\nist im [MCP Registry](https://registry.modelcontextprotocol.io) als `io.github.MachuraHarry/pipe-docs`\n\nveröffentlicht. Ein Befehl installiert es:\n\n```\n# opencode (mcp.json)\n{\n  \"pipe-docs\": {\n    \"type\": \"local\",\n    \"command\": [\"pipe\", \"examples/pipe_docs_server.pipe\"],\n    \"environment\": { \"DEEPSEEK_API_KEY\": \"sk-...\" }\n  }\n}\n```\n\nDas MCPB-Bundle liefert fünf Plattform-Varianten (linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64), jede ~3 MB, bestehend aus der Pipe-Binary und dem Server-Script. Kein Runtime, kein npm, kein pip — nur ein Prozess.\n\nDer Server ist in reinem Pipe gebaut: ~500 Zeilen Server-Logik, ~900 Zeilen des `docs-pipe`\n\n-Moduls, und das MCP-Protokoll-Handling sind drei Builtins: `ai_tool`\n\n, `mcp_server`\n\n, `mcp_serve_stdio`\n\n. Das ist der gesamte Abhängigkeitsbaum.\n\n## Erster Start: einmal bauen, für immer cachen\n\nBeim ersten Start des Servers wird das Quellrepo geklont und der Docs-Index aufgebaut. Das dauert ~70 Sekunden und erzeugt drei SQLite-Datenbanken (`docs-en.db`\n\n, `docs-de.db`\n\n, `docs-blog.db`\n\n). Bei folgenden Starts lädt er aus dem Cache in ~5 Sekunden. Der AI-Provider wird lazy konfiguriert — `search_code`\n\n, `search_docs`\n\n, `read_doc`\n\nund `list_docs`\n\nfunktionieren ohne API-Key. Nur `ask_docs`\n\nbraucht einen, und eine volle Antwort kostet einen Bruchteil eines Cents.\n\n```\nindex_status →\n  ready: true\n  has_ai: true\n  source_files: 173\n  code_symbols: 2731\n  docs_en: {files: 28, chunks: 317}\n  docs_de: {files: 28, chunks: 267}\n  docs_blog: {files: 15, chunks: 198}\n```\n\n## Was das für Pipe-Nutzer bedeutet\n\nWenn du mit Pipe baust, kann dein KI-Assistent jetzt deine Codebase *verstehen* — nicht nur Dateien lesen, sondern darüber nachdenken. Frage \"wie funktionieren Sandbox-Profile?\" und erhalte eine zitierte Antwort, die auf die exakte Section in der Doku zeigt. Frage \"wo ist der Register-Allocator?\" und erhalte Datei, Zeile und Funktionsname. Frage \"was hat sich im Compiler geändert?\" und erhalte den Diff-Kontext.\n\nEs ist dieselbe Pipe-Binary, die den MCP-Server bedient, mit der du deine Pipelines schreibst. Das ist der ganze Punkt: Wenn die Sprache *die* Runtime ist, ist der Server nur ein weiteres Script.", "url": "https://wpnews.pro/news/pipe-docs-mcp-your-entire-codebase-as-a-semantic-search-inside-your-ai-ide", "canonical_source": "https://pipe-lang.com/blog/pipe-docs-mcp.html", "published_at": "2026-08-21 00:00:00+00:00", "updated_at": "2026-08-21 07:43:12.110480+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "natural-language-processing"], "entities": ["Pipe Language", "pipe-docs", "MCP Registry", "Claude Desktop", "Cursor", "opencode"], "alternates": {"html": "https://wpnews.pro/news/pipe-docs-mcp-your-entire-codebase-as-a-semantic-search-inside-your-ai-ide", "markdown": "https://wpnews.pro/news/pipe-docs-mcp-your-entire-codebase-as-a-semantic-search-inside-your-ai-ide.md", "text": "https://wpnews.pro/news/pipe-docs-mcp-your-entire-codebase-as-a-semantic-search-inside-your-ai-ide.txt", "jsonld": "https://wpnews.pro/news/pipe-docs-mcp-your-entire-codebase-as-a-semantic-search-inside-your-ai-ide.jsonld"}}