Skip to main content
Glama
Northwind FastAPI MCP Example

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.

Related MCP server: SQL Server MCP

🏁 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. ✨

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.
      -
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants (Cursor, Windsurf, Claude Code) to interact with Microsoft SQL Server databases by providing connectivity through environment-configurable connections.
      8
      601 npm
      8
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP (Model Context Protocol) server that exposes natural language to SQL functionality, allowing any MCP-compatible client to convert plain English questions into SQL queries for database interaction using AI.
      3
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A Model Context Protocol server that enables LLMs like Claude to interact with Microsoft SQL Server databases through natural language, supporting queries, data manipulation, and table management.
      8
      2,101 npm
      MIT