Simple-Tool-Server-Fastapi
Click on "Install 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., "@Simple-Tool-Server-Fastapiadd 15 and 27"
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.
๐ Simple Tool Server with FastAPI
A lightweight FastAPI-based tool server that exposes simple utility functions through REST API endpoints.
This project demonstrates how Python functions can be wrapped behind FastAPI endpoints and accessed through HTTP requests. It also provides a basic foundation for understanding how similar tools can later be exposed through Model Context Protocol (MCP).
๐ Features
โ Add two numbers
๐ Get the current date and time
๐ Count words in a given text
โก Fast API development using FastAPI
โ Request validation using Pydantic
๐ฆ JSON-based API responses
๐ Automatic interactive API documentation
๐ Simple architecture that can be extended into an MCP-based tool server
Related MCP server: SENTRA MCP
๐๏ธ Project Structure
simple-tool-server-fastapi/
โ
โโโ main.py # FastAPI application and API endpoints
โโโ model.py # Pydantic request models
โโโ tools.py # Core utility functions
โโโ requirements.txt # Project dependencies
โโโ .gitignore # Files excluded from Git
โโโ README.md # Project documentation๐ How It Works
The project follows a simple flow:
Client
โ
FastAPI Endpoint
โ
Python Tool Function
โ
JSON ResponseFor example:
GET /add
โ
add_numbers()
โ
JSON responseThe same concept can later be extended toward an MCP architecture:
AI Assistant
โ
MCP Client
โ
MCP Server
โ
Python Tools๐ ๏ธ Technologies Used
Python
FastAPI
Pydantic
Uvicorn
REST API
JSON
Model Context Protocol (MCP) concepts
โ๏ธ Installation
1. Clone the repository
git clone https://github.com/sejalpatole/simple-tool-server-fastapi.git2. Navigate to the project
cd simple-tool-server-fastapi3. Create a virtual environment
python -m venv venv4. Activate the virtual environment
Windows
venv\Scripts\activatemacOS / Linux
source venv/bin/activate5. Install dependencies
pip install -r requirements.txtโถ๏ธ Running the Application
Start the FastAPI server using Uvicorn:
uvicorn main:app --reloadThe server will start at:
http://127.0.0.1:8000๐ API Documentation
FastAPI automatically provides interactive API documentation.
Swagger UI
Open:
http://127.0.0.1:8000/docsReDoc
Open:
http://127.0.0.1:8000/redoc๐ API Endpoints
1. Home
Endpoint
GET /Returns information about the available endpoints.
Example Response
{
"message": "Welcome to the Simple Tool Server",
"available_endpoints": [
"/add",
"/time",
"/wordcount"
]
}2. Add Two Numbers
Endpoint
GET /addParameters
Parameter | Type | Description |
| float | First number |
| float | Second number |
Example
http://127.0.0.1:8000/add?a=10&b=20Example Response
{
"operation": "Addition",
"a": 10,
"b": 20,
"result": 30
}3. Get Current Time
Endpoint
GET /timeExample
http://127.0.0.1:8000/timeExample Response
{
"current_time": "2026-08-20 21:00:00"
}4. Count Words
Endpoint
POST /wordcountRequest Body
{
"text": "FastAPI is easy to use"
}Example Response
{
"text": "FastAPI is easy to use",
"word_count": 5
}๐งฉ Project Components
main.py
Contains the FastAPI application and API routes.
It defines endpoints for:
//add/time/wordcount
tools.py
Contains the core Python utility functions:
add_numbers()
get_current_time()
word_count()Keeping the tool logic separate from the API layer makes the project easier to maintain and extend.
model.py
Contains the Pydantic model used to validate the /wordcount request.
class WordCountRequest(BaseModel):
text: strThis ensures that the API receives the expected request structure.
๐งช Testing
The APIs can be tested using:
Swagger UI
Postman
Browser
cURL
Any REST API client
Swagger UI is available at:
http://127.0.0.1:8000/docs๐ฑ Future Improvements
Possible future extensions include:
Add more utility tools
Add authentication
Add logging
Add automated tests using Pytest
Add Docker support
Add MCP protocol support
Expose the Python tools through an MCP server
Add database-backed tools
Deploy the server to a cloud platform
๐ฏ Learning Outcomes
Through this project, the following concepts are demonstrated:
Building APIs with FastAPI
Creating GET and POST endpoints
Request validation with Pydantic
Separating API logic from business logic
Working with JSON requests and responses
Running applications with Uvicorn
Understanding the foundation of tool-based AI systems
Understanding the relationship between APIs, tools, and MCP
๐ฉโ๐ป Author
Sejal Patole
โญ Acknowledgement
This project was developed as a learning exercise to understand FastAPI, REST APIs, Python utility tools, and the fundamentals of MCP-based tool architecture.
If you found this project useful, consider giving the repository a โญ.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA basic educational MCP server that provides simple tools for mathematical calculations, text manipulation, and time retrieval. Designed for learning MCP implementation patterns and development purposes.
- AlicenseNot gradedqualityDmaintenanceA minimal FastAPI-based MCP server that provides basic utility tools like ping and time functions. Designed for easy deployment with Docker support, authentication, and extensible architecture for future tool additions.MIT
- AlicenseNot gradedqualityDmaintenanceA minimal FastMCP server implementation that provides basic mathematical and greeting tools. Enables users to perform simple operations like adding numbers and greeting people by name through a lightweight MCP interface.MIT
- FlicenseNot gradedqualityDmaintenanceA simple educational MCP server providing basic math operations, string manipulation, and greeting functionality. Demonstrates how to implement MCP tools for learning purposes.
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sejalpatole/Simple-Tool-Server-Fastapi'
If you have feedback or need assistance with the MCP directory API, please join our Discord server