File size: 476 Bytes
e6873e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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')