kerchunk
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
kerchunk
kerchunk is an AST-aware semantic code search Model Context Protocol (MCP) server built for OpenCode.
It indexes your repository locally using Tree-sitter and DuckDB, watches for file changes in the background, and exposes fast hybrid code search and multi-hop architectural research tools to AI coding agents.
What It Does
AST-Aware Chunking: Uses
tree-sitterandtree-sitter-language-packto split source files along semantic syntax boundaries (functions, classes, methods, blocks) rather than arbitrary line counts.Supported languages: Python, JavaScript, TypeScript / TSX, Rust, Go, C, C++, Java, C#, and Bash.
Local Vector & Hybrid Search: Stores embeddings and chunk metadata in a per-repository DuckDB database (
.kerchunk/index.duckdb). Automatically adds.kerchunk/to.git/info/excludeso your repository stays clean.Live File Watching: Runs a background
watchdogobserver to incrementally re-index files as they are created, modified, or deleted, while respecting.gitignorerules and skipping common build/dependency directories.Optional Reranking: Supports an OpenAI-compatible reranker endpoint to re-score top hybrid search candidates for higher precision.
Multi-Hop Code Research: When a chat model is configured, enables iterative, multi-hop architectural research that decomposes complex questions into multiple searches and synthesizes answers with exact
file_path:start_line-end_linecitations.
MCP Tools Exposed
Tool | Description |
| Hybrid semantic + lexical AST-aware search over the repository, with optional |
| Deep multi-hop architectural research across the codebase (enabled when |
| Reports indexing progress, file/chunk counts, database path, and active model configuration. |
Related MCP server: semantic-code-intelligence
Prerequisites
Python 3.11+
An OpenAI-compatible embedding endpoint (e.g., Ollama, vLLM, llama.cpp, or a hosted API).
(Optional) An OpenAI-compatible reranker endpoint for improved search ranking.
(Optional) An OpenAI-compatible chat endpoint (e.g., Gemini, OpenAI, or a local LLM) to enable
code_research.
Build and Install
Clone the repository and install kerchunk into a Python virtual environment:
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -e .For a standard (non-editable) install:
pip install .This installs the kerchunk console script (./venv/bin/kerchunk), which runs the MCP server over stdio for the current working directory.
Configuration
kerchunk is configured via environment variables:
Variable | Default | Description |
|
| Fallback base URL for embed, rerank, and chat endpoints. |
|
| Fallback API key for all endpoints. |
|
| Embedding API base URL. |
|
| Embedding model name. |
|
| API key for the embedding endpoint. |
|
| Reranker API base URL. |
| (disabled) | Reranker model name. Leave unset to skip reranking. |
|
| API key for the reranker endpoint. |
|
| Chat API base URL for |
| (disabled) | Chat model name. Leave unset to disable |
|
| API key for the chat endpoint. |
|
| Set to |
|
| Maximum character size per AST chunk. |
|
| Minimum character size per AST chunk. |
Sample Files
This repository includes two sample files to help you integrate kerchunk with OpenCode:
sample_opencode_json.txt— A ready-to-adaptopencode.jsonconfiguration showing how to registerkerchunkas a local MCP server in OpenCode, with example environment variables for local embedding/reranker services and a Gemini chat model. Copy its contents into your project'sopencode.jsonand update the command path, model names, and API keys as needed.sample_AGENTS_md.md— A recommended snippet to add to your project'sAGENTS.md. It guides coding agents on when to usekerchunk_code_researchvs.kerchunk_search_code, how to use returned line-range citations for narrow file reads, and when to fall back togrep/glob.
License
This project is released into the public domain under the Unlicense.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Token-efficient search for coding agents over public and private documentation.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents and IDEs to ingest and search code repositories using hybrid retrieval (dense + sparse) with exact line-level citations for precise code analysis.1-
- FlicenseBqualityCmaintenanceEnables coding agents to search locally indexed repositories with hybrid semantic and lexical retrieval, returning exact source citations with file paths and line ranges.4-
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to search a locally indexed codebase with hybrid dense, lexical, and symbol-graph retrieval, returning ranked passages with exact file:line-line citations plus graph context and index status. It keeps its index in sync via a file watcher and runs as a local sidecar with no hosted service to deploy.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to index local code repositories and perform hybrid BM25 and vector search over AST-aware code chunks, with incremental updates and optional cross-encoder re-ranking.1MIT