openground
Search and read documentation from locally indexed libraries (git repos, sitemaps, local dirs) via three MCP tools.
Search documentation:
search_documents_toolperforms hybrid (vector + BM25) semantic search over the indexed docs, filtered bylibrary_nameandversion, returning relevant chunks.List available libraries:
list_libraries_toolreturns a dictionary of library names to their stored versions, so you know what can be searched before querying.Fetch full page content:
get_full_content_toolretrieves the complete text of a document by itsurlandversion(the URL/version come from search result hints) when chunks aren't enough.Ground AI agents in official docs without polluting conversation context, using a local, on-device RAG backend.
Share one server across sessions via stdio or HTTP transport (default
http://127.0.0.1:8765/mcp, loopback-only, unauthenticated).Pick up config changes live: each search reads the current config, so
top_k, chunking, and embedding settings apply without restarting.
openground
tldr: openground lets you give controlled access to documentation to AI agents. Everything happens on-device.
openground is an on-device RAG system that extracts documentation from git repos and sitemaps, embeds it for semantic search, and exposes it to AI agents via MCP. It uses a local embedding model, and local lancedb for storing embeddings and for hybrid vector similarity and BM25 full-text search.
Architecture
┌─────────────────────────────────────────────────────────────────────┐
│ OPENGROUND │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ SOURCE PROCESS STORAGE/CLIENT │
│ │
│ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌──────────┐ │
│ │ git repo ├─────>│ Extract ├──>│ Chunk ├──>│ LanceDB │ │
│ | -or- | │ (raw_data)│ │ Text │ │ (vector │ │
│ │ sitemap │ └───────────┘ └──────────┘ │ +BM25) │ │
│ │ -or- │ │ └────┬─────┘ │
│ │ local dir│ │ │ │
│ └──────────┘ │ │ │
│ ▼ │ │
│ ┌───────────┐ │ │
│ │ Local |<────────┘ │
│ │ Embedding │ │ │
│ │ Model │ ▼ │
│ └───────────┘ ┌─────────────┐ │
│ │ CLI / MCP │ │
│ │ (hybrid │ │
| | search) | |
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘Related MCP server: tech-doc-mcp
Quick Start
Install
uv tool install openground # sentence-transformers (GPU/MPS/CPU)
uv tool install 'openground[fastembed-cpu]' # also installs fastembed (or fastembed-gpu)fastembed is optional; select it with "embedding_backend": "fastembed" in the config file below.
or pip install openground.
Add documentation
openground add NAME SOURCE figures out the source type from SOURCE:
# git repo (optionally a docs folder and a tag/branch)
openground add fastembed https://github.com/qdrant/fastembed.git -d docs -v v0.7.4
# sitemap (optionally only URLs containing a keyword)
openground add claude-code https://code.claude.com/docs/sitemap.xml -f /en/
# local directory
openground add my-docs ./docsGit and local sources index .md, .rst, .txt, .mdx, .ipynb, .html and .htm files. GitHub/GitLab web URLs like https://github.com/o/r/tree/v1.0/docs also work; the tag and folder are picked up from the URL.
add adds; update refreshes. Each library has one source, remembered in sources.json next to the config file, and openground update re-extracts every stored version of every library from it (update NAME for one), re-embedding only pages that changed. Use add NAME -v VERSION to add another version from the same source. add NAME SOURCE with a different source than the one a stored library uses is an error: rm the library or pick another name. Adding a name and version that is already stored updates it in place.
Commands
Command | |
| Add a library or another version of it (an existing name+version is updated in place). Without |
| Refresh libraries from their remembered sources (all if no name) |
| List libraries, versions, and whether a source is remembered |
| Delete a library version; the remembered source is forgotten once the last version is gone. |
| Hybrid search from the terminal. Options: |
| Run the MCP server (same as |
| Configure |
| Show the config file path, effective settings and data locations |
| Library and chunk counts plus MCP tool call counts. |
| Delete embeddings, raw files and stats; config and remembered sources are kept. |
Use with AI agents
openground install-mcp claude-code # or cursor, opencode
openground install-mcp # print JSON for any other clientThen ask your agent something like "What models are available in fastembed?" and it will search your local docs.
Share one MCP server over HTTP
Run one server for all local agent sessions. The server loads the embedding model
on the first semantic search. Both openground-mcp and openground serve default to stdio.
openground-mcp --transport httpThe endpoint is http://127.0.0.1:8765/mcp. Use --host and --port to
override the bind address and port. The endpoint is unauthenticated, so keep it on
loopback for local use. Requests must use a loopback address or the specific
address passed to --host, with the configured port. Browser requests must also
come from one of those HTTP origins.
For a persistent server on Linux, save this as
~/.config/systemd/user/openground-mcp.service. Set ExecStart to the
absolute path reported by command -v openground-mcp if it differs from the example.
[Unit]
Description=OpenGround MCP server
[Service]
ExecStart=%h/.local/bin/openground-mcp --transport http
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.targetsystemctl --user daemon-reload
systemctl --user enable --now openground-mcp.serviceRun loginctl enable-linger "$USER" to keep the user service running after logout.
For Claude Code, replace the existing user-scoped stdio entry if you used
openground install-mcp claude-code. If you registered it at another scope,
use that scope for both commands.
claude mcp remove openground --scope user
claude mcp add --transport http --scope user openground http://127.0.0.1:8765/mcpFor OpenCode v2, replace the openground entry under mcp.servers in
~/.config/opencode/opencode.json (or your project config).
{
"mcp": {
"servers": {
"openground": {
"type": "remote",
"url": "http://127.0.0.1:8765/mcp",
"oauth": false
}
}
}
}For OpenCode v1, put the entry directly under mcp and allow extra time for the
first search to load or download the model.
{
"mcp": {
"openground": {
"type": "remote",
"url": "http://127.0.0.1:8765/mcp",
"enabled": true,
"timeout": 120000
}
}
}Both transports default to one math thread per library and disable tokenizer
parallelism. Set OPENGROUND_MATH_THREADS=2 in the server environment to raise
the default, including FastEmbed's ONNX Runtime thread count. Existing
OMP_NUM_THREADS, MKL_NUM_THREADS, OPENBLAS_NUM_THREADS, and
TOKENIZERS_PARALLELISM settings take precedence for their respective libraries.
For a systemd service, add Environment=OPENGROUND_MATH_THREADS=2 under [Service].
Configuration
Defaults work out of the box. To change them, create config.json in the config directory: $XDG_CONFIG_HOME/openground if set, otherwise ~/.config/openground (Linux/macOS) or %USERPROFILE%\AppData\Roaming\openground (Windows). Every key is optional:
{
"embedding_backend": "sentence-transformers",
"embedding_model": "BAAI/bge-small-en-v1.5",
"embedding_dimensions": 384,
"batch_size": 32,
"chunk_size": 800,
"chunk_overlap": 200,
"top_k": 5
}embedding_backend is sentence-transformers or fastembed. embedding_dimensions can be omitted (or 0) for the common bge and MiniLM models, where it is filled in automatically and a different value is rejected; set it yourself for any other model. Unknown keys are rejected, chunk_size, batch_size and top_k must be positive, and chunk_overlap (may be 0) must be smaller than chunk_size. Delete the file to reset.
The database remembers the backend and model its embeddings were made with, and openground uses them automatically unless config.json sets embedding_backend or embedding_model. If those explicitly disagree with the stored ones, add and search refuse to run until you remove them or run openground reset and re-add your libraries. Data lives in $XDG_DATA_HOME/openground or ~/.local/share/openground (%USERPROFILE%\AppData\Local\openground on Windows); run openground config to see all paths.
Each MCP search reads the current config file, so settings changes take effect without restarting the server.
Upgrading from 0.14
Your existing setup is migrated automatically, with a notice, the first time openground needs it:
Config is rewritten in the flat format; the old file is kept as
config.json.bak.db_path,raw_data_dirandtable_nameare no longer settings (you get a notice if you had customized a path). On Windows the config moves fromLocaltoRoamingAppData.Remembered sources from
~/.openground/sources.jsonare imported into the newsources.json. Project-level.openground/sources.json,--sources-fileand the bundled catalog are gone.Existing embeddings keep working. The default backend for new databases is now
sentence-transformers, but an existing database keeps using the backend and model it was built with.Commands changed.
extract-*,embed,query,list-libraries,remove,nuke,config set|get|show|resetandstats show|clearare replaced by the commands above. Local directories are now stored under the versionlatest.
Claude Code Agent
Openground includes a custom Claude Code agent that searches official documentation without polluting your main conversation context. See docs/claude-code-agent.md for installation and usage instructions.
Development
To contribute or work on openground locally:
git clone https://github.com/poweroutlet2/openground.git
cd openground
uv sync .License
MIT
Available Tools
3 toolsget_full_content_toolA
Retrieve the full content of a document by its URL and version.
Use this tool when you need to see the complete content of a page that was returned in search results. The URL and version are provided in the search result's tool hint.
Inputs: url (required), version (required). Returns: result
list_libraries_toolA
Retrieve a dictionary of available documentation libraries/frameworks with their versions.
Returns a dictionary mapping library names to lists of available versions. Use this tool to see what documentation is available before performing a search. If the desired library is not in the list, you may prompt the user to add it.
Inputs: no named parameters. Returns: object
search_documents_toolA
Search the official documentation knowledge base to answer user questions.
Always used this tool when a question might be answered or confirmed from the documentation.
First call list_libraries_tool to see what libraries and versions are available, then filter by library_name and version.
Inputs: query (required), version (required), library_name (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes: listing available libraries, searching documents, and retrieving full document content by URL/version. An agent can easily choose between discovery, search, and retrieval without overlapping functionality.
All tool names follow the same snake_case verb_noun_tool pattern: list_libraries_tool, search_documents_tool, get_full_content_tool. The convention is predictable and consistent across the entire set.
Three tools are well-scoped for a documentation search and retrieval server. Each tool covers a necessary part of the workflow: discovering libraries, searching content, and reading full documents.
For a read-only documentation knowledge base, the surface covers discovery, search, and full-content retrieval. There are no obvious missing operations such as create/update/delete, which do not apply to this domain.
Maintenance
Related MCP Connectors
Token-efficient search for coding agents over public and private documentation.
One place for every AI agent's pages and docs: versioned links to share, search and update.
Agentic search over your Dewey document collections from any MCP-compatible client.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides up-to-date documentation for AI agents by locally querying a community-driven registry of pre-built docs packages.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceProvides local technical documentation with hybrid search (semantic + BM25) for AI agents, ensuring access to up-to-date framework docs.MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to retrieve relevant context from local documents via MCP tools, supporting ingestion, semantic search, metadata filtering, and evidence inspection entirely on-device.MIT
- AlicenseAqualityBmaintenanceEnables agents to perform full-text search and read Hermes Agent documentation offline from a local cache, without scraping the site.2MIT