FastAPI MCP LangGraph Template

v1.0.0Coding Agentsstable

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

composefastapigrafanalangfuselanggraph-python
Share:
546
Stars
0
Downloads
0
Weekly
0/5

What is FastAPI MCP LangGraph Template?

FastAPI MCP LangGraph Template is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to modern template for agentic orchestration — built for rapid iteration and scalable deployment using highly customizable, community-supported tools like mcp, langgraph, and more.

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

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A modern template for agentic orchestration — built for rapi

Use Cases

Agentic orchestration template
Rapid iteration and scalable deployment
FastAPI with monitoring
NicholasGoh

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx fastapi-mcp-langgraph-template

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use FastAPI MCP LangGraph Template

The FastAPI MCP LangGraph Template is a production-ready project scaffold for building agentic AI applications using FastAPI, LangGraph, and the Model Context Protocol. It bundles a complete observability stack (LangFuse, Prometheus, Grafana), PostgreSQL with PGVector for relational and vector storage, Nginx for reverse proxying, and Docker Compose for both local development and production deployment. Engineering teams use it to accelerate the setup of AI orchestration backends, avoiding boilerplate configuration for streaming, persistent agent state, multi-tool routing, and LLM metrics tracking.

Prerequisites

  • Docker and Docker Compose installed
  • An OpenAI API key (OPENAI_API_KEY)
  • A PostgreSQL connection string (POSTGRES_DSN)
  • LangFuse account and keys (LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST)
  • Git to clone the repository
1

Clone the repository

Clone the template repository to your local machine to get all Docker Compose files, environment templates, and documentation.

git clone https://github.com/NicholasGoh/fastapi-mcp-langgraph-template
cd fastapi-mcp-langgraph-template
2

Copy and populate environment files

Copy the sample environment file and fill in required values for OpenAI, PostgreSQL, LangFuse, and other integrations. Environment files for individual services live in the ./envs/ directory.

cp .env.sample .env
# Edit .env and ./envs/backend.env with your keys
3

Set environment variables for the shell

Source all environment files so Docker Compose can interpolate them correctly during the build.

set -a; for env_file in ./envs/*; do source $env_file; done; set +a
4

Build and start the production stack

Build all service images and start the full stack including the FastAPI backend, Nginx, PostgreSQL, and the observability services.

docker compose up -d

# Or for the development stack with hot-reload
docker compose -f compose-dev.yaml up -d
5

Verify the services

Once containers are running, verify the API is available and check the auto-generated FastAPI docs.

# API docs
curl http://localhost:8000/docs

# Check service status
docker compose ps
6

Build the YouTube community MCP image (optional)

The template includes a community-contributed YouTube MCP integration. Build and configure it if you need YouTube data access in your agents.

./community/youtube/build.sh

FastAPI MCP LangGraph Template Examples

Client configuration

Example MCP client configuration pointing to the FastAPI backend running locally via Docker Compose.

{
  "mcpServers": {
    "fastapi-mcp-langgraph": {
      "command": "npx",
      "args": ["fastapi-mcp-langgraph-template"],
      "env": {
        "OPENAI_API_KEY": "sk-...",
        "POSTGRES_DSN": "postgresql://user:pass@localhost:5432/agentdb",
        "LANGFUSE_PUBLIC_KEY": "pk-lf-...",
        "LANGFUSE_SECRET_KEY": "sk-lf-...",
        "LANGFUSE_HOST": "https://cloud.langfuse.com"
      }
    }
  }
}

Prompts to try

Example interactions for an agentic application built on this template.

- "Run the LangGraph agent to summarize the latest YouTube video from this channel"
- "Query the PostgreSQL database for all users created in the last 7 days"
- "Show me the LLM token usage metrics from the Grafana dashboard"
- "Trigger the agent orchestration workflow and stream the intermediate steps"
- "What tools does the agent have available and how are they routed?"

Troubleshooting FastAPI MCP LangGraph Template

Docker Compose build fails with missing environment variables

Ensure you have run `cp .env.sample .env` and populated all required keys (OPENAI_API_KEY, POSTGRES_DSN, LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST). Then re-source the env files with `set -a; for env_file in ./envs/*; do source $env_file; done; set +a`.

Nginx returns 502 Bad Gateway after startup

The FastAPI backend may still be initializing. Wait 10-15 seconds for the container health checks to pass, then reload Nginx with `docker compose -f compose-dev.yaml exec nginx sh -c 'nginx -s reload'`.

LangFuse observability data not appearing in the dashboard

Verify that LANGFUSE_HOST is set to your actual LangFuse endpoint (e.g., https://cloud.langfuse.com) and that both LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY match an active project in your LangFuse account.

Frequently Asked Questions about FastAPI MCP LangGraph Template

What is FastAPI MCP LangGraph Template?

FastAPI MCP LangGraph Template is a Model Context Protocol (MCP) server that modern template for agentic orchestration — built for rapid iteration and scalable deployment using highly customizable, community-supported tools like mcp, langgraph, and more. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install FastAPI MCP LangGraph Template?

Follow the installation instructions on the FastAPI MCP LangGraph Template GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with FastAPI MCP LangGraph Template?

FastAPI MCP LangGraph Template works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is FastAPI MCP LangGraph Template free to use?

Yes, FastAPI MCP LangGraph Template is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "fastapi-mcp-langgraph-template": { "command": "npx", "args": ["-y", "fastapi-mcp-langgraph-template"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use FastAPI MCP LangGraph Template?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides