From 349c5d83e70de1ad2e2df848e16a52f133889e40 Mon Sep 17 00:00:00 2001 From: Kamal Moha Date: Fri, 3 Oct 2025 22:58:24 +0300 Subject: [PATCH] Edited the MCPServerHTTP Docs and included a url parameter --- docs/.hooks/snippets.py | 3 ++- docs/mcp/client.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/.hooks/snippets.py b/docs/.hooks/snippets.py index 5ffaa9e63a..4ae608eb2c 100644 --- a/docs/.hooks/snippets.py +++ b/docs/.hooks/snippets.py @@ -149,7 +149,8 @@ def parse_snippet_directive(line: str) -> SnippetDirective | None: def parse_file_sections(file_path: Path) -> ParsedFile: """Parse a file and extract sections marked with ### [section] or /// [section]""" - input_lines = file_path.read_text().splitlines() + # input_lines = file_path.read_text().splitlines() + input_lines = file_path.read_text(encoding="utf-8").splitlines() output_lines: list[str] = [] lines_mapping: dict[int, int] = {} diff --git a/docs/mcp/client.md b/docs/mcp/client.md index 2558519c1b..d41617972e 100644 --- a/docs/mcp/client.md +++ b/docs/mcp/client.md @@ -54,7 +54,7 @@ Then we can create the client: from pydantic_ai import Agent from pydantic_ai.mcp import MCPServerStreamableHTTP -server = MCPServerStreamableHTTP('http://localhost:8000/mcp') # (1)! +server = MCPServerStreamableHTTP(url='http://localhost:8000/mcp') # (1)! agent = Agent('openai:gpt-4o', toolsets=[server]) # (2)! async def main():