LangGraph FastAPI MCP Server
Can be configured as a persistent store for durable chat histories, replacing the default SQLite checkpointer.
Used as the ORM to interact with databases, providing async session management for tool execution.
Provides CRUD operations on a SQLite database using SQLAlchemy, enabling data management through MCP tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LangGraph FastAPI MCP Servershow me the list of users"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LangGraph FastAPI MCP Server & Agent Platform
A robust, enterprise-grade integration framework that combines LangGraph (agentic workflows) with FastAPI MCP Servers (Model Context Protocol). This architecture enables LLM-powered agents to communicate securely and dynamically with downstream microservices via Server-Sent Events (SSE) transport.

Technology Stack
FastAPI: A modern, high-performance web framework for building APIs with Python 3.11+.
FastAPI-MCP: An open-source library that exposes FastAPI endpoints as Model Context Protocol (MCP) tools.
MCP (Model Context Protocol): An open standard that facilitates seamless interaction between LLMs and external data/tools.
LangChain: An open-source framework for building applications powered by large language models.
LangGraph: A framework for building stateful, multi-actor applications with LLMs, ideal for agentic loops.
Gradio: An open-source library used to build the high-fidelity web chat interface.
LangSmith: An observability platform for tracing, debugging, and monitoring LLM applications.
uv: An extremely fast Python package manager and resolver.
Related MCP server: Enterprise MCP Gateway and Tool Registry
📊 System Architecture
The diagram below details the integration between the chatbot agent UI, the LangGraph orchestration engine, the MCP client gateway, and the FastAPI service backend.
graph TD
User([User / Operator]) <-->|Chat Interface| Gradio[Gradio Web UI]
Gradio <-->|Interacts with| LangGraphAgent[LangGraph ReAct Agent]
LangGraphAgent <-->|Invokes Tools via| MCPClient[MCP Multi-Server Client]
MCPClient <-->|SSE Transport| FastAPIMCP[FastAPI MCP Server]
FastAPIMCP <-->|Resolves Routes| APIRoutes[FastAPI Endpoints]
APIRoutes <-->|CRUD Operations| SQLASession[SQLAlchemy AsyncSession]
SQLASession <-->|Reads/Writes| SQLite[(SQLite Database)]🚀 Getting Started
1. Installation
Ensure you have uv installed.
Clone the repository and install all dependencies:
git clone https://github.com/gilish-tech/ai-shopping-assistant-mcp-server.git
cd ai-shopping-assistant-mcp-server
uv sync2. Environment Configuration
Create a .env file in the project root:
# OpenAI Configuration
OPENAI_API_KEY=your-openai-api-key-here
# Optional: LangSmith Tracing & Observability
LANGCHAIN_TRACING_V2=true
LANGCHAIN_ENDPOINT=https://api.smith.langchain.com
LANGCHAIN_API_KEY=your-langsmith-api-key-here
LANGCHAIN_PROJECT=langgraph-fastapi-mcp-server3. Start the FastAPI MCP Service
Launch the FastAPI server which auto-exposes its routes as MCP tools:
uv run uvicorn server.main:app --host 0.0.0.0 --port 8000 --reloadInteractive Swagger Docs: http://localhost:8000/docs
MCP Endpoint: http://localhost:8000/mcp
4. Start the Agent Client
Launch the Gradio chat interface to interact with the LangGraph agent:
uv run chatbot.pyChat Web UI: http://localhost:7860
🛠️ Production Readiness & Deployment
To move this system into a production environment, follow these best practices:
Database Migrations: Apply changes to the schema using Alembic:
uv run alembic upgrade headProduction Web Server: Run the FastAPI application using
uvicornwith multiple workers or behind a reverse proxy (e.g., Nginx).Security and Auth: Implement auth middleware in FastAPI and pass tokens through the SSE connection headers for tool execution control.
Persistent Memory: Replace the default in-memory SQLite checkpointer in LangGraph with a persistent store (e.g., PostgreSQL Checkpointer) for durable chat histories.
📄 License
Distributed under the MIT License. See LICENSE for details.
Maintained by gilbert (@gilish-tech).
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
LLM Orchestration Agent (Mcp)
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceExposes FastAPI endpoints as Model Context Protocol (MCP) tools while preserving existing authentication, schemas, and documentation. It enables seamless integration of FastAPI services into MCP ecosystems using a native ASGI transport layer.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to discover and execute tools via a secure MCP server with JWT authentication, RBAC, rate limiting, and audit logging.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to access a unified catalog of tools from various APIs (OpenAPI, GraphQL, MCP, Google Discovery) through the MCP protocol.MIT
- FlicenseNot gradedqualityCmaintenanceEnables an LLM to dynamically discover and call tools across multiple MCP servers (file, GitHub, SQL, Python execution) with authentication, rate limiting, and observability, supporting parallel execution and secure deployment.-