Uses FastAPI to create an MCP server that exposes the Northwind database through both a REST API and an MCP endpoint, allowing queries for product data and other Northwind dataset information.
🚀 Northwind FastAPI MCP Example
This project demonstrates how to use fastapi-mcp to create a Model Context Protocol (MCP) server that allows Large Language Models (LLMs) to connect and interact with a REST API.
📋 Overview
The Northwind API is a simple example that shows how to expose data from the classic Northwind database through both a traditional REST API and an MCP endpoint, making it accessible for LLMs to query and understand.
🏁 Getting Started
Prerequisites
- Python 3.10+ 🐍
- Virtual environment tool 🔧
Installation
- Clone the repository and install dependencies:
- Run the application:
- Access the API documentation at
http://localhost:8000/api/v1/docs
📝
🔌 Available Endpoints
REST API Endpoints
GET /api/v1/products
: List all products 📦
MCP Endpoint
http://localhost:8000/mcp
: Model Context Protocol endpoint for LLM connections 🤖
🔗 Connecting an LLM to the API
This example demonstrates how fastapi-mcp creates a bridge between your REST API and Large Language Models:
- Traditional REST endpoints serve structured data at
/api/v1/products*
📊 - The MCP endpoint at
/mcp
allows LLMs to discover and interact with your API programmatically 🧠 - LLMs can understand your data schema and execute appropriate API calls automatically. ✨
This server cannot be installed
A Model Context Protocol (MCP) server that enables Large Language Models to interact with and query the classic Northwind database through a REST API.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.Last updated -34075TypeScriptMIT License
- -securityAlicense-qualityA high-performance FastAPI server supporting Model Context Protocol (MCP) for seamless integration with Large Language Models, featuring REST, GraphQL, and WebSocket APIs, along with real-time monitoring and vector search capabilities.Last updated -5PythonMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) compliant server that allows Large Language Models (LLMs) to search and retrieve content from microCMS APIs.Last updated -TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases, allowing them to query collections, inspect schemas, and manage data seamlessly through natural language.Last updated -340MIT License