Skip to content

Commit ecd7c15

Browse files
committed
docs: Mermaid diagram
1 parent ecf9c11 commit ecd7c15

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,67 @@ This project aims to teach:
3636

3737
![Logfire UI](docs/images/logfire_ui.png)
3838

39+
## MCP Architecture
40+
41+
```mermaid
42+
graph LR
43+
User((User)) --> |"Run script<br>(e.g., pydantic_mcp.py)"| Agent
44+
45+
subgraph "Agent Frameworks"
46+
Agent[Agent]
47+
ADK["Google ADK<br>(adk_mcp.py)"]
48+
LG["LangGraph<br>(langgraph_mcp.py)"]
49+
OAI["OpenAI Agents<br>(oai-agent_mcp.py)"]
50+
PYD["Pydantic-AI<br>(pydantic_mcp.py)"]
51+
52+
Agent --> ADK
53+
Agent --> LG
54+
Agent --> OAI
55+
Agent --> PYD
56+
end
57+
58+
subgraph "MCP Server"
59+
MCP["Model Context Protocol Server<br>(run_server.py)"]
60+
Tools["Tools<br>- add(a, b)<br>- get_current_time()"]
61+
Resources["Resources<br>- greeting://{name}"]
62+
MCP --- Tools
63+
MCP --- Resources
64+
end
65+
66+
subgraph "LLM Providers"
67+
OAI_LLM["OpenAI Models"]
68+
GEM["Google Gemini Models"]
69+
OTHER["Other LLM Providers..."]
70+
end
71+
72+
Logfire[("Logfire<br>Tracing")]
73+
74+
ADK --> MCP
75+
LG --> MCP
76+
OAI --> MCP
77+
PYD --> MCP
78+
79+
MCP --> OAI_LLM
80+
MCP --> GEM
81+
MCP --> OTHER
82+
83+
ADK --> Logfire
84+
LG --> Logfire
85+
OAI --> Logfire
86+
PYD --> Logfire
87+
88+
LLM_Response[("Response")] --> User
89+
OAI_LLM --> LLM_Response
90+
GEM --> LLM_Response
91+
OTHER --> LLM_Response
92+
93+
style MCP fill:#f9f,stroke:#333,stroke-width:2px
94+
style User fill:#bbf,stroke:#338,stroke-width:2px
95+
style Logfire fill:#bfb,stroke:#383,stroke-width:2px
96+
style LLM_Response fill:#fbb,stroke:#833,stroke-width:2px
97+
```
98+
99+
The diagram illustrates how MCP serves as a standardised interface between different agent frameworks and LLM providers.The flow shows how users interact with the system by running a specific agent script, which then leverages MCP to communicate with LLM providers, while Logfire provides tracing and observability.
39100

40101
## Repository Structure
41102

0 commit comments

Comments
 (0)