Connect a client

Add Advisor to your MCP client, sign in or present your API key, and call health to prove the connection works. Each client is configured differently, so use the tab for yours.

FactValue
Endpoint (streamable HTTP)https://advisor.lawatlas.ai/api/mcp-http/mcp
Endpoint (SSE)https://advisor.lawatlas.ai/api/mcp/sse
Subscriber sign-inOAuth 2.1 with PKCE; your client registers itself, so you need no Client ID
Partner credentialAuthorization: Bearer <API key>, read from the environment variable LAWATLAS_API_KEY

Before you begin

Connect as a subscriber

Your client opens a browser for you to sign in with your Advisor account.

Claude Code

# Add the server, then sign in from inside Claude Code: run /mcp, choose lawatlas, authenticate.
# Do not pass --client-id: Claude Code registers its own client.
claude mcp add --transport sse --scope user lawatlas https://advisor.lawatlas.ai/api/mcp/sse

Claude Desktop

Settings > Connectors > Add custom connector
  Name:                    Advisor MCP
  Remote MCP server URL:   https://advisor.lawatlas.ai/api/mcp/sse
Leave the advanced settings empty. Save, then choose Connect and sign in.

OpenAI Codex

# Streamable HTTP only. Add the server, then sign in.
codex mcp add lawatlas --url https://advisor.lawatlas.ai/api/mcp-http/mcp
codex mcp login lawatlas

Connect as a partner

Every request carries your API key. No one signs in.

Claude Code

claude mcp add --transport http --scope user lawatlas https://advisor.lawatlas.ai/api/mcp-http/mcp \
  --header "Authorization: Bearer $LAWATLAS_API_KEY"

Cursor

{
  "mcpServers": {
    "lawatlas": {
      "url": "https://advisor.lawatlas.ai/api/mcp-http/mcp",
      "headers": { "Authorization": "Bearer ${env:LAWATLAS_API_KEY}" }
    }
  }
}

OpenAI Codex

# ~/.codex/config.toml
[mcp_servers.lawatlas]
url = "https://advisor.lawatlas.ai/api/mcp-http/mcp"
bearer_token_env_var = "LAWATLAS_API_KEY"

Python SDK

import asyncio, os
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async def main():
    headers = {"Authorization": f"Bearer {os.environ['LAWATLAS_API_KEY']}"}
    async with streamablehttp_client("https://advisor.lawatlas.ai/api/mcp-http/mcp", headers=headers) as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()
            result = await session.call_tool("health", {})
            print(result.content[0].text)

asyncio.run(main())

TypeScript SDK

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(
  new URL("https://advisor.lawatlas.ai/api/mcp-http/mcp"),
  { requestInit: { headers: { Authorization: `Bearer ${process.env.LAWATLAS_API_KEY}` } } },
);
const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(transport);
const result = await client.callTool({ name: "health", arguments: {} });
console.log(result.content);

curl

curl -s https://advisor.lawatlas.ai/api/mcp-http/mcp \
  -H "Authorization: Bearer $LAWATLAS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"health","arguments":{}}}'

Note: The streamable HTTP endpoint is stateless: every request stands alone and needs no session. A single tools/call request, as in the curl tab, works without an initialize first.

Verify

Call health. A good response has "status": "ok", the corpus counts and, for a partner key, a partner_key block saying when the key expires. Trimmed from a real response captured on 10 October 2026:

{
  "status": "ok",
  "corpus": {
    "counts_by_kind": { "act": 4773, "legislative_instrument": 24136, "notifiable_instrument": 3475, "...": "..." }
  },
  "partner_key": { "key_ending": "2_Bo", "expires_at": "2027-01-08T05:27:24.928483Z", "days_to_expiry": 89 }
}

The full response is on the health page.

What Advisor exposes

26 tools, all of which read. See the tools index.

Access and permissions

A subscriber's paid tools need an active AI Pro subscription; health and renew_subscription work for any signed-in subscriber. A partner key works only while the AI Pro subscription of the organisation that owns it is active, and only for the scopes its client holds.

Troubleshooting

ProblemCauseSolution
Claude Code: invalid_request, redirect_uri does not matchA Client ID registered for another client (Claude Desktop) was usedRemove the Client ID, clear the stored sign-in (in /mcp choose the server, then Clear authentication, or run claude mcp logout lawatlas on Claude Code 2.1.186 or later), then authenticate again
The server is not listed in /mcpAdded at a scope this project does not read, or the session started before the server was addedAdd it with --scope user, or restart Claude Code
HTTP 401No credential, or the key is unknown, revoked, suspended or expiredCheck LAWATLAS_API_KEY, and the key's status in the partner page
A tool answers FORBIDDEN mentioning the subscriptionThe AI Pro subscription has lapsed (for a partner, the owning organisation's)Renew the subscription in Advisor

More rows in Troubleshooting.

Next steps