A simple FastMCP project with basic math tools
Project description
FastMCP - Simple Math Tools
A simple Model Context Protocol (MCP) server that provides basic mathematical operations as tools.
Features
- add: Add two numbers together
- minus: Subtract the second number from the first number
Installation
This project uses uv for package management and just for task running. Make sure you have both installed:
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install just if you don't have it
# On macOS with Homebrew:
brew install just
# Or with cargo:
cargo install just
Then build the project:
just build
Usage
Running the MCP Server
To start the FastMCP server:
just run
Using with MCP Clients
You can use this server with any MCP-compatible client. Here's an example configuration for mcp_config.json:
{
"mcpServers": {
"fastmcp": {
"command": "uv",
"args": ["run", "fastmcp"],
"cwd": "/path/to/mcp-agents"
}
}
}
Testing the Tools
Run the test script to verify the tools work correctly:
just test
Available Tools
add
Adds two numbers together.
Parameters:
a(number): First numberb(number): Second number
Example:
{
"name": "add",
"arguments": {
"a": 10,
"b": 5
}
}
minus
Subtracts the second number from the first number.
Parameters:
a(number): Number to subtract fromb(number): Number to subtract
Example:
{
"name": "minus",
"arguments": {
"a": 10,
"b": 3
}
}
Development
Available Just Commands
just build- Install dependencies and sync the projectjust run- Start the FastMCP serverjust test- Run the test scriptjust format- Format code with black and isortjust typecheck- Run type checking with mypyjust dev- Install development dependenciesjust dist- Build distribution packagesjust clean- Clean build artifactsjust publish- Publish to PyPI (used in CI)
Project Structure
mcp-agents/
├── src/
│ └── fastmcp/
│ └── __init__.py # Main MCP server implementation
├── pyproject.toml # Project configuration and dependencies
├── justfile # Task runner configuration
├── mcp_config.json # MCP client configuration example
├── test_tools.py # Simple test script
└── README.md # This file
Adding New Tools
To add new tools:
- Add the tool definition to the
handle_list_tools()function - Add the tool implementation to the
handle_call_tool()function - Update the README with documentation for the new tool
Running Tests
just test
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amajakai14_mcp_agents-0.1.0.tar.gz.
File metadata
- Download URL: amajakai14_mcp_agents-0.1.0.tar.gz
- Upload date:
- Size: 44.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24f01657108ce0f7b5ecec0425836faf4e13cbea06f3e5e6d23e4087b67902a6
|
|
| MD5 |
26f531da35b8a96a36de91b381d5dce2
|
|
| BLAKE2b-256 |
98852dce3f2efabcb64aac1b57c1be4f2075dff43bb48770ea1c84ee38d231e6
|
File details
Details for the file amajakai14_mcp_agents-0.1.0-py3-none-any.whl.
File metadata
- Download URL: amajakai14_mcp_agents-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f381a4ebc7446dda0e1fd0233b44fcd3819ab2a1dadd3c336c471976308fb2a
|
|
| MD5 |
ad91abff06f5bcc0e0cb6bb45f4492b1
|
|
| BLAKE2b-256 |
458e17dfff300772cc487daf4fef1506b8a97f1e36dcfcef91dd4b5f6b8d9bd8
|