First_MCP / server.py
Noureddinesa's picture
Upload server.py
e6873e9 verified
raw
history blame contribute delete
476 Bytes
from mcp.server.fastmcp import FastMCP
mcp = FastMCP(
name = 'Calculator tool',
host='0.0.0.0',
port='8080'
)
@mcp.tool()
def addTool(a:int,b:int)->int:
return a+b
@mcp.prompt()
def greetingPrompt(style :str,userName:str)->str:
context = f"""
The user called : {userName}
answer with a greeting respecting this style : {style}
don't add any additional explinations.
"""
return context
mcp.run('sse')