FastMCP Demo Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastMCP Demo ServerWhat is 12 times 8?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 numbersmultiplyā 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 FunctionsFor 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)
ā 302. multiply
Multiplies two numbers.
multiply(a, b)Example:
multiply(10, 20)
ā 200āļø Requirements
Python
FastMCP
An MCP-compatible client such as Claude Desktop
š¦ Installation
Clone the repository:
git clone https://github.com/safayet9009/fastmcp-demo-server.gitGo to the project directory:
cd fastmcp-demo-serverInstall the project dependencies:
uv syncā¶ļø Run the Server
Run the MCP server with:
uv run fastmcp run main.py:mcpThe 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:mcpThis 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
multiplyYou 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
stdiotransport 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 toolsadd_numbersAdd NumbersB
Add two numbers together.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden, and it discloses nothing explicit (number type, precision, overflow, error handling). However, the operation is a pure, side-effect-free computation implied by its name, so there is little destructive behavior to warn about.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single short sentence that is front-loaded and wastes nothing. There is no filler, hedging, or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained, and the two parameters are self-describing. The description is sufficient for calling a trivial arithmetic tool, with the only gap being numeric type/precision expectations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the parameters are named a and b and addition is order-independent, so semantics are self-evident. The description's "two numbers" confirms arity but adds no type or format detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
"Add two numbers together" states a specific verb and resource, and the operation is unambiguous even though it largely restates the tool name. No sibling differentiation is present, but the sibling (roll_dice) is unrelated, so the risk of confusion is near zero.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no when-to-use guidance and no mention of alternatives. For a trivial arithmetic helper this is low-stakes, but the description provides no routing signal at all.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
roll_diceRoll DiceA
Roll n_dice 6-sided dice and return the results.
| Name | Required | Description | Default |
|---|---|---|---|
| n_dice | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the disclosure burden. It does reveal the die type (6-sided) and that results are returned, but says nothing about randomness/non-determinism, value range (1-6), or any upper bound on n_dice.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One front-loaded sentence with zero filler; the action and scope come before any qualifying detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return formatting need not be described, and the description covers purpose and the sole parameter. Only minor gaps remain (default value, dice-count limits).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate, and it does implicitly define n_dice as the number of dice to roll. It omits the default of 1 and any valid range, though the core semantics of the single parameter are conveyed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (roll) plus resource (dice) and scope (6-sided, count n_dice), so the agent knows exactly what happens. It does not need to differentiate from add_numbers since the domains are unrelated, but it also makes no explicit sibling contrast.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied rather than stated: nothing tells the agent when to prefer this over alternatives or any preconditions, but for a trivial RNG utility the intent ('need random dice') is self-evident from the sentence.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
add_numbers - First observed
roll_dice
TDQS
Scored across 2 tools
roll_dice and add_numbers target completely different operations with no overlap; an agent can easily tell them apart.
Both names follow a consistent snake_case verb_noun pattern (roll_dice, add_numbers), making the convention predictable.
Two tools is borderline thin even for a demo server; while each is distinct, the set lacks enough surface to demonstrate a coherent toolkit.
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
Related MCP Connectors
AI-callable calculators and engineering models with real formulas. No hallucinated math.
Context and control for any AI. Agent identity, scoped access, and proof across tools.
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables 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.51MIT
- AlicenseNot gradedqualityDmaintenanceProvides basic arithmetic operations (add, multiply, divide) for AI assistants through the Model Context Protocol.ISC
- AlicenseNot gradedqualityDmaintenanceEnables users to perform mathematical calculations through natural language by integrating an AI model with calculator tools via the Model Context Protocol.25 npmMIT
- AlicenseNot gradedqualityCmaintenanceExposes add, subtract, multiply, and divide tools for performing arithmetic operations over stdio via the Model Context Protocol.17 npmMIT