Skip to content

Instantly share code, notes, and snippets.

@janakiramm
Created August 17, 2025 06:42
Show Gist options
  • Select an option

  • Save janakiramm/a5f5edf23a94108ca49263c7b4736e1d to your computer and use it in GitHub Desktop.

Select an option

Save janakiramm/a5f5edf23a94108ca49263c7b4736e1d to your computer and use it in GitHub Desktop.
Simple MCP Server
from fastmcp import FastMCP
mcp = FastMCP("Employee Server")
@mcp.tool()
def get_employees() -> list:
return [
{"id": 1, "name": "Alice", "role": "Engineer"},
{"id": 2, "name": "Bob", "role": "Designer"},
{"id": 3, "name": "Charlie", "role": "Manager"},
{"id": 4, "name": "Diana", "role": "Analyst"},
{"id": 5, "name": "Eve", "role": "Intern"},
]
if __name__ == "__main__":
mcp.run(transport="streamable-http", host="127.0.0.1", port=8080, path="/mcp/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment