Skip to content

Commit 7197360

Browse files
authored
Merge pull request #10 from NicholasGoh/feat/revamp-fastapi-mcp-langgraph-template-docs
Feat/revamp fastapi mcp langgraph template docs
2 parents 14c1005 + 3d430be commit 7197360

File tree

12 files changed

+193
-8
lines changed

12 files changed

+193
-8
lines changed

docs/getting-started/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"position": 2,
44
"link": {
55
"type": "generated-index",
6-
"description": "5 minutes to learn the most important Docusaurus concepts."
6+
"description": "Check out more about the template or jump to the quick start to get it set up and give it a try!"
77
}
88
}

docs/getting-started/architecture.mdx

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Architecture
6+
7+
This section outlines the architecture of the services, their interactions, and planned features.
8+
9+
## Inspector
10+
11+
Inspector communicates via SSE protocol with each MCP Server, while each server adheres to MCP specification.
12+
13+
```mermaid
14+
graph LR
15+
16+
subgraph localhost
17+
A[Inspector]
18+
B[DBHub Server]
19+
C[Youtube Server]
20+
D[Custom Server]
21+
end
22+
23+
subgraph Supabase Cloud
24+
E[Supabase DB]
25+
end
26+
27+
subgraph Google Cloud
28+
F[Youtube API]
29+
end
30+
31+
A<-->|Protocol|B
32+
A<-->|Protocol|C
33+
A<-->|Protocol|D
34+
B<-->E
35+
C<-->F
36+
```
37+
38+
## Template Setup
39+
40+
The current template does not connect to all MCP servers. Additionally, the API server communicates with the database using a SQL ORM.
41+
42+
```mermaid
43+
graph LR
44+
45+
subgraph localhost
46+
A[API Server]
47+
B[DBHub Server]
48+
C[Youtube Server]
49+
D[Custom Server]
50+
end
51+
52+
subgraph Supabase Cloud
53+
E[Supabase DB]
54+
end
55+
56+
A<-->|Protocol|D
57+
A<-->E
58+
```
59+
60+
## Reverse Proxy
61+
62+
Can be extended for other services like Frontend and/or certain backend services self-hosted instead of on cloud (e.g., Langfuse).
63+
64+
```mermaid
65+
graph LR
66+
A[Web Browser]
67+
68+
subgraph localhost
69+
B[Nginx Reverse Proxy]
70+
C[API Server]
71+
end
72+
73+
A-->B
74+
B-->C
75+
```
76+
77+
## Planned Features
78+
79+
### Monitoring and Observability
80+
81+
```mermaid
82+
graph LR
83+
84+
subgraph localhost
85+
A[API Server]
86+
end
87+
88+
subgraph Grafana Cloud
89+
B[Grafana]
90+
end
91+
92+
subgraph Langfuse Cloud
93+
C[Langfuse]
94+
end
95+
96+
A -->|Metrics & Logs| B
97+
A -->|Traces & Events| C
98+
```
99+
100+
### Authentication and Authorization
101+
102+
![Auth0 Diagram](https://images.ctfassets.net/cdy7uua7fh8z/7mWk9No612EefC8uBidCqr/821eb60b0aa953b0d8e4afe897228844/Auth-code-flow-diagram.png)
103+
104+
[Auth0 Source](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
sidebar_position: 7
3+
---
4+
5+
# Grafana Stack
6+
7+
> By configuring the OpenAI Integration, users can gain valuable insights into token usage rates, response times, and overall costs. This integration empowers users to make data-driven decisions while ensuring optimal utilization of OpenAI APIs.
8+
9+
Learn more [here](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/integrations/integration-reference/integration-openai/)
10+
11+
[![Grafana](https://img.shields.io/github/stars/prometheus/prometheus?logo=grafana&label=Grafana)](https://github.com/grafana/grafana)

docs/getting-started/langfuse.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Langfuse
6+
7+
> Traces, evals, prompt management and metrics to debug and improve your LLM application.
8+
9+
Learn more [here](https://langfuse.com/)
10+
11+
[![LangFuse](https://img.shields.io/github/stars/langfuse/langfuse?logo=langfuse&label=LangFuse)](https://github.com/langfuse/langfuse)

docs/getting-started/langgraph.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# LangGraph
6+
7+
> Gain control with LangGraph to design agents that reliably handle complex tasks.
8+
9+
Learn more [here](https://www.langchain.com/langgraph)
10+
11+
[![LangGraph](https://img.shields.io/github/stars/langchain-ai/langgraph?logo=langgraph&label=LangGraph)](https://github.com/langchain-ai/langgraph)
12+
13+
## Streaming
14+
15+
At its core, a compiled LangGraph is a [Runnable](https://github.com/langchain-ai/langchain/blob/langchain%3D%3D0.3.6/libs/core/langchain_core/runnables/base.py#L108). This template utilizes LangChain’s built-in streaming support through [`astream_events`](https://python.langchain.com/docs/how_to/streaming/#using-stream-events), granting programmatic access to every stage of the Agentic Workflow. You can observe and interact with key components—LLM, prompt, and tool—throughout their full execution lifecycle: start, stream, and end. For a comprehensive list of event types and usage examples, refer to the [Event Reference](https://python.langchain.com/docs/how_to/streaming/#event-reference).
16+
17+
## Persistence
18+
19+
LangGraph offers built-in state management and persistence via the [AsyncPostgresSaver](https://github.com/langchain-ai/langgraph/blob/0.2.39/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py#L39), enabling faster iteration on agentic workflows. Since LLMs are inherently stateless, chat history must typically be injected as context for each query—but LangGraph abstracts this away, requiring only a `thread_id`. It seamlessly handles chat history and metadata serialization/deserialization, simplifying development. Learn more about its advanced persistence capabilities [here](https://langchain-ai.github.io/langgraph/concepts/persistence/).

docs/getting-started/model-context-protocol.mdx

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
---
2-
sidebar_position: 2
2+
sidebar_position: 3
33
---
44

55
import ReactPlayer from 'react-player'
66

77
# Model Context Protocol
88

9-
[![MCP Client](https://img.shields.io/github/stars/modelcontextprotocol/python-sdk?logo=modelcontextprotocol&label=MCP-Client)](https://github.com/modelcontextprotocol/python-sdk) [![MCP Server](https://img.shields.io/github/stars/modelcontextprotocol/servers?logo=modelcontextprotocol&label=MCP-Servers)](https://github.com/modelcontextprotocol/servers)
10-
119
:::info
1210

1311
> MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.
@@ -16,6 +14,8 @@ import ReactPlayer from 'react-player'
1614

1715
Learn more [here](https://modelcontextprotocol.io/introduction).
1816

17+
[![MCP Client](https://img.shields.io/github/stars/modelcontextprotocol/python-sdk?logo=modelcontextprotocol&label=MCP-Client)](https://github.com/modelcontextprotocol/python-sdk) [![MCP Server](https://img.shields.io/github/stars/modelcontextprotocol/servers?logo=modelcontextprotocol&label=MCP-Servers)](https://github.com/modelcontextprotocol/servers)
18+
1919
## Video Demo
2020

2121
<ReactPlayer playing controls url='/vid/fastapi-mcp-langgraph-template/mcps.mp4' />
@@ -43,6 +43,8 @@ Explore the following tabs in the Top Navbar:
4343
- `Prompts`
4444
- `Tools`
4545

46+
See demo videos to learn more.
47+
4648
## Community MCP Servers
4749

4850
Before building your own custom MCP servers, explore the growing list of hundreds of [community MCP servers](https://github.com/modelcontextprotocol/servers). With integrations spanning databases, cloud services, and web resources, the perfect fit might already exist.
@@ -54,14 +56,34 @@ Learn more [here](https://github.com/bytebase/dbhub). Explore more in [Inspector
5456
Easily plug in this MCP into LLM to allow LLM to:
5557

5658
- Perform read-only SQL query validation for secure operations
59+
60+
<ReactPlayer playing controls url='/vid/fastapi-mcp-langgraph-template/dbhub/execute-sql.mp4' />
61+
62+
<br />
63+
5764
- Enable deterministic introspection of DB
5865
- List schemas
5966
- List tables in schemas
6067
- Retrieve table structures
68+
69+
<ReactPlayer playing controls url='/vid/fastapi-mcp-langgraph-template/dbhub/schemas.mp4' />
70+
71+
<br />
72+
6173
- Enrich user queries deterministically
6274
- Ground DB related queries with DB schemas
6375
- Provide SQL templates for translating natural language to SQL
6476

77+
<ReactPlayer playing controls url='/vid/fastapi-mcp-langgraph-template/dbhub/explain-db.mp4' />
78+
79+
<br />
80+
81+
:::info
82+
83+
Demos only show some features; all features are not shown exhaustively in the videos
84+
85+
:::
86+
6587
### Youtube
6688

6789
Learn more [here](https://github.com/Klavis-AI/klavis/tree/main/mcp_servers/youtube). Explore more in [Inspector](#inspector).
@@ -77,6 +99,8 @@ Simply plug in this MCP to enable LLM to:
7799

78100
- Fetch transcripts from any YouTube URL on demand
79101

102+
Check out the [demo video](#video-demo) at the top.
103+
80104
## Custom MCP
81105

82106
Should you require a custom MCP server, a template is provided [here](https://github.com/NicholasGoh/fastapi-mcp-langgraph-template/blob/main/backend/shared_mcp/tools.py) for you to reference in development.
@@ -103,3 +127,5 @@ def get_greeting(name: str) -> str:
103127
"""Get a personalized greeting"""
104128
return f"Hello, {name}!"
105129
```
130+
131+
Check out the [demo video](#video-demo) at the top.

docs/getting-started/quick-start.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 2
33
---
44

55
import ReactPlayer from 'react-player'
66

77
# Quick Start
88

9+
Setup to run the repository in both production and development environments.
10+
911
Build community youtube MCP image with:
1012

1113
```bash

docs/getting-started/supabase.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
sidebar_position: 3
2+
sidebar_position: 5
33
---
44

55
import ReactPlayer from 'react-player'
66

77
# Supabase
88

9+
Demo on getting `POSTGRES_DSN` with Supabase’s free database, auth, and APIs.
10+
911
[![Supabase](https://img.shields.io/github/stars/supabase/supabase?logo=supabase&label=Supabase)](https://github.com/supabase/supabase)
1012

1113
The start of the video shows how you can get your `POSTGRES_DSN` URL.

docs/intro.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Introduction
77

88
A modern template for agentic orchestration — built for rapid iteration and scalable deployment using highly customizable, community-supported tools like MCP, LangGraph, and more.
99

10-
Visit the [Github](https://github.com/NicholasGoh/fastapi-mcp-langgraph-template)
10+
Visit the Github: [![FastAPI MCP LangGraph Template](https://img.shields.io/github/stars/nicholasgoh/fastapi-mcp-langgraph-template?label=FastAPI%20MCP%20LangGraph%20Template)](https://github.com/NicholasGoh/fastapi-mcp-langgraph-template)
1111

1212
## Core Features
1313

@@ -36,8 +36,18 @@ Visit the [Github](https://github.com/NicholasGoh/fastapi-mcp-langgraph-template
3636
- [![LangFuse](https://img.shields.io/github/stars/langfuse/langfuse?logo=langfuse&label=LangFuse)](https://github.com/langfuse/langfuse) for LLM Observability and LLM Metrics
3737
- [![Prometheus](https://img.shields.io/github/stars/prometheus/prometheus?logo=prometheus&label=Prometheus)](https://github.com/prometheus/prometheus) for scraping Metrics
3838
- [![Grafana](https://img.shields.io/github/stars/prometheus/prometheus?logo=grafana&label=Grafana)](https://github.com/grafana/grafana) for visualizing Metrics
39-
- [![Auth0](https://img.shields.io/badge/Auth0-white?logo=auth0)](https://auth0.com/docs) SaaS for JWT authentication
39+
- [![Auth0](https://img.shields.io/badge/Auth0-white?logo=auth0)](https://auth0.com/docs) SaaS for Authentication and Authorization with OIDC & JWT via OAuth 2.0
4040
- CI/CD via Github Actions
4141
- :dollar: Deploy live demo to [![Fargate](https://img.shields.io/badge/Fargate-white.svg?logo=awsfargate)](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html)
4242
- Provision with [![Terraform](https://img.shields.io/github/stars/hashicorp/terraform?logo=terraform&label=Terraform)](https://github.com/hashicorp/terraform) IaC
4343
- Push built images to ECR and Dockerhub
44+
45+
[![Star History Chart](https://api.star-history.com/svg?repos=nicholasgoh/fastapi-mcp-langgraph-template&type=Date)](https://www.star-history.com/#nicholasgoh/fastapi-mcp-langgraph-template&Date)
46+
47+
:::info
48+
49+
Click above to view live update on star history as per their [article](https://www.star-history.com/blog/a-message-to-github-star-history-users):
50+
> Ongoing Broken Live Chart
51+
> you can still use this website to view and download charts (though you may need to provide your own token).
52+
53+
:::
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)