Skip to main content
Glama

Northwind FastAPI MCP Example

by RobertoRuben

๐Ÿš€ 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

  1. Clone the repository and install dependencies:

    git clone https://github.com/RobertoRuben/mcp-northwind-fastapi-example.git cd mcp-northwind-fastapi-example python -m venv venv venv\Scripts\activate # On Windows pip install -r requirements.txt
  2. Run the application:

    uvicorn src.main:app --reload
  3. 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:

  1. Traditional REST endpoints serve structured data at /api/v1/products* ๐Ÿ“Š

  2. The MCP endpoint at /mcp allows LLMs to discover and interact with your API programmatically ๐Ÿง 

  3. LLMs can understand your data schema and execute appropriate API calls automatically. โœจ

-
security - not tested
-
license - not tested
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

A Model Context Protocol (MCP) server that enables Large Language Models to interact with and query the classic Northwind database through a REST API.

  1. ๐Ÿ“‹ Overview
    1. ๐Ÿ Getting Started
      1. Prerequisites
      2. Installation
    2. ๐Ÿ”Œ Available Endpoints
      1. REST API Endpoints
      2. MCP Endpoint
    3. ๐Ÿ”— Connecting an LLM to the API

      Related MCP Servers

      • -
        security
        -
        license
        -
        quality
        A 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 -
        109
        169
        MIT License
        • Apple
      • -
        security
        -
        license
        -
        quality
        A 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 -
        9
        MIT License
      • -
        security
        -
        license
        -
        quality
        A Model Context Protocol (MCP) compliant server that allows Large Language Models (LLMs) to search and retrieve content from microCMS APIs.
        Last updated -
        MIT License
      • -
        security
        -
        license
        -
        quality
        A 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.

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/RobertoRuben/mcp-northwind-fastapi-example'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server