Provides programmatic access to the Pydantic-AI documentation, offering tools to clone/update the docs repository, retrieve specific documents, list documentation topics, and access changelog information.
Pydantic AI Documentation Server
Overview
This server provides programmatic access to the Pydantic-AI documentation, including cloning/updating the documentation repository, retrieving specific documents, listing documentation topics, and accessing changelog information. It operates as a Model Context Protocol (MCP) server, exposing its functionalities as tools.
Note: This is primarily for personal use and requires cloning the repository and using the update tool to keep the documentation up to date.
Features
The server exposes the following tools via MCP:
update_documentation(force_clone: bool = False)
: Clones the Pydantic-AI repository (if not already present) or pulls the latest updates. Ifforce_clone
is true, it will delete any existing repository and clone fresh.get_document_by_path(path: str)
: Retrieves a specific documentation file by its path relative to thedocs/
directory (e.g.,usage/models.md
).list_topics(path: Optional[str] = None)
: Lists files and directories within the Pydantic-AIdocs/
directory. If apath
is provided, it lists contents of that subdirectory.list_available_changelogs()
: Lists all available changelog files found in the Pydantic-AI repository (typically underdocs/history/
).get_changelog_content(path: str)
: Retrieves the content of a specific changelog file (e.g.,history/0.2.0.md
).
Setup
- Clone this repository:
- Create and activate a Python virtual environment:
It's recommended to use Python 3.12 or newer.
Using
python -m venv
:Alternatively, usinguv
: - Install dependencies:
This project uses
uv
for fast package management, butpip
can also be used.This installs the package in editable mode along with its dependencies specified inpyproject.toml
.
Running the Server
Once the setup is complete, you can run the server using the script installed by pip install -e .
, or by running the module directly:
Or:
The server will start and listen for MCP requests over standard input/output (stdio).
Using the Server
This application is an MCP server designed to communicate over standard input/output (stdio) using newline-delimited JSON messages. To interact with it, you would typically use an MCP client library or tool that can manage this communication channel. However, you can also interact with it directly by sending and receiving the raw JSON messages if you are developing a client or for testing purposes.
Interaction Protocol:
- You send a JSON request object on a single line to the server's stdin.
- The server processes the request and sends a JSON response object on a single line to its stdout.
Common MCP Request Types:
- Listing Available Tools (
list-tools
)To ask the server what tools it provides, send a JSON message like this:The server will respond with a JSON object containing a list of available tools and their schemas. - Calling a Tool (
call-tool
)To execute a specific tool, send a JSON message like this:Example: Callingupdate_documentation
Example: Callingget_document_by_path
Example: Callinglist_topics
(no arguments)The server will respond with a JSON object containing the result of the tool execution or an error if something went wrong.
Refer to the Model Context Protocol specification for more details on the message formats and protocol. The tools available on this server are defined in pydantic_ai_docs_server/server.py
.
Integration with MCP Clients (e.g., Cursor)
To use this server with an MCP client application like Cursor, you need to configure it in the client's MCP settings file. For Cursor, this is typically a file named .cursor/mcp.json
located in your project root.
.cursor/mcp.json
Configuration:
Add or update the mcpServers
section in your .cursor/mcp.json
as follows. This configuration uses uv
to run the server module from the specified project directory.
Key points for this configuration:
"pydantic-ai-docs"
: This is a name you assign to this server configuration. Your MCP client (e.g., Cursor) will use this name to identify and communicate with this server."command": "uv"
: Specifies thatuv
should be used to launch the server."args"
: Defines the arguments passed touv
:"--directory"
: Instructsuv
to operate as if it were launched from the specified directory. Replace/path/to/your/pydantic-ai-docs-server
with the actual absolute path to the root of thispydantic-ai_docs_server
project on your system. This is critical for the server to correctly locate its internal modules and the cloned documentation repository."run"
: Theuv
command to execute a project."-m"
,"pydantic_ai_docs_server"
: Tellsuv run
to execute thepydantic_ai_docs_server
package as a module (which runs its__main__.py
file).
Ensure your virtual environment (created with uv venv
or python -m venv
) is active, or that uv
is installed globally and can find the project's environment when the MCP client starts the server.
Once configured, your MCP client should be able to discover and call the tools provided by this server (e.g., PyDanticAIDocs.update_documentation
).
This server cannot be installed
Provides programmatic access to Pydantic-AI documentation as an MCP server, enabling retrieval of specific documents, listing of topics, and access to changelog information.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation contextLast updated -76281TypeScriptMIT License
- AsecurityFlicenseAqualityThis server provides access to the Perplexity AI API, enabling interaction through chatting, searching, and documentation retrieval within MCP-based systems.Last updated -52JavaScript
- -securityAlicense-qualityAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context. Uses Ollama or OpenAI to generate embeddings. Docker files includedLast updated -1914TypeScriptMIT License
- -securityFlicense-qualityAn MCP server that integrates with Claude to provide smart documentation search capabilities across multiple AI/ML libraries, allowing users to retrieve and process technical information through natural language queries.Last updated -Python