CodeNib MCP Server
Provides coding agents with searchable codebase context through an MCP server, enabling hybrid BM25 and semantic search, symbol graph navigation, and dependency mapping over an incrementally maintained repository index.
README
<!-- SPDX-FileCopyrightText: 2025-2026 CodeNib Contributors
SPDX-License-Identifier: Apache-2.0 --> <!-- mcp-name: ai.codenib/codenib -->
<div align="center"> <img src="https://raw.githubusercontent.com/sysevol-ai/CodeNib/main/assets/codenib_logo.svg" alt="CodeNib" width="560"> <h1>Searchable codebase wikis and context for coding agents</h1> <p> Point it at any repo, get a searchable Wiki and an MCP server for your coding agent. </p> <p> <a href="https://arxiv.org/abs/2607.25431"><img src="https://img.shields.io/badge/arXiv-2607.25431-b31b1b.svg?logo=arxiv&logoColor=white" alt="arXiv 2607.25431"></a> <a href="https://huggingface.co/papers/2607.25431"><img src="https://img.shields.io/badge/Hugging_Face-%232_Paper_of_the_Day-FFD21E.svg?logo=huggingface&logoColor=black" alt="Hugging Face: #2 Paper of the Day"></a> </p> <p> <a href="#quickstart">Quickstart</a> · <a href="https://codenib.ai">Website</a> · <a href="https://discord.gg/ySer6CGn4">Discord</a> · <a href="https://docs.codenib.ai/">Documentation</a> · <a href="https://docs.codenib.ai/mcp/">MCP</a> · <a href="https://docs.codenib.ai/agent_integrations/">Agent Integrations</a> · <a href="https://docs.codenib.ai/language_capabilities/">Languages</a> </p> <p> <a href="https://github.com/sysevol-ai/CodeNib/actions/workflows/ci.yml"><img src="https://github.com/sysevol-ai/CodeNib/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="https://pypi.org/project/codenib/"><img src="https://img.shields.io/pypi/v/codenib.svg" alt="PyPI version"></a> <a href="https://github.com/sysevol-ai/CodeNib/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License: Apache 2.0"></a> <a href="https://github.com/sysevol-ai/CodeNib/blob/main/pyproject.toml"><img src="https://img.shields.io/badge/Python-3.10%2B-3776AB.svg" alt="Python 3.10+"></a> <img src="https://img.shields.io/badge/Release-0.2.0-2563EB.svg" alt="CodeNib 0.2.0"> </p> </div>
python -m pip install "codenib[mcp,semantic]==0.2.0"
codenib wiki /path/to/your/repo
Local, open source, and no cloud required. CodeNib combines BM25 and dense code search, adds optional SCIP symbol graphs, and incrementally rebuilds repository indexes as commits change. The same index powers the Wiki, Dependency Map, Ask, and MCP tools instead of making every agent rediscover the codebase.
News
- 2026-08-05 — CodeNib 0.2.0. Build a static Wiki and reusable context artifact once, then serve it through Pages or the official MCP package. Hybrid retrieval and managed SCIP/LSP providers ship in the same CLI. Release notes
- 2026-08-05 — SweRank recipe. Run SweRank retrieval and reranking over a local checkout. Example
- 2026-08-04 — Native repository explorer. CodeNib's planner now targets the SWE-Explore source-region protocol. Validation
- 2026-08-03 — Native LocAgent policy. LocAgent runs directly on CodeNib views without LocAgent, LiteLLM, or LlamaIndex dependencies. Support matrix
- 2026-08-02 — OrcaLoca SearchAgent. OrcaLoca's six-tool search loop now reuses CodeNib's symbol graph. Support matrix
System Architecture
| Layer | Responsibility |
|---|---|
| Incremental compiler | Chunk source and materialize BM25, dense, graph, and navigation views; reuse or repair supported artifacts and rebuild when an update cannot be admitted |
| View manifest | Record repository identity, source fingerprint, builder profile, capabilities, status, and artifact location independently for each view |
| Context serving | Execute lexical, semantic, hybrid, reranked, and structural query plans while preserving repository-relative source locations |
| Agent runtime | Expose capability-aware MCP and LSP-shaped tools, assemble bounded evidence, and return citations that agents and humans can inspect |
repository change
-> materialize or repair affected views
-> publish a capability-bearing manifest
-> plan repository queries
-> deliver bounded, source-linked context
On a later commit, CodeNib can reuse unchanged vector content and patch supported graph transitions at file or symbol granularity. Unsupported, inconsistent, or unverified transitions fall back to a fresh build instead of publishing a partially updated view.
Quickstart
Requires Python 3.10+ and Git. The recommended local path includes the pinned CodeRankEmbed model and serves hybrid BM25+dense retrieval:
python -m pip install "codenib[semantic]==0.2.0"
codenib doctor --require core --require wiki
codenib wiki /path/to/repository
codenib wiki selects the semantic route because the installed environment
contains its dependencies. A smaller python -m pip install codenib==0.2.0
installation selects the deterministic BM25 fallback and downloads no model.
The 0.2 release notes record the
upgrade boundary and verification evidence.
CodeNib detects the repository languages, builds a reusable index under
~/.codenib/repositories, launches the local Wiki, and opens
http://localhost:3000. The wheel includes the
production Wiki frontend, so normal use does not require Node.js or npm and
the target repository stays untouched. This command exercises the same compiler
and serving runtime used by agents. Set CODENIB_HOME to relocate state.
Check the environment or index without opening the Wiki:
codenib doctor --require core --require wiki
codenib index /path/to/repository
For a structural view, CodeNib detects the repository languages and manages only their package-level providers; operating-system and project prerequisites remain explicit:
python -m pip install "codenib[graph]==0.2.0"
codenib toolchain install /path/to/repository --scope graph
codenib doctor /path/to/repository --require graph
Export that indexed commit as a serverless Wiki when a live Ask backend is not needed:
codenib export /path/to/repository --output /tmp/repository-wiki
The export contains a versioned provenance manifest, precomputed Wiki pages, source citations, and available page-level dependency data. It contains no provider credential; interactive Ask and runtime graph exploration remain on the local or MCP serving path.
For a repository-hosted Wiki, CodeNib also ships a reusable GitHub workflow
that incrementally builds the same manifest, deploys the static site to Pages,
and uploads the matching commit-addressed context artifact. Its default
semantic route builds BM25 and vector views with a cached local Hugging Face
model and needs no API key. An explicit fast route avoids the model download;
a BYO OpenAI-compatible endpoint can replace local embedding. Query-time search
remains in the local or MCP runtime. See
GitHub Pages.
The published BM25/vector artifact can then be verified against an exact local
checkout and served through MCP without rebuilding the repository views.
See the Quickstart for ports, advanced indexing, and troubleshooting.
<p align="center"> <img src="https://raw.githubusercontent.com/sysevol-ai/CodeNib/main/assets/codenib_wiki.png" alt="CodeNib Wiki showing the source-linked reverse proxy guide for Caddy" width="100%"> </p>
Serve An Agent
Install the MCP extra, build once, and serve the same repository manifest over stdio:
python -m pip install "codenib[mcp,semantic]==0.2.0"
codenib index /path/to/repository
codenib mcp /path/to/repository
The MCP server advertises search_context as its default ranked entry point,
then exposes the underlying BM25, vector, graph, and navigation operations for
explicit control. It uses the compiled manifest to decide which calls have a
fresh backing view. An agent can therefore reuse
available repository work instead of rebuilding context through unbounded
grep and read loops, while unavailable searches fail explicitly. BM25,
semantic, regex, Zoekt, dependency, and static-navigation results retain source
locations for follow-up reads and citations. See
MCP Server
for client configuration and tool contracts.
The same planner is available directly to Python agents:
from codenib.agent import RepositoryContextExplorer
with RepositoryContextExplorer.from_repository(
"/path/to/repository", policy="auto"
) as explorer:
result = explorer.explore("where is request retry behavior implemented?", top_k=10)
Each result includes source-validated evidence plus the selected plan, capabilities, loaded views, fusion, graph, and reranking trace.
What CodeNib Provides
| Surface | Purpose |
|---|---|
| Incremental compiler | Build independently managed views, reuse unchanged content, repair supported transitions, and conservatively rebuild outside those boundaries |
| Agent context runtime | Plan capability-aware retrieval and navigation, then assemble bounded source-linked evidence |
| Retrieval | BM25, dense-vector, regex/trigram, Zoekt, fusion, and reranking paths; see the validated model matrix |
| Structural context | SCIP/LSP-backed symbol graphs with source locations and typed edges |
| MCP and LSP-shaped tools | Serve one manifest to coding agents without tying the runtime to one agent framework |
| Agent compatibility | Reuse one manifest across revision-pinned LocAgent, Agentless, CoSIL, and OrcaLoca contracts; see the support matrix |
| Benchmark compatibility | Evaluate native exploration against pinned external datasets and scorers, including SWE-Explore; see the dataset and benchmark matrix |
| Local inspection | Audit the same context through Wiki pages, Ask answers, citations, and the Dependency Map |
| Evaluation harness | Measure retrieval, navigation, incremental maintenance, and context policies on the same artifacts |
Language support varies by surface. The generated capability matrix records chunking, graph, incremental, and C++ decoder support.
Documentation
- Quickstart
- GitHub Pages
- MCP Server
- Agent Integrations
- RAG Models and Planner
- Benchmarks and Evaluation
- Web UI
- Language Capabilities
- Concepts and development guides
Build the documentation site locally with:
python -m pip install -e ".[dev]"
mkdocs serve
Development
git clone https://github.com/sysevol-ai/CodeNib.git
cd CodeNib
make dev
make test
The test suite is split into unit, integration, serial integration, core, graph-consumer, and slow tiers. See CI/CD before running the credential- or toolchain-dependent tiers.
Status
CodeNib 0.1.0 is a developer preview. The CLI and manifest format are usable,
but public interfaces may still change before a stable release. Historical
research artifacts retain their published dataset identifiers; the maintained
package, import namespace, commands, and repository use CodeNib. See
Naming.
Citation
If you use CodeNib in your research, please cite our arXiv paper:
@misc{yu2026codenibmultiviewdataserving,
title={CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agents},
author={Zhongming Yu and Hengjia Yu and Boqin Yuan and Shuting Zhao and Yizhao Chen and Aryan Dokania and Mihir Jagtap and Jiayu Chang and Yitong Ma and Yash Jayswal and Wentao Ni and Hejia Zhang and Zhaoling Chen and Gangda Deng and Jishen Zhao},
year={2026},
eprint={2607.25431},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2607.25431},
}
Project
Website · Changelog · Contributing
License
CodeNib is licensed under the Apache License, Version 2.0.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。