Skip to main content
Glama
usefastmcp

usefastmcp

usefastmcp

A simple Model Context Protocol (MCP) server built with FastMCP.

This project demonstrates how to expose custom tools as MCP servers over two different transports — stdio (local, default) and HTTP (remote).


Project Structure

usefastmcp/
├── pyproject.toml            # Project config & dependencies (fastmcp)
├── uv.lock                   # Locked dependency versions
├── .python-version           # Python 3.13
├── servers/
│   ├── stdioserver.py        # MCP server over stdio transport
│   └── httpserver.py         # MCP server over HTTP transport
└── .vscode/
    └── mcp.json              # VS Code Copilot MCP configuration

Related MCP server: mcp-stdio

Requirements

  • Python 3.13+

  • uv package manager


Setup

uv sync

This creates the virtual environment and installs all dependencies (including fastmcp).


Available Tools

Both servers expose the same tools:

Tool

Signature

Description

roll_dice

roll_dice()

Returns a random integer between 1 and 6

add_numbers

add_numbers(first: int, second: int)

Adds two integers and returns the sum


Running the Server

1. Stdio Transport (default)

Runs over standard input/output — ideal for local host applications that launch the process directly.

uv run servers/stdioserver.py

2. HTTP Transport

Runs as an HTTP server on http://127.0.0.1:8000 — useful for remote clients and web-based access.

uv run servers/httpserver.py

Note: The FastMCP CLI (fastmcp run <file>) always forces stdio transport and ignores the transport="http" option in your code. Run uv run servers/httpserver.py directly to use HTTP transport.


VS Code Integration

This project includes .vscode/mcp.json for use with VS Code Copilot. The config launches the stdio server automatically.

  1. Open the project in VS Code

  2. Restart VS Code (or reload the window) so the MCP server is picked up

  3. The roll_dice and add_numbers tools become available to the Copilot agent

VS Code MCP Integration

Available Tools

2 tools
add_numberA

Add 2 numbers and returns result

Inputs: first (required), second (required).

roll_diceA

This method will return number between 1 to 6, when asked to roll a dice.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 2 tools

    Disambiguation5/5

    roll_dice and add_number are completely distinct in purpose and behavior. There is no ambiguity about which tool to select for a given task.

    Naming Consistency5/5

    Both tool names follow a consistent verb_noun pattern: roll_dice and add_number. The naming style is uniform and predictable.

    Tool Count3/5

    With only two tools, the server feels quite thin. While each tool has a basic utility purpose, the set is minimal and barely provides enough surface to be considered a coherent collection.

    Completeness2/5

    There is no clear domain or lifecycle being covered; the tools are unrelated utilities. Obvious complementary operations (e.g., subtract, multiply, or dice with custom sides) are absent, leaving the surface feeling arbitrary and incomplete.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A minimal, zero-dependency MCP server that enables defining and running tools over stdio transport, without extra features like HTTP or resources.
      26 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A minimal MCP server that exposes tools for addition, echoing text, time lookup, and URL fetching, with support for HTTP and stdio transports.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Minimal MCP server allowing Python functions to be served as MCP tools over stdio or HTTP, with a built-in client for connecting to MCP servers.
      124 PyPI
      2
      Apache 2.0