context-server
Supports storing and retrieving the vector database from Google Cloud Storage via gs:// URIs, using Application Default Credentials for authentication.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@context-serversearch my project docs for 'error handling'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Index once into a SQLite DB (embeddings + BM25). Point Claude Code, Cursor, or any MCP client at serve, and the agent can search that corpus instead of guessing from memory.
One Rust binary. ONNX Runtime is linked in via ort / fastembed — no separate libonnxruntime to ship. SQLite is bundled.
Quick start
pip install context-server
# or: uvx context-server@latest …
context-server index --input ./docs --db context.db
context-server search --db context.db "how do we handle backports"
context-server serve --db context.dbWheels: Linux x86_64/aarch64 (manylinux_2_39 / glibc 2.39+, e.g. Ubuntu 24.04+) and macOS Apple Silicon.
The first embedding run downloads BGE-small-en-v1.5 into
$XDG_CACHE_HOME/context-server/fastembed/ (or ~/.cache/...; once, tens of MB).
Override with FASTEMBED_CACHE_DIR or HF_HOME.
Optional: tell the agent when to use this corpus
context-server index --input ./docs --db context.db \
--instructions-file ./mcp-instructions.txt
# or: --instructions 'Use semantic_search for questions about …'That text is stored in the DB and exposed as MCP ServerInfo.instructions when you serve.
Claude Code
claude mcp add --transport stdio --scope user context-server \
-- uvx --refresh context-server@latest \
serve --db /absolute/path/to/context.db--refresh + @latest rechecks PyPI on each start. If Claude rarely surfaces the tools, set "alwaysLoad": true on the server entry in your Claude MCP config.
Cursor
~/.cursor/mcp.json (or project .cursor/mcp.json):
{
"mcpServers": {
"context-server": {
"command": "uvx",
"args": [
"--refresh",
"context-server@latest",
"serve",
"--db",
"/absolute/path/to/context.db"
]
}
}
}Reload MCP after editing. Re-index when content changes, then restart the MCP session so serve reloads the DB.
Related MCP server: mcplens
What it indexes
Only .md / .markdown. Chunks on # / ## / ###, keeps the heading path on each chunk, and splits long sections with overlap.
Convert structured sources (YAML, etc.) to prose before indexing. Fenced YAML searches poorly; a short paragraph that keeps names, roles, and relationships together works much better.
Try the sample set:
cargo build --release
./target/release/context-server index --input examples/sample-docs --dry-run
./target/release/context-server index --input examples/sample-docs --db /tmp/sample.db
./target/release/context-server search --db /tmp/sample.db "password reset"Search
Default mode is hybrid: dense cosine (BGE-small-en-v1.5) plus BM25, fused with reciprocal rank fusion. Dense catches paraphrase; BM25 catches exact tokens (usernames, acronyms, IDs).
context-server search --db context.db --mode hybrid "query" # default
context-server search --db context.db --mode dense "query"
context-server search --db context.db --mode lexical "query"
# Scope to a subtree / heading / metadata tag
context-server search --db context.db --path-prefix teams/ "who owns storage"
context-server search --db context.db --heading Backport "z-stream"
context-server get --db context.db --path teams/storage.md --chunk 0MCP tools
Tool | Role |
| Ranked passages + scores; optional |
| Indexed chunks; optional |
| Best matching passage(s) — retrieval only; same filters as search |
| Full chunk by citation ( |
Search hits cite chunks as source_path#chunk_index. Call get_document to pull the full text for quoting.
Remote database (GCS)
serve and search accept a gs:// URI. The object is cached under $XDG_CACHE_HOME/context-server/dbs/ (or ~/.cache/...). index still writes a local path only.
context-server serve --db 'gs://my-bucket/latest/context.db'
# Project-qualified form also works (gs:// required; stripped for the Storage API)
context-server serve --db \
'gs://projects/my-gcp-project/buckets/my-bucket/objects/latest/context.db'Uses Application Default Credentials. If a sibling {object}.sha256 exists (sha256sum format), a matching local cache is reused; otherwise the DB is re-fetched and verified.
CLI
context-server index --input <path> [--db FILE] [--dry-run] [--batch N]
[--instructions TEXT | --instructions-file FILE]
context-server serve --db <local path | gs://…>
context-server search --db <local path | gs://…> [--limit N] [--mode hybrid|dense|lexical]
[--path-prefix P] [--heading H] [--tag T] <query>
context-server get --db <local path | gs://…> --path FILE [--chunk N]
context-server embed <query> # smoke-test query embedding (BGE instruction)Build from source
cargo build --release
cargo testRust 1.75+, Linux x86_64 is the primary target. You need a C++ stdlib for the linker (libstdc++) and whatever OpenSSL/native-tls needs on your platform.
On Fedora/RHEL, if the linker wants -lstdc++ but only libstdc++.so.6 exists:
mkdir -p .linker && ln -sfn /usr/lib64/libstdc++.so.6 .linker/libstdc++.so
export RUSTFLAGS="-L native=$(pwd)/.linker"Linux wheels (same image CI uses — Ubuntu 24.04 / glibc 2.39):
./scripts/build-wheel.sh
VERSION=2026.716.1 ./scripts/build-wheel.sh # optional overrideReleasing
CalVer YYYY.MMDD.N (e.g. 2026.716.1) so versions work for both Cargo and PyPI. Run the Release workflow on main (Actions UI or CLI); it picks the next version, builds wheels, publishes to PyPI, then creates the matching git tag and GitHub Release (with wheels attached).
gh workflow run release.yml --repo context-server/context-serverDesign notes
Under the hood: fastembed BGE-small-en-v1.5 (384-d, L2-normalized; query instruction applied at search time), rusqlite with float32 blobs, rmcp over stdio. Each index run replaces the DB contents. Re-run index after upgrading if MODEL_ID changed.
More detail and roadmap: PLAN.md.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityDmaintenanceA local MCP server that allows AI systems to search and retrieve information from a custom knowledge base generated from markdown files. It provides tools for natural language text search, category browsing, and specific content chunk retrieval.Last updated3
- Alicense-qualityBmaintenanceA local MCP server that provides AI coding assistants with semantic search capabilities over codebases. It indexes code using local embeddings and exposes tools for efficient code retrieval, saving tokens and improving response quality.Last updated314MIT
- Flicense-qualityDmaintenanceA local MCP server that provides semantic memory storage and retrieval for coding and AI agents, enabling durable context across chat sessions.Last updated864
- Flicense-qualityCmaintenanceAn MCP server for team documentation and knowledge bases, enabling semantic search over documentation files using local embeddings.Last updated
Related MCP Connectors
Local-first RAG engine with MCP server for AI agent integration.
An MCP server that gives your AI access to the source code and docs of all public github repos
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/context-server/context-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server