uv-docs-mcp
An MCP server providing programmatic access to UV documentation through a standardized API.
UV Documentation MCP Server
An MCP server that provides programmatic access to UV documentation through a standardized API. This server now leverages a modern, hierarchical resource structure that exposes both highβlevel documentation sections and detailed command documentation (including subsections) as individual MCP resources. Tools have been streamlined, and many documentation queries are handled via the resource layer.
Links
Quick Start
-
Requirements:
Ensure Python 3.13+ is installed (minimum 3.10 for MCP SDK compatibility). -
Clone the Repository:
git clone https://github.com/StevenBtw/uv-docs-mcp.git cd uv-docs-mcp
-
Set Up Virtual Environment and Install Dependencies:
python3.13 -m venv env source env/bin/activate # On Windows use: env\\Scripts\\activate pip install -e .
-
Run the Server:
uv run uv-docs
(If using Claude Desktop or other MCP clients, adjust configuration accordingly.)
Architecture
The server is built with a modular and hierarchical design that clearly separates concerns:
flowchart TD
Client[MCP Client] --> Server[Server Layer]
Server --> Resources[Resource Layer]
Server --> Tools[Tools Layer]
Server --> Prompts[Prompts Layer]
Resources --> Cache[Cache System]
Tools --> Cache
-
Resource Layer:
Exposes UV documentation via URIs with the schemeuv-docs://
. Resources are structured hierarchically:- Level 1: Base sections (e.g.,
uv-docs://cli
,uv-docs://settings
,uv-docs://resolver
) - Level 2: Individual commands (e.g.,
uv-docs://cli/uv-run
,uv-docs://cli/uv-cache
) - Level 3: Command subsections (e.g.,
uv-docs://cli/uv-cache/uv-cache-dir
)
- Level 1: Base sections (e.g.,
-
Tools Layer:
Provides operational commands to interact with the cache and perform real-time searches.- update_cache: Updates the documentation cache if the live version differs.
- search_documentation: Searches UV documentation using real-time query execution.
-
Prompts Layer:
Supplies prompt templates for AI assistants to generate documentation summaries (e.g., thesummarize-docs
prompt).
Components
Resources
Resources are accessed using the uv-docs://
URI scheme and provide the full hierarchy of documentation. For example:
-
Base Section:
uv-docs://cli
returns the list of all CLI commands. -
Command Level:
uv-docs://cli/uv-cache
returns metadata about theuv cache
command, including available documentation sections. -
Subsection Level:
uv-docs://cli/uv-cache/uv-cache-dir
returns the detailed documentation content for the βuv cache dirβ section.
Each resource returns JSON data with detailed metadata and, when requested, the full documentation content. This fine-grained breakdown allows MCP clients and AI assistants to query only the information they require.
Tools
The available tools have been streamlined:
- update_cache
- Purpose: Update the documentation cache if the live version has changed.
- Input:
{ "force": false }
- search_documentation
- Purpose: Perform real-time searches over the UV documentation.
- Input:
{ "query": "search query" }
Prompts
The server provides pre-built prompt templates for common documentation tasks:
- summarize-docs:
Creates a summary of UV documentation sections.
Optional Arguments:
If no section is specified, summaries for all sections are generated.{ "section": "cli|settings|resolver" }
Installation & Configuration
MCP Server Configuration
For Claude Desktop or other systems, modify the MCP server settings appropriately:
Development/Unpublished Configuration
{
"mcpServers": {
"uv-docs": {
"command": "uv",
"args": [
"--directory",
"/Users/steven/Git/MCP/uv-docs",
"run",
"uv-docs"
]
}
}
}
Published Configuration
{
"mcpServers": {
"uv-docs": {
"command": "uvx",
"args": [
"uv-docs"
]
}
}
}
Debugging & Inspection
For detailed debugging, use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /Users/steven/Git/MCP/uv-docs run uv-docs
Caching
The server implements a version-aware caching system to optimize documentation retrieval:
- Initialization: The cache is automatically initialized at startup.
- Version Checking: The live documentation version is checked against the cached version.
- Segmented Caching: Each documentation section (e.g., CLI, settings, resolver) is cached separately.
- Manual Updates: Use the
update_cache
tool when necessary.
Development
Project Structure
uv-docs/
βββ src/
β βββ uv_docs/
β βββ __init__.py
β βββ server.py # Server setup and routing
β βββ resources.py # Resource handling and MCP resource interface
β βββ cache.py # Version-aware cache system
β βββ prompts.py # Prompt templates for documentation tasks
β βββ tools.py # Consolidated tool implementations (update_cache, search_documentation)
βββ pyproject.toml # Project configuration
βββ README.md # Project overview (this file)
Building & Publishing
- Sync Dependencies & Lockfile:
uv sync
- Build Package Distributions:
uv build
- Publish to PyPI:
uv publish
Note: Set PyPI credentials via:
- Token:
--token
or environment variableUV_PUBLISH_TOKEN
- Or username/password:
--username
/UV_PUBLISH_USERNAME
and--password
/UV_PUBLISH_PASSWORD
Debugging
For the best debugging experience, use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /Users/steven/Git/MCP/uv-docs run uv-docs
The Inspector will display a URL for browser-based debugging.
Caching
The server implements a version-aware caching system:
- Cache initializes on server start
- Version checks against live documentation
- Automatic updates when version changes
- Manual updates via update_cache tool
- Each documentation section cached separately
Related MCP Servers
View all developer_tools servers βcontext7
by upstash
Context7 MCP provides up-to-date, version-specific documentation and code examples directly into your prompt, enhancing the capabilities of LLMs by ensuring they use the latest information.
Sequential Thinking
by modelcontextprotocol
An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.
git-mcp
by idosal
GitMCP is a free, open-source, remote Model Context Protocol (MCP) server that transforms GitHub projects into documentation hubs, enabling AI tools to access up-to-date documentation and code.
Everything MCP Server
by modelcontextprotocol
The Everything MCP Server is a comprehensive test server designed to demonstrate the full capabilities of the Model Context Protocol (MCP). It is not intended for production use but serves as a valuable tool for developers building MCP clients.
exa-mcp-server
by exa-labs
A Model Context Protocol (MCP) server allows AI assistants to use the Exa AI Search API for real-time web searches in a secure manner.
repomix
by yamadashy
Repomix is a tool that packs your codebase into AI-friendly formats, making it easier to use with AI tools like LLMs.
mcpdoc
by langchain-ai
MCP LLMS-TXT Documentation Server provides a structured way to manage and retrieve LLM documentation using the Model Context Protocol.