mcp_for_agents
Provides access to offline LangGraph documentation, allowing AI agents to list documentation sources, search for relevant docs, and retrieve specific documentation content.
Click on "Deploy 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., "@mcp_for_agentssearch the LangGraph docs for 'checkpointer' usage"
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.
mcp_for_agents
A small Python library for building local, offline MCP servers that expose the documentation of your favorite open-source packages to AI agents (opencode, Claude Code, etc.). Zero network dependency at query time.
What it is
A reusable build_server() factory plus a thin per-package template.
Each package's MCP server becomes a 3-line Python file:
from mcp_for_agents import build_server
if __name__ == "__main__":
build_server().run()The library handles indexing the docs mirror, scoring search queries,
and exposing the three tools (list_doc_sources, search_docs,
get_doc) over stdio.
Related MCP server: docs-cache-mcp
Repository layout
Path | Purpose |
| The library. Exports |
| Unit and integration tests for the library. |
| A 3-line |
| The end-to-end process for adding a new package. |
| Version history. Bump when you change the library. |
Reference implementation
../MLOps_Tutorials/other_notes/Automations/opencode/mcp-servers/langgraph-docs/
is a working example of a per-package MCP server built using this
library (the library was extracted from that standalone script). It
mirrors what a copy of template/ looks like after per-package
customization.
Quick start
To use the library in a per-package MCP server:
mkdir -p ~/.config/opencode/mcp-servers/<name>-docs
cp -R <PATH_TO_THIS_REPO>/template/ ~/.config/opencode/mcp-servers/<name>-docs/
cd ~/.config/opencode/mcp-servers/<name>-docs
uv init --no-readme
uv add /path/to/mcp_for_agentsThe library gets installed as a regular dependency. server.py runs as
a thin entry point. To work on the library itself, see Development
below.
Development
cd /path/to/mcp_for_agents
# Install the library in editable mode with dev deps
uv sync --dev
# Run tests
uv run pytest
# Lint and format
uv run ruff check .
uv run ruff format .To verify a package's mirror after setting it up:
uv run mcp-for-agents-test ~/docs-mirror/<name>(Install the CLI globally with uv tool install /path/to/mcp_for_agents
if you want it on PATH.)
Releasing
Releases are cut with scripts/release.sh, which keeps the three
version sources (pyproject.toml,
src/mcp_for_agents/__init__.py, and the git tag) in sync. The
script never pushes; pushing stays manual so nothing leaves the
machine unreviewed.
Prerequisites: clean tree, on main, uv on PATH.
./scripts/release.sh patch # or: minor, majorWhat the script does, in order:
Aborts unless the tree is clean and you are on
main.Reads the current version from both
pyproject.tomland__init__.py, and aborts if they disagree (version drift must be fixed by hand first).Computes the next version (semver;
major/minorreset the lower segments to zero) and aborts if the tag already exists. This check runs before anything is modified, so a duplicate tag cannot leave a half-done commit behind.Writes the new version to both files and stubs a
CHANGELOG.mdentry above the newest existing one.Runs
ruff check,ruff format --check, andpytest(all--frozen, so the lockfile cannot shift). Any failure aborts before the commit.Commits the three files as
[chore] release vX.Y.Zand creates annotated tagvX.Y.Z.
After it finishes:
git show HEAD && git show vX.Y.Z # review
# fill in the TODO stubs in CHANGELOG.md, then:
git add CHANGELOG.md && git commit -m "[docs] describe vX.Y.Z changes"
git push origin main --follow-tags # shipAdding a new package
See playbook.md for the three-phase process: review the upstream
repo, sparse-clone the docs mirror, and wire the MCP server using the
template.
Requirements
uv0.4+ onPATHgitPython 3.14+ (uv will fetch one if missing)
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Create guides as MCP servers to instruct coding agents to use your software (library, API, etc).
MCP server for accessing curated awesome list documentation
MCP server for agentverse documentation, generated by doc2mcp.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides a local MCP server for searching and retrieving documentation from 22+ open-source projects, enabling AI coding assistants to access up-to-date docs without network dependency.11 npm2MIT
- AlicenseAqualityBmaintenanceA local MCP server that fetches official library documentation (llms.txt-first), caches it to disk, and serves relevant sections to coding agents offline with deterministic retrieval.33 npmMIT
- FlicenseNot gradedqualityBmaintenanceLocal MCP server that indexes documentation from URLs/files into a vector database, enabling coding agents to search and use up-to-date library and API documentation.-
- AlicenseNot gradedqualityBmaintenanceA local MCP server that gives AI agents access to developer tooling — GitHub (read-only), documentation search, and web research — via stdio transport.MIT