Persistent, evidence-backed project knowledge and task context for coding agents.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
KnowledgeRail is a local-first MCP server that turns project documentation and source code into durable, evidence-backed context for AI agents.
It is designed for agents that need to understand, change, review, or document a codebase without loading the whole repository into the model context. Retrieval is bounded, provenance is preserved, missing evidence is reported explicitly, and difficult queries widen progressively instead of silently losing relevant information.
Current status: stable release
2.6.2. The server uses MCP SDK2.xand protocol2026-07-28. It supports explicitly bound or safely inferred localstdio, a self-hosted loopback HTTP gateway, and a local desktop-chat adapter. KnowledgeRail operates no hosted service and does not upload project data. See SELF_HOSTING.md.
GAP/unknown reporting..llm-wiki metadata.KnowledgeRail does not call an LLM itself. The connected MCP client chooses and calls the tools. OCR and embeddings are optional external providers configured by the user.
Code evidence is extracted locally without tree-sitter, native binaries, downloaded grammars, or runtime parser dependencies. Each file is owned by exactly one versioned adapter, so upgrading one language reparses only that language's files. Unsupported or deliberately skipped constructs remain visible through recorded raw-fallback demand rather than being assigned an unreliable anchor.
| Adapter | Files | Indexed constructs |
|---|---|---|
| TypeScript / JavaScript / LWC | .ts, .tsx, .mts, .cts, .js, .jsx, .mjs, .cjs, .js-meta.xml | Classes, functions, methods, tests, routes, imports, calls, LWC decorators and component targets. |
| Java | .java | Classes, interfaces, enums, records, methods, Javadoc, JUnit markers, Spring routes, imports. |
| Kotlin | .kt, .kts | Classes, objects and companions, top-level/member/extension functions, properties, KDoc, JUnit/Kotest markers, Spring and literal Ktor routes. |
| Apex | .cls, .trigger | Classes, methods, tests, REST resources, trigger events, and static SOQL/SOSL object references. |
| Salesforce metadata | .object-meta.xml, .field-meta.xml, .validationRule-meta.xml, .flow-meta.xml, .permissionset-meta.xml | SFDX objects, fields, validation rules, flows, permission sets, formulas, calls, and Apex-compatible database references. |
| C# | .cs | Namespaces, types, methods, properties, XML docs, test attributes, ASP.NET controller and minimal-API routes; nested quoted strings inside interpolations are masked without losing following code. |
| Go | .go | Functions, receiver methods, structs/interfaces, Go doc comments, tests, imports, and common router calls. |
| Rust | .rs | Functions, types, traits, modules, impl methods, tests, imports, and macro_rules! names. |
| PHP | .php | Namespaces, types, functions/methods, PHPUnit markers, Laravel/Symfony routes, configuration and database references; HTML outside PHP tags is inert. |
| C | .c | Function definitions including pointer-return forms, doc comments, and includes. |
| C++ | .cpp, .cc, .cxx, .h, .hpp, .hh | Functions, constructors, classes/structs, namespaces, qualified methods, doc comments, and includes. |
| Python | .py, .pyi | Indentation-aware modules, classes, nested functions/methods, docstrings, decorators, tests, FastAPI/Flask/Django routes, imports, calls, configuration and database references. |
| Ruby | .rb, .rake | Keyword-delimited classes/modules/methods, RDoc comments, RSpec/Minitest markers, Rails/Sinatra routes, imports, configuration and explicit database references. |
The extractors are intentionally conservative. LWC HTML templates, Java anonymous classes, dynamic Apex query object names, Rust macro expansion, PHP eval()/string callables and Blade/Twig templates, K&R C definitions, macro-generated C/C++ declarations, complex C++ operator/template metaprogramming, Python lambdas/dynamic definitions/metaclass-generated members, indirect or qualified decorator-generated routes, calls inside f-string interpolations, and notebooks are not guessed. Kotlin computed Ktor paths and string-named Kotest cases are not emitted independently. Salesforce metadata is limited to the explicit SFDX suffix roster; malformed XML falls back to a file module. Ruby metaprogramming, inferred ActiveRecord tables, individual RSpec it blocks, operator methods, and ambiguous plain command-form heredocs or regex literals remain best-effort or out of scope. Headers use the C++ superset adapter. Python uses a separate indentation engine with CPython-compatible tab stops; Ruby uses its own keyword-block engine. Qualified knowledge_code action="symbol" lookups treat ., #, ::, PHP namespace backslashes, and -> as equivalent separators, while returned names retain the language-native form. The pinned golden corpus contains 52 source files, 1,429 source lines, and 199 hand-labeled symbols across twelve language adapters; the mixed-repository benchmark adds two LWC files for 54 files and 1,446 lines overall. Its perfect in-corpus score is a deterministic regression guarantee, not a claim of universal parser accuracy. Code anchors are line-based: trailing-whitespace edits remain fresh, while formatting that inserts or removes lines is deliberately reported as drift because it shifts the cited range. knowledge_admin action="status" reports the extension histogram supplied with recorded grep fallbacks, allowing later language priorities to follow real repository demand.
22.12.0 or newerKnowledgeRail ships no browser or document renderer. Mermaid source remains ordinary Markdown and is rendered only by viewers that support it.
Run this from any directory inside the project in a terminal or another client that launches stdio servers with the project as its working directory:
No project path is needed when the MCP client guarantees a project-scoped process cwd or supplies one unambiguous legacy MCP Root. Cursor project setup is explicit because its global MCP process may be shared across windows.
The reviewed package is published to npm. Pin an exact version in persistent configurations; reserve @latest for one-time trials.
Start it from any directory inside the project whose knowledge you want to manage:
Run this once from the project root or any nested directory:
The command discovers the project upward and safely creates or merges .cursor/mcp.json. It preserves other MCP servers and pins an explicit ${workspaceFolder} binding. Re-running it is idempotent.
The equivalent manual project configuration is:
Keep this file at <project>/.cursor/mcp.json, not in the global ~/.cursor/mcp.json. Recent Cursor releases can reuse a global stdio MCP process whose cwd is the user home or an empty window, so global cwd-based project inference is not a supported bound-workspace configuration. Cursor documents type: "stdio", project configuration, and ${workspaceFolder} interpolation in its MCP guide.
For a source checkout, use the compiled entry point while retaining the explicit workspace root:
For a Cursor multi-root workspace, install one project configuration in every root that should expose KnowledgeRail. The server never selects the first open root silently.
From the project, add KnowledgeRail at project scope:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/knowledgerail)<a href="https://allmcps.com/mcp/knowledgerail"><img src="https://allmcps.com/api/badge/knowledgerail?style=directory" alt="KnowledgeRail on AllMCPs" /></a>