Docs/API Reference

API Reference

RESTful API and MCP SSE transport. All requests authenticated via API key. Base URL: https://claritycoremcp-live.up.railway.app

Authentication

All API requests require authentication via the X-API-Key header. API keys are prefixed with cc_live_ for production and cc_test_ for sandbox environments.

Authentication
# API Key authentication (recommended for programmatic access)
curl -H "X-API-Key: cc_live_YOUR_KEY_HERE" \
  https://claritycoremcp-live.up.railway.app/mcp/tools

Endpoints

MethodPath
GET/mcp/tools
POST/mcp/execute
GET/mcp/tools/:name
GET/sse
POST/auth/login
GET/users/me
GET/usage
POST/api-keys
DELETE/api-keys/:id
GET/admin/businesses
GET/admin/analytics

Execute a Tool

The primary endpoint. Send a tool name and arguments, receive structured results with source citations.

POST /mcp/execute
curl -X POST https://claritycoremcp-live.up.railway.app/mcp/execute \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cc_live_YOUR_KEY_HERE" \
  -d '{
    "tool": "deep_research",
    "arguments": {
      "query": "Medicare Advantage prior authorization requirements 2026",
      "depth": "comprehensive"
    }
  }'

Response

200 OK
{
  "status": "success",
  "result": {
    "content": "...",
    "sources": [
      {
        "title": "CMS Final Rule CMS-4201-F",
        "url": "https://www.cms.gov/...",
        "confidence": 0.97
      }
    ],
    "verification_score": 0.94
  },
  "usage": {
    "tokens_used": 2847,
    "tools_called": 3,
    "latency_ms": 1243
  }
}

SSE Transport (MCP Protocol)

For MCP clients like Claude Desktop and Cursor, connect via the SSE endpoint. The server implements the full MCP protocol over Server-Sent Events.

SSE Connection
# Connect via SSE for MCP protocol
curl -N -H "X-API-Key: cc_live_YOUR_KEY_HERE" \
  https://claritycoremcp-live.up.railway.app/sse

# The server sends MCP protocol messages as SSE events:
# event: message
# data: {"jsonrpc":"2.0","method":"tools/list","result":{...}}

Rate Limits

Rate limits are applied per API key. Headers X-RateLimit-Remaining and Retry-After are included in every response.

PlanRequestsTool Calls
Starter100 / minute1,000 / day
Professional500 / minute10,000 / day
Private2,000 / minuteUnlimited
EnterpriseCustomUnlimited

Error Codes

Error Response Format
{
  "status": "error",
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Retry after 2 seconds.",
    "retry_after": 2
  }
}
CodeNameDescription
400Bad RequestInvalid request body or missing required parameters
401UnauthorizedMissing or invalid API key
403ForbiddenAPI key lacks permission for this resource or tool tier
404Not FoundEndpoint or tool does not exist
429Rate LimitedToo many requests. Check Retry-After header
500Internal ErrorServer error. Contact support if persistent
503Service UnavailableTemporary maintenance. Retry with exponential backoff