Quickstart
Get your MCP server secured with authorization in under 5 minutes.
Step 1: Install the Middleware
Step 2: Add Middleware to Your Server
server.py
from fastmcp import FastMCP
from eunomia_mcp import EunomiaMcpMiddleware
mcp = FastMCP("Secure FastMCP Server 🔒")
@mcp.tool()
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
middleware = EunomiaMcpMiddleware()
mcp.add_middleware(middleware)
if __name__ == "__main__":
mcp.run()
Step 3: Start Eunomia Server
The middleware requires a running Eunomia server to make policy decisions.
Run it in the background with Docker:
Or refer to the Eunomia server documentation for additional configuration options.
Step 4: Start Your Server
You can now run your MCP server normally:
Your server now has authorization middleware! By default, all requests will be denied until you configure policies.