You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
325 B
21 lines
325 B
# math_server.py
|
|
from mcp.server.fastmcp import FastMCP
|
|
|
|
mcp = FastMCP("Math")
|
|
|
|
|
|
@mcp.tool()
|
|
def add(a: int, b: int) -> int:
|
|
"""Add two numbers"""
|
|
return a + b
|
|
|
|
|
|
@mcp.tool()
|
|
def multiply(a: int, b: int) -> int:
|
|
"""Multiply two numbers"""
|
|
return a * b
|
|
|
|
|
|
if __name__ == "__main__":
|
|
mcp.run(transport="sse")
|