From 3ce613b43a40ff189ac52d02c23c37e9c132f797 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:00:53 -0400 Subject: [PATCH] Add CLAUDE.md with FastMCP development guidelines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Establishes preference for in-memory transport when testing/investigating FastMCP servers, and recommends StreamableHttp over SSE for HTTP transport needs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CLAUDE.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..24f9846b1 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,30 @@ +# FastMCP Development Guidelines + +## Testing and Investigation + +### In-Memory Transport - Always Preferred + +When testing or investigating FastMCP servers, **always prefer the in-memory transport** unless you specifically need HTTP transport features. Pass a FastMCP server directly to a Client to eliminate separate processes and network complexity. + +```python +# Create your FastMCP server +mcp = FastMCP("TestServer") + +@mcp.tool +def greet(name: str) -> str: + return f"Hello, {name}!" + +# Pass server directly to client - uses in-memory transport +async with Client(mcp) as client: + result = await client.call_tool("greet", {"name": "World"}) +``` + +### When to Use HTTP Transport + +Only use HTTP transport when testing network-specific features. Prefer StreamableHttp over SSE as it's the modern approach. + +```python +# Only when network testing is required +async with Client(transport=StreamableHttpTransport(server_url)) as client: + result = await client.ping() +``` \ No newline at end of file