TheLayman/mcpServer
3.1
If you are the rightful owner of mcpServer and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project is a simple calculator server built using the Model Context Protocol (MCP) and Starlette, providing basic arithmetic operations and additional features via HTTP.
Tools
5
Resources
0
Prompts
0
Calculator MCP Server
This project is a simple calculator server built using the Model Context Protocol (MCP) and Starlette. It exposes basic arithmetic operations and a greeting resource via HTTP.
Features
- Add, subtract, multiply, and divide two numbers
- Get a personalized greeting
- Get a random joke
Requirements
- Python 3.8+
mcp-serverpackagestarlettepackage
Installation
- Clone this repository or copy the files to your local machine.
- Install the required dependencies:
pip install mcp-server starlette
Running the Server
Run the following command in PowerShell:
python server.py
By default, the server will start and listen for HTTP requests.
API Usage
You can interact with the server using HTTP requests. The available tools are:
add(a, b)subtract(a, b)multiply(a, b)divide(a, b)joke()greeting://{name}resource
Example Request (using HTTPie)
http POST http://localhost:8000/mcp/tool/add a:=2 b:=3
Example Greeting Resource
http GET http://localhost:8000/mcp/resource/greeting://Alice
Notes
- Division by zero will return an error.
- The server uses the
streamable-httptransport by default.
License
MIT License