Skip to main content
Glama
omniwaifu

Pydantic AI Documentation Server

by omniwaifu

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.

Related MCP server: mcp-docs

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. If force_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 the docs/ directory (e.g., usage/models.md).

  • list_topics(path: Optional[str] = None): Lists files and directories within the Pydantic-AI docs/ directory. If a path is provided, it lists contents of that subdirectory.

  • list_available_changelogs(): Lists all available changelog files found in the Pydantic-AI repository (typically under docs/history/).

  • get_changelog_content(path: str): Retrieves the content of a specific changelog file (e.g., history/0.2.0.md).

Setup

  1. Clone this repository:

    git clone <repository_url> # Replace <repository_url> with the actual URL of this server's repository
    cd pydantic-ai-docs-server
  2. 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\activate

    Alternatively, using uv:

    uv venv .venv
    source .venv/bin/activate  # On Windows use: .venv\Scripts\activate
  3. Install dependencies: This project uses uv for fast package management, but pip can 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:

  1. You send a JSON request object on a single line to the server's stdin.

  2. The server processes the request and sends a JSON response object on a single line to its stdout.

Common MCP Request Types:

  1. 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.

  2. 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 that uv should be used to launch the server.

  • "args": Defines the arguments passed to uv:

    • "--directory": Instructs uv 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 this pydantic-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": The uv command to execute a project.

    • "-m", "pydantic_ai_docs_server": Tells uv run to execute the pydantic_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).

Available Tools

5 tools
get_changelog_contentC

Retrieves the parsed content of a specific changelog file. The path should be relative to the Pydantic-AI documentation root's 'docs' directory (e.g., 'history/0.1.0.md').

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'retrieves' and 'parsed content', implying a read-only operation, but doesn't specify details like whether it requires authentication, handles errors (e.g., invalid paths), returns structured data, or has rate limits. This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences that are front-loaded and waste-free. The first sentence states the core purpose, and the second provides essential parameter context, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a read operation with one parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'parsed content' entails (e.g., text, structured data), error handling, or how it differs from sibling tools, leaving the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to the single parameter 'path' by specifying it should be 'relative to the Pydantic-AI documentation root's 'docs' directory' and gives an example ('history/0.1.0.md'), which is helpful since schema description coverage is 0%. However, it doesn't fully compensate by detailing constraints like allowed file formats or path validation rules, keeping it at a baseline level.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retrieves' and the resource 'parsed content of a specific changelog file', making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_document_by_path' or 'list_available_changelogs', which could handle similar content or listing functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some context about the path format ('relative to the Pydantic-AI documentation root's 'docs' directory'), but offers no guidance on when to use this tool versus alternatives like 'get_document_by_path' for general documents or 'list_available_changelogs' for listing changelogs. There's no explicit when/when-not or alternative tool recommendations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_document_by_pathA

Retrieves a specific document by its path relative to the Pydantic documentation root (e.g., 'usage/models.md'). Returns the ParsedDocument if found, otherwise None.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it's a read operation ('Retrieves'), specifies the return type ('ParsedDocument if found, otherwise None'), and mentions the path format ('relative to the Pydantic documentation root'). However, it doesn't cover error handling, performance, or authentication needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste: the first defines the tool's purpose and parameter, the second specifies the return behavior. It's front-loaded with the core functionality and appropriately sized for a simple retrieval tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is largely complete: it covers purpose, parameter semantics, and return values. However, it lacks details on error cases beyond 'None' and doesn't mention if there are rate limits or permissions required.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining the 'path' parameter as 'relative to the Pydantic documentation root' and provides an example ('usage/models.md'), which clarifies the expected format beyond the schema's basic string type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieves'), resource ('a specific document'), and mechanism ('by its path relative to the Pydantic documentation root'). It distinguishes from siblings by focusing on path-based retrieval rather than listing topics/changelogs or updating documentation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you need a document by its path (e.g., 'usage/models.md'), but provides no explicit guidance on when to use this versus alternatives like list_topics or update_documentation. The context is clear but lacks sibling differentiation or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_available_changelogsB

Lists all available changelog files found in the Pydantic-AI documentation repository (e.g., in 'docs/history/').

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool lists files but doesn't describe return format, pagination, error handling, or any constraints (e.g., rate limits, authentication needs). This leaves significant gaps for a tool with no structured behavioral hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action. It avoids unnecessary words, though it could be slightly more structured (e.g., by explicitly noting it returns a list of file names).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple but undocumented behavioral profile, the description is incomplete. It doesn't explain what the output looks like (e.g., list of strings, JSON structure), error conditions, or any operational context, making it inadequate for reliable agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description adds no parameter information, which is appropriate here. Baseline is 4 for zero parameters, as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Lists') and resource ('all available changelog files'), and identifies the location ('Pydantic-AI documentation repository'). It distinguishes from some siblings like 'get_changelog_content' (which retrieves content) but doesn't explicitly differentiate from 'list_topics' or 'get_document_by_path'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, context for usage, or comparisons to sibling tools like 'list_topics' or 'get_document_by_path', leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_topicsB

Lists files and directories non-recursively within the Pydantic documentation. The path is relative to the 'docs/' directory in the cloned Pydantic repository.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses the tool's scope ('non-recursively') and path context, but lacks critical behavioral details such as return format (e.g., list of strings, objects with metadata), pagination, error handling, or authentication requirements. For a tool with no annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences that directly convey essential information: the action, scope, and path context. Every word serves a purpose, and it's front-loaded with the core functionality, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and low schema coverage, the description is incomplete. It covers basic purpose and parameter context but omits critical details like return values, error conditions, and behavioral constraints. For a tool that likely returns a list of items, the lack of output information is a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description adds meaningful context for the single parameter: it explains that 'path' is relative to 'docs/' directory and clarifies the tool's scope. However, it doesn't detail parameter format (e.g., string patterns, null behavior) or provide examples, leaving some ambiguity despite compensating partially for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Lists files and directories') and resources ('within the Pydantic documentation'), and specifies the scope ('non-recursively'). It distinguishes from potential recursive listing tools but doesn't explicitly differentiate from sibling tools like 'list_available_changelogs' or 'get_document_by_path'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'non-recursively' and the path's relation to 'docs/' directory, suggesting this is for browsing documentation structure. However, it provides no explicit guidance on when to use this tool versus alternatives like 'get_document_by_path' or 'list_available_changelogs', nor does it mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_documentationC

Clones/updates the Pydantic repo, parses docs, and rebuilds the search index.

ParametersJSON Schema
NameRequiredDescriptionDefault
force_cloneNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions cloning/updating and rebuilding, which implies mutation operations, but doesn't specify whether this is destructive, requires authentication, has side effects on existing documentation, or involves rate limits. The description lacks critical behavioral context for a tool that modifies repository content and search indexes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just one sentence that efficiently describes the tool's three main operations. Every word earns its place, with no redundant information. The structure is front-loaded with the core functionality, making it easy for an agent to quickly understand what the tool does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (involving repository operations, parsing, and index rebuilding) with no annotations, no output schema, and minimal parameter documentation, the description is inadequate. It doesn't explain what 'updates' means versus 'clones', what format the search index takes, whether the operation is idempotent, or what happens on failure. For a mutation tool with infrastructure impact, this leaves too many gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description doesn't mention the 'force_clone' parameter at all, and with 0% schema description coverage, the parameter remains undocumented in both schema and description. However, since there's only one parameter, the baseline is higher than for multi-parameter tools. The description's mention of 'clones/updates' provides some implicit context for what 'force_clone' might control, but this is insufficient for clear parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('clones/updates', 'parses', 'rebuilds') and identifies the target resource ('Pydantic repo', 'docs', 'search index'). It distinguishes itself from sibling tools that focus on retrieving content rather than updating infrastructure. However, it doesn't fully differentiate from potential non-sibling tools that might perform similar operations on different repositories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing repository access), frequency considerations, or when the 'force_clone' parameter should be used. With sibling tools focused on content retrieval, there's no explicit comparison to help an agent decide between update operations and read operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedget_changelog_content
    • First observedget_document_by_path
    • First observedlist_available_changelogs
    • First observedlist_topics
    • First observedupdate_documentation

TDQS

A3.5/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: get_changelog_content retrieves specific changelog content, get_document_by_path retrieves general documents, list_available_changelogs lists changelog files, list_topics lists general documentation topics, and update_documentation handles repository maintenance and indexing. The descriptions clearly differentiate their scopes and use cases.

Naming Consistency4/5

The naming follows a consistent verb_noun pattern with snake_case throughout (e.g., get_changelog_content, list_available_changelogs). The only minor deviation is update_documentation, which uses a verb_noun structure but lacks a direct object like the others, though it remains readable and fits the pattern well overall.

Tool Count5/5

With 5 tools, the count is well-scoped for a documentation server, covering key operations like retrieving documents, listing content, and updating the repository. Each tool earns its place without feeling excessive or insufficient for the domain of documentation management.

Completeness4/5

The tool set provides good coverage for documentation retrieval and management, including reading, listing, and updating. A minor gap is the lack of tools for creating or modifying documents, but this is reasonable for a read-focused server, and agents can work around this with the update_documentation tool for broader changes.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Provides AI assistants with real-time access to the AGNO framework documentation by enabling them to browse, search, and fetch documentation pages. This server allows users to query information about AGNO's Agents, Teams, and Workflows directly through MCP-compatible clients.
    16
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Generic MCP server that exposes Markdown documentation to LLMs, enabling them to search and answer questions about any software documentation.
    MIT