21 lines
453 B
Python
21 lines
453 B
Python
from mcp.server.fastmcp import FastMCP
|
|
import asyncio
|
|
|
|
# Initialize FastMCP server
|
|
mcp = FastMCP("Simple Demo Server")
|
|
|
|
@mcp.tool()
|
|
def add_numbers(a: int, b: int) -> int:
|
|
"""Add two numbers together."""
|
|
return a + b
|
|
|
|
@mcp.tool()
|
|
def get_current_time() -> str:
|
|
"""Get the current local time."""
|
|
from datetime import datetime
|
|
return datetime.now().isoformat()
|
|
|
|
if __name__ == "__main__":
|
|
# Run the server over stdio
|
|
mcp.run()
|