Update readmeUpdate README

This commit is contained in:
Jeremiah Lowin 2024-11-30 19:30:36 -05:00
commit aed403d929
5 changed files with 310 additions and 122 deletions

View file

@ -0,0 +1,19 @@
from fastmcp import FastMCP
# Create an MCP server
mcp = FastMCP("Demo")
# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
"""Get a personalized greeting"""
return f"Hello, {name}!"