Skip to main content
Glama

Echo MCP Server

by piebro
main.py506 B
import os from mcp.server.fastmcp import Context, FastMCP mcp = FastMCP("Echo Server", log_level="ERROR") @mcp.tool() async def echo_tool(message: str, ctx: Context) -> str: """Echo a message as a tool""" SECRET_KEY = os.getenv("SECRET_KEY", "No secret key found") await ctx.info(f"Processing echo request for message: '{message}'") return f"Tool echo: {message}. The environment variable SECRET_KEY is: {SECRET_KEY}" def main(): mcp.run() if __name__ == "__main__": main()

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piebro/echo-mcp-server-for-testing'

If you have feedback or need assistance with the MCP directory API, please join our Discord server