From 08c3f9afe6fc43d2036dad3ad8d40c0d0cec3ed4 Mon Sep 17 00:00:00 2001 From: Minseok Jung <37059223+Minseok0917@users.noreply.github.com> Date: Fri, 18 Apr 2025 15:21:06 +0900 Subject: [PATCH 1/2] update docs --- docs/getting-started/quickstart.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdx index b56b5e7bc..69a5b81a5 100644 --- a/docs/getting-started/quickstart.mdx +++ b/docs/getting-started/quickstart.mdx @@ -32,7 +32,7 @@ from fastmcp import FastMCP mcp = FastMCP("My MCP Server") -@mcp.tool +@mcp.tool() def greet(name: str) -> str: return f"Hello, {name}!" ``` @@ -48,7 +48,7 @@ from fastmcp import FastMCP, Client mcp = FastMCP("My MCP Server") -@mcp.tool +@mcp.tool() def greet(name: str) -> str: return f"Hello, {name}!" @@ -75,7 +75,7 @@ from fastmcp import FastMCP, Client mcp = FastMCP("My MCP Server") -@mcp.tool +@mcp.tool() def greet(name: str) -> str: return f"Hello, {name}!" From 4e7a916b6d344267109266204159dbb6b72623d9 Mon Sep 17 00:00:00 2001 From: Tim Kellogg Date: Fri, 18 Apr 2025 08:15:40 -0400 Subject: [PATCH 2/2] Added note on how stderr is handled in clients --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a27c58fa5..03748d3f8 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ FastMCP handles the complex protocol details and server management, letting you - [Proxy Servers](#proxy-servers) - [Composing MCP Servers](#composing-mcp-servers) - [OpenAPI \& FastAPI Generation](#openapi--fastapi-generation) + - [Handling `stderr`](#handling-stderr) - [Running Your Server](#running-your-server) - [Development Mode (Recommended for Building \& Testing)](#development-mode-recommended-for-building--testing) - [Claude Desktop Integration (For Regular Use)](#claude-desktop-integration-for-regular-use) @@ -666,6 +667,12 @@ mcp_server = FastMCP.from_openapi(openapi_spec, client=http_client) if __name__ == "__main__": mcp_server.run() ``` + +### Handling `stderr` +The MCP spec allows for the server to write anything it wants to `stderr`, and it +doesn't specify the format in any way. FastMCP will forward the server's `stderr` +to the client's `stderr`. + ## Running Your Server Choose the method that best suits your needs: