Skip to content

Building AI agents, atomically

atomic examples readme update for fastapi client

jon fox3978f484cd5e
diff --git a/atomic-examples/mcp-agent/README.md b/atomic-examples/mcp-agent/README.md
index 061c468..694eb15 100644
--- a/atomic-examples/mcp-agent/README.md
+++ b/atomic-examples/mcp-agent/README.md
@@ -14,9 +14,11 @@ An interactive agent that:
- Dynamically discovers available tools
- Processes natural language queries
- Selects appropriate tools based on user intent
-- Executes tools with extracted parameters
+- Executes tools with extracted parameters (sync and async)
- Provides responses in a conversational format
+The client includes both synchronous (`main.py`) and asynchronous (`main_fastapi.py`) implementations. The FastAPI version demonstrates async MCP tool execution using `fetch_mcp_tools_async()` and the `arun()` method for non-blocking tool execution in web applications.
+
[View Example Client README](example-client/README.md)
### 2. Example MCP Server (`example-mcp-server/`)
@@ -110,6 +112,19 @@ This example shows the flexibility of the MCP architecture with two distinct tra
poetry run python -m example_client.main --transport http_stream
```
+ **Using FastAPI async client:**
+
+ ```bash
+ # First terminal: Start the MCP server
+ cd example-mcp-server
+ poetry run python -m example_mcp_server.server --mode=http_stream
+
+ # Second terminal: Run the async FastAPI client
+ cd example-client
+ poetry run python -m example_client.main_fastapi
+ # Then visit http://localhost:8000 for the API interface
+ ```
+
**Note:** When using SSE or HTTP Stream transport, make sure the server is running before starting the client. The server runs on port 6969 by default.
## Example Queries