Pydantic AI Documentation Server
Provides programmatic access to Pydantic-AI documentation as an MCP server, enabling retrieval of specific documents, listing of topics, and access to changelog information.
README
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_cloneis 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 apathis 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:
git clone <repository_url> # Replace <repository_url> with the actual URL of this server's repository cd pydantic-ai-docs-server -
Create and activate a Python virtual environment: It's recommended to use Python 3.12 or newer. Using
python -m venv:python -m venv .venv source .venv/bin/activate # On Windows use: .venv\Scripts\activateAlternatively, using
uv:uv venv .venv source .venv/bin/activate # On Windows use: .venv\Scripts\activate -
Install dependencies: This project uses
uvfor fast package management, butpipcan also be used.uv pip install -e . # Or, if you don't have uv: # pip install -e .This installs the package in editable mode along with its dependencies specified in
pyproject.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:
pydantic-ai-docs-server
Or:
python -m pydantic_ai_docs_server
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:
{"type": "list-tools"}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:
{"type": "call-tool", "tool_name": "<tool_name_here>", "tool_args": {"<arg_name>": "<value>", ...}}Example: Calling
update_documentation{"type": "call-tool", "tool_name": "update_documentation", "tool_args": {"force_clone": false}}Example: Calling
get_document_by_path{"type": "call-tool", "tool_name": "get_document_by_path", "tool_args": {"path": "usage/models.md"}}Example: Calling
list_topics(no arguments){"type": "call-tool", "tool_name": "list_topics", "tool_args": {}}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.
{
"mcpServers": {
"pydantic-ai-docs": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/pydantic-ai-docs-server",
"run",
"-m",
"pydantic_ai_docs_server"
]
}
}
}
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 thatuvshould be used to launch the server."args": Defines the arguments passed touv:"--directory": Instructsuvto operate as if it were launched from the specified directory. Replace/path/to/your/pydantic-ai-docs-serverwith the actual absolute path to the root of thispydantic-ai_docs_serverproject on your system. This is critical for the server to correctly locate its internal modules and the cloned documentation repository."run": Theuvcommand to execute a project."-m","pydantic_ai_docs_server": Tellsuv runto execute thepydantic_ai_docs_serverpackage as a module (which runs its__main__.pyfile).
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).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。