Skip to main content
Glama
ImDPS
by ImDPS
server.py676 B
from mcp.server.fastmcp import FastMCP from dotenv import load_dotenv load_dotenv("../.env") mcp = FastMCP( name="Calculator", host="0.0.0.0", port=8050 ) # add a simple calculator tool @mcp.tool() def add(a: int, b: int) -> int: """Add two numbers together""" return a + b # Run the server if __name__ == "__main__": transport = "sse" if transport == "stdio": print("Running server with the stdio transport") mcp.run(transport="stdio") elif transport == "sse": print("Running server with the SSE transport") mcp.run(transport="sse") else: raise ValueError(f"Unknown transport: {transport}")

Latest Blog Posts

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/ImDPS/MCP'

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