Files
python-mcp-toolbox/tests/fixtures/echo_server.py
2026-03-16 14:12:06 +01:00

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")