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.
| Fact | Value |
|---|---|
| Endpoint (streamable HTTP) | https://advisor.lawatlas.ai/api/mcp-http/mcp |
| Endpoint (SSE) | https://advisor.lawatlas.ai/api/mcp/sse |
| Subscriber sign-in | OAuth 2.1 with PKCE; your client registers itself, so you need no Client ID |
| Partner credential | Authorization: Bearer <API key>, read from the environment variable LAWATLAS_API_KEY |
Before you begin
- A subscriber needs an active Advisor AI Pro subscription. A partner needs an API key from the Advisor partner page.
- A partner sets the key as an environment variable, never in a configuration file:
export LAWATLAS_API_KEY=<your-key>.
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/callrequest, as in the curl tab, works without aninitializefirst.
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
| Problem | Cause | Solution |
|---|---|---|
Claude Code: invalid_request, redirect_uri does not match | A Client ID registered for another client (Claude Desktop) was used | Remove 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 /mcp | Added at a scope this project does not read, or the session started before the server was added | Add it with --scope user, or restart Claude Code |
| HTTP 401 | No credential, or the key is unknown, revoked, suspended or expired | Check LAWATLAS_API_KEY, and the key's status in the partner page |
A tool answers FORBIDDEN mentioning the subscription | The AI Pro subscription has lapsed (for a partner, the owning organisation's) | Renew the subscription in Advisor |
More rows in Troubleshooting.