Skip to main content
Glama

Python MCP Server

server.py830 B
from datetime import datetime from fastmcp import FastMCP mcp = FastMCP("My MCP Server") @mcp.tool def greet(name: str) -> str: return f"Hello, {name}!" @mcp.tool def addNumbers(a: int, b: int) -> int: return a + b @mcp.resource("resource://server-status") def getServerStatus() -> dict: """Get current server satus information""" return { "status": "running", "timestamp": datetime.now().isoformat(), "version": "v.0.1", "features": ["tools", "resources"], } @mcp.prompt() def codeReview(language: str, code: str) -> str: """Generate a code review prompt for the given language and code""" return f"""Please review this {language} code, provide feedback: ```{language} {code} ``` """ if __name__ == "__main__": mcp.run()

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/Yoshua-Carrera/python-mcp-server'

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