Exposing Landmark Servers
Bind landmark servers to FastAPI, STDIO, or SSE interfaces.
Exposing Your Server
Once your landmark actions are defined, you can expose them to agents using different protocols and gateways.
Option A: FastAPI (Web API via HTTP)
Perfect for microservices, cloud deployments, or multi-client networks:
python
import uvicorn
from fastapi import FastAPI
from elemm import AIProtocolManager
from elemm.gateways.fastapi import FastAPIGateway
app = FastAPI()
manager = AIProtocolManager()
@manager.landmark("compute:toggle_power")
async def toggle_power(instance_id: str, state: str):
"""Control the power state of a virtual machine."""
return {"status": "success", "instance": instance_id, "new_state": state}
gateway = FastAPIGateway(manager)
gateway.bind_to_app(app)
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)This automatically provides the standardized endpoints:
GET /.well-known/elemm-manifest.md— The manifestGET /.well-known/elemm-inspect.md— Landmark inspectionPOST /.well-known/elemm/execute— Action executionGET /.well-known/elemm/search— Landmark search
Option B: Standalone MCP (Local via STDIO)
Perfect for direct integration with local AI agents (e.g., Claude Desktop):
python
from elemm import ElemmGateway
gateway = ElemmGateway(name="ComputeServer")
@gateway.action("compute:toggle_power")
async def toggle_power(instance_id: str, state: str):
"""Control the power state of a virtual machine."""
return {"status": "success", "instance": instance_id, "new_state": state}
if __name__ == "__main__":
gateway.run_mcp()Option C: MCP Gateway (SSE Mode)
For web/remote integrations:
python
from elemm.gateways.mcp_server import MCPGateway
server = MCPGateway(manager, server_name="My-Landmark-Server")
server.run_sse(host="0.0.0.0", port=8005)