22 lines
376 B
Python
22 lines
376 B
Python
"""Simple MCP server used for testing: string tools."""
|
|
|
|
from mcp.server.fastmcp import FastMCP
|
|
|
|
mcp = FastMCP("echo")
|
|
|
|
|
|
@mcp.tool()
|
|
def echo(message: str) -> str:
|
|
"""Return the message unchanged."""
|
|
return message
|
|
|
|
|
|
@mcp.tool()
|
|
def reverse(text: str) -> str:
|
|
"""Return the text reversed."""
|
|
return text[::-1]
|
|
|
|
|
|
if __name__ == "__main__":
|
|
mcp.run("stdio")
|