cthuaung/mcp-server
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This repository contains a simple MCP (Model Context Protocol) server built with FastMCP, providing various mathematical operations as tools.
The MCP Server Tutorial provides a comprehensive guide to setting up and running a Model Context Protocol server using FastMCP. The server is designed to offer a range of mathematical operations, from basic arithmetic to advanced functions like trigonometry and logarithms. It also includes a dynamic greeting resource. The server is compatible with different transport protocols, including SSE and stdio, making it versatile for various applications. Users can interact with the server using tools like MCP Inspector, and the server can be easily extended with new tools and resources by following the provided patterns.
Features
- Basic arithmetic operations (addition, subtraction, multiplication, division)
- Advanced mathematical functions including power, square root, cube root, factorial, and logarithm
- Trigonometric functions (sin, cos, tan) and remainder calculation
- Dynamic greeting resource for personalized interactions
- Support for multiple transport protocols (stdio and sse)
Usages
usage with MCP Inspector
npx @modelcontextprotocol/inspector
usage with FastMCP
from mcp.server import FastMCP app = FastMCP('demo') @app.tool() async def query(): ...
usage with SSE
mcp.run(transport='sse', host='0.0.0.0', port=8000)