MCP server for Verso-generated documentation sites (the Lean Language Reference, Functional Programming in Lean, and other Verso Manual-genre sites).
Project description
An MCP (Model Context Protocol) server that lets an AI agent search and read documentation built with Verso, Lean's documentation authoring tool.
Verso powers most of the Lean ecosystem's reference docs and books — the
Lean Language Reference,
Functional Programming in Lean,
Theorem Proving in Lean 4,
and more. Verso Manual-genre sites publish a machine-readable cross-reference
index (xref.json); this server consumes that index and the rendered HTML.
[!WARNING] The format of the
xref.jsonfiles that this server depends on is Verso-internal and may change at any time. Such changes could render this server non-functional. I'll try to keep up with any such changes, but can't make any promises.
Point it at one or more Verso sites and an agent gets four read-only tools:
list_sites, list_kinds, search, and fetch_page.
Tools
| Tool | Description |
|---|---|
list_sites |
Enumerate the configured Verso sites and their aliases. |
list_kinds |
List a site's entry kinds (tactics, terms, sections, options, …) with counts. |
search |
Name-ranked search over a site's cross-reference index, with kind filtering and pagination. |
fetch_page |
Fetch a page — or a single #anchor entry — from a site and return it as Markdown. |
list_kinds, search, and fetch_page take an optional site argument (an
alias from list_sites); omit it to use the default site. All tools are
read-only and accept a response_format of markdown (default) or json.
Entry "kinds" are derived dynamically from each site's xref.json, so
project-specific domains (Lake commands, error explanations, …) are picked up
automatically — nothing about a particular site is hard-coded.
Configuring sites
Set the VERSO_MCP_SITES environment variable to a comma-separated list of
alias=url pairs. A bare URL (no alias=) gets an alias derived from its path.
VERSO_MCP_SITES="lean-reference=https://lean-lang.org/doc/reference/latest/,
fpil=https://lean-lang.org/functional_programming_in_lean/,
tpil=https://lean-lang.org/theorem_proving_in_lean4/"
The first site listed is the default. If VERSO_MCP_SITES is unset, the server
defaults to a single site, the Lean Language Reference.
A site URL must be the root directory that contains xref.json (Verso writes it
there for Manual- and Tutorial-genre sites). The configured site roots also
serve as the network allowlist — see Safety.
Requirements
uv. uv fetches the package and its dependencies
automatically on first launch — no manual virtualenv or pip install step.
Use with Claude Code / Claude Desktop
Add an entry to your MCP configuration (.mcp.json, ~/.claude.json, or
claude_desktop_config.json):
{
"mcpServers": {
"verso": {
"type": "stdio",
"command": "uvx",
"args": ["verso-mcp"],
"env": {
"VERSO_MCP_SITES": "lean-reference=https://lean-lang.org/doc/reference/latest/, fpil=https://lean-lang.org/functional_programming_in_lean/"
}
}
}
}
Environment variables
All optional:
| Variable | Default | Purpose |
|---|---|---|
VERSO_MCP_SITES |
Lean Language Reference | Comma-separated alias=url site list (see above). |
VERSO_MCP_CACHE |
~/.cache/verso-mcp |
Cache directory (each site cached in its own subdirectory). |
VERSO_MCP_RATE_PER_SEC |
2 |
Sustained outbound request rate (requests/second). |
VERSO_MCP_RATE_BURST |
5 |
Token-bucket burst capacity. |
VERSO_MCP_RATE_MAX_WAIT |
3 |
Max seconds to wait for a token before refusing. |
Safety & etiquette
[!WARNING] MCP servers have a lot of risks. As far as MCP servers go, this one (
verso-mcp) should be relatively innocuous: it is read-only, runs no shell commands, and only reaches the documentation sites you configure (or just the Lean Language Reference, if left unconfigured). The main caveat is that a malicious or compromised documentation site could try to steer the model via indirect prompt injection.verso-mcpcannot prevent that, so don't let an agent that uses it take consequential actions without your review.
The server is built to be a well-behaved client of documentation sites:
- Scoped network access — fetches are restricted to the configured site
roots; the site list doubles as the allowlist. Enforced on the request URL
and the final post-redirect URL, so a same-host URL outside a configured
root is still refused. Path traversal (
..,%2e%2e, backslash variants) is rejected. - Obeys
robots.txt— each host'srobots.txtis fetched and respected for this server'sUser-Agent; a host can target it specifically with aUser-agent: verso-mcpgroup. - Rate limiting — a shared token bucket caps outbound requests across all sites (default 2 req/s, burst 5); a hit falls back to cached content rather than hammering the origin.
- Caching & revalidation —
xref.jsonand pages are cached on disk per site (24 h TTL) withETag/If-None-Matchconditional revalidation, so a repeated lookup costs at most a304 Not Modified. - Bounded responses — HTTP bodies are streamed with an 8 MB cap; Markdown output is capped at 200 KB; each site's page cache is LRU-evicted at 200 MB.
- Identifying
User-Agenton every request.
Evaluation
evaluation.xml is a 10-question evaluation suite in the format used by
Anthropic's mcp-builder skill. The questions target the default site (the
Lean Language Reference); each is read-only, independent, and has a single
stable, verifiable answer.
Limitations
- Works with Verso Manual-genre sites (those that publish
xref.json). Blog-genre sites have noxref.json. Tutorial-genre sites also emit one and should work, but are untested. searchis name-based — it matches entry names and titles in the cross-reference index, the same granularity as Verso's own on-site search. It does not do full-text search of page bodies.- The
xref.jsonschema is an undocumented Verso internal; it may shift between Verso releases, which could break this MCP server if it doesn't keep up.
Disclaimer
This project was written almost entirely by Claude Opus 4.7 (1M), an AI assistant. It was built for my own personal use and is shared here only in case it is useful to others. It comes with no warranty whatsoever. Use it at your own risk.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file verso_mcp-0.4.2.tar.gz.
File metadata
- Download URL: verso_mcp-0.4.2.tar.gz
- Upload date:
- Size: 120.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9146502a6070c861f370ac576a486f4128a467ec7f126b58d76a6f2ab7e06159
|
|
| MD5 |
b68de7063500e7892349af46c3ebc0df
|
|
| BLAKE2b-256 |
963c6cc67b7a028e3456a85b3471acc48a6bf099d286f2d256b618aac40ebb0e
|
Provenance
The following attestation bundles were made for verso_mcp-0.4.2.tar.gz:
Publisher:
release.yml on nvlang/verso-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
verso_mcp-0.4.2.tar.gz -
Subject digest:
9146502a6070c861f370ac576a486f4128a467ec7f126b58d76a6f2ab7e06159 - Sigstore transparency entry: 1565698068
- Sigstore integration time:
-
Permalink:
nvlang/verso-mcp@a7affd0a7f51f552e52e4bf1fc73e1bde3f4a0c8 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/nvlang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a7affd0a7f51f552e52e4bf1fc73e1bde3f4a0c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file verso_mcp-0.4.2-py3-none-any.whl.
File metadata
- Download URL: verso_mcp-0.4.2-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a361870cf89eed3097f9cbd1b270782c8ef140330854e1f6451c3a220194a221
|
|
| MD5 |
9f000cbce63fc6cee10d9a7ea4198690
|
|
| BLAKE2b-256 |
3f8115e8dae527d0aab76abdc0bbe4049a7821135efa50e4bce7d92849522c29
|
Provenance
The following attestation bundles were made for verso_mcp-0.4.2-py3-none-any.whl:
Publisher:
release.yml on nvlang/verso-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
verso_mcp-0.4.2-py3-none-any.whl -
Subject digest:
a361870cf89eed3097f9cbd1b270782c8ef140330854e1f6451c3a220194a221 - Sigstore transparency entry: 1565698090
- Sigstore integration time:
-
Permalink:
nvlang/verso-mcp@a7affd0a7f51f552e52e4bf1fc73e1bde3f4a0c8 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/nvlang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a7affd0a7f51f552e52e4bf1fc73e1bde3f4a0c8 -
Trigger Event:
push
-
Statement type: