Setup Guide

Connect AI agents to MCP servers via HTTP.

HTTP API

All platforms

Call MCP tools from any language, platform, or AI agent using standard HTTP requests. Works with Claude Code, Cursor, custom agents, webhooks, and any HTTP client.

1. Get your API key

Create an API key from your admin dashboard. Keys use the hk_ prefix.

2. Discover available servers

curl https://mcp.lthn.ai/servers.json \
  -H "Authorization: Bearer YOUR_API_KEY"

3. Call a tool

curl -X POST https://mcp.lthn.ai/tools/call \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "server": "openbrain",
    "tool": "brain_recall",
    "arguments": { "query": "authentication decisions" }
  }'

4. Read a resource

curl https://mcp.lthn.ai/resources/plans://all \
  -H "Authorization: Bearer YOUR_API_KEY"
GET /.well-known/mcp-servers.json Agent discovery
GET /servers List all servers
GET /servers/{id} Server details + tools
POST /tools/call Execute a tool
GET /resources/{uri} Read a resource

Code Examples

Python

import requests

resp = requests.post(
    "https://mcp.lthn.ai/tools/call",
    headers={"Authorization": "Bearer hk_your_key"},
    json={
        "server": "openbrain",
        "tool": "brain_recall",
        "arguments": {"query": "recent decisions"}
    }
)
print(resp.json())

JavaScript

const resp = await fetch("https://mcp.lthn.ai/tools/call", {
  method: "POST",
  headers: {
    "Authorization": "Bearer hk_your_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    server: "openbrain",
    tool: "brain_recall",
    arguments: { query: "recent decisions" },
  }),
});
const data = await resp.json();

Authentication

Authorization Header (Recommended)

Authorization: Bearer hk_abc123_your_key_here

X-API-Key Header

X-API-Key: hk_abc123_your_key_here

Server-scoped keys

API keys can be restricted to specific MCP servers. If you get a 403 error, check your key's server scopes in your admin dashboard.

Rate limiting

Requests are rate limited to 120 per minute. Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining) are included in all responses.

Discovery

Agents discover available servers automatically via the well-known endpoint:

curl https://mcp.lthn.ai/.well-known/mcp-servers.json

Returns the server registry with capabilities and connection details. No authentication required for discovery.

Need help setting up?