Skip to main content
Glama
FastMCP Demo Server

FastMCP Demo Server

by safayet9009

FastMCP Demo Server

A beginner-friendly Model Context Protocol (MCP) server built with FastMCP. This project demonstrates how to create custom MCP tools and connect them to AI clients such as Claude Desktop.

๐Ÿš€ Features

This server currently provides two simple MCP tools:

  • add โ€” Adds two numbers

  • multiply โ€” Multiplies two numbers

The project is designed as a simple starting point for learning how MCP servers work.

Related MCP server: Calculator MCP Server

๐Ÿง  How It Works

The basic architecture is:

User
  โ†“
AI Client (Claude Desktop)
  โ†“
MCP Protocol
  โ†“
FastMCP Server
  โ†“
Custom Tools
  โ†“
Python Functions

For example, when Claude needs to calculate 10 + 20, it can call the add MCP tool:

Claude
  โ†“
add(10, 20)
  โ†“
FastMCP Server
  โ†“
Python function
  โ†“
30

๐Ÿ“ Project Structure

fastmcp-demo-server/
โ”‚
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ uv.lock
โ”œโ”€โ”€ .python-version
โ””โ”€โ”€ .gitignore

๐Ÿ› ๏ธ Tools

1. add

Adds two numbers.

add(a, b)

Example:

add(10, 20)
โ†’ 30

2. multiply

Multiplies two numbers.

multiply(a, b)

Example:

multiply(10, 20)
โ†’ 200

โš™๏ธ Requirements

  • Python

  • uv

  • FastMCP

  • An MCP-compatible client such as Claude Desktop

๐Ÿ“ฆ Installation

Clone the repository:

git clone https://github.com/safayet9009/fastmcp-demo-server.git

Go to the project directory:

cd fastmcp-demo-server

Install the project dependencies:

uv sync

โ–ถ๏ธ Run the Server

Run the MCP server with:

uv run fastmcp run main.py:mcp

The server uses stdio transport, so it can communicate directly with MCP clients such as Claude Desktop.

๐Ÿ” Test with FastMCP Inspector

You can also inspect and test the server using FastMCP's development tools:

uv run fastmcp dev inspector main.py:mcp

This allows you to explore the available MCP tools and test them interactively.

๐Ÿค– Connect with Claude Desktop

Add the following configuration to your Claude Desktop MCP configuration:

{
  "mcpServers": {
    "Demo Server": {
      "command": "/home/shafayet/.local/bin/uv",
      "args": [
        "run",
        "--directory",
        "/home/shafayet/Desktop/fastmcp-demo-server",
        "fastmcp",
        "run",
        "main.py:mcp"
      ],
      "env": {},
      "transport": "stdio"
    }
  }
}

Note: Update the paths according to your own system.

After adding the configuration, restart Claude Desktop.

Claude should then be able to discover the available tools:

add
multiply

You can test it by asking Claude:

Use the add tool to calculate 25 + 75.

or:

Use the multiply tool to calculate 12 ร— 8.

๐ŸŽฏ Learning Goals

This project helps demonstrate:

  • What an MCP server is

  • How FastMCP works

  • How to create MCP tools

  • How MCP clients discover and call tools

  • How Python functions can become MCP tools

  • How to connect a custom MCP server with Claude Desktop

  • How stdio transport works

๐Ÿ”ฎ Future Improvements

Possible future additions include:

  • Weather tool

  • Calculator tool

  • Web search tool

  • Database tools

  • File management tools

  • API integration

  • Custom AI-powered tools

  • Resources and prompts

  • Authentication

  • More advanced MCP workflows

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

Safayet Hossain

GitHub: @safayet9009


โญ If you find this project useful for learning MCP, consider giving it a star!

Available Tools

2 tools
add_numbersAdd NumbersB

Add two numbers together.

Inputs: a (required), b (required). Returns: result

roll_diceRoll DiceA

Roll n_dice 6-sided dice and return the results.

Inputs: n_dice. Returns: result

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    TDQS

    A3.6/5.0

    Scored across 2 tools

    Disambiguation5/5

    roll_dice and add_numbers target completely different operations with no overlap; an agent can easily tell them apart.

    Naming Consistency5/5

    Both names follow a consistent snake_case verb_noun pattern (roll_dice, add_numbers), making the convention predictable.

    Tool Count3/5

    Two tools is borderline thin even for a demo server; while each is distinct, the set lacks enough surface to demonstrate a coherent toolkit.

    Completeness3/5

    There is no clear domain, so completeness is hard to assess; each tool is self-contained but the surface is minimal and offers no lifecycle or related operations.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables basic arithmetic operations (addition, subtraction, multiplication, division) with 64-bit precision and matrix multiplication capabilities. Provides mathematical computation tools for AI assistants through the Model Context Protocol.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides basic arithmetic operations (add, multiply, divide) for AI assistants through the Model Context Protocol.
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables users to perform mathematical calculations through natural language by integrating an AI model with calculator tools via the Model Context Protocol.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes add, subtract, multiply, and divide tools for performing arithmetic operations over stdio via the Model Context Protocol.
      ISC