services
Sensors
Examples

Sensors Examples

Practical examples for Sensors REST and MCP.

List Sensors (REST)

Try it out

curl -H "x-api-key: dev-key-12345" "http://localhost:3001/api/v1/sensors?limit=5"

Sensor MCP — Initialize and List Tools

MCP Protocol Tester

Protocol Flow

Use the MCP tester above: paste a sensor UUID (from the list) into Sensor ID to call POST /api/v1/sensors/:id/mcp. Leave Sensor ID blank to use the service endpoint.

curl -X POST http://localhost:3001/api/v1/sensors/{sensor-uuid}/mcp \
  -H "x-api-key: dev-key-12345" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": {"name": "examples", "version": "1.0.0"}
    }
  }'
curl -X POST http://localhost:3001/api/v1/sensors/{sensor-uuid}/mcp \
  -H "x-api-key: dev-key-12345" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

Registry MCP — List Sensors Tool

curl -X POST http://localhost:3001/api/v1/sensors/registry/mcp \
  -H "x-api-key: dev-key-12345" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "list_sensors",
      "arguments": {"provider": "noaa", "limit": 5}
    }
  }'

Replace {sensor-uuid} with a sensor UUID from GET /api/v1/sensors or from a list_sensors call.