Quickstart
DocketLayer provides real-time access to court dockets across 2,148 US and Canadian courts — federal district, appellate, bankruptcy, and state courts, plus Canadian federal, provincial, and territorial superior courts — built for AI agents and developers who need reliable case monitoring without managing data infrastructure.
No account is required. Payment is per query: $0.99 USDC settled on Solana at the moment each request is fulfilled via x402. Fund a Solana wallet once, pay only for what you query.
Choose the integration path that fits your stack.
Configure the Server
Add DocketLayer to your MCP client's configuration file. The server is distributed via npm — npx fetches and runs it automatically, no separate install required. Provide your Solana wallet private key in Base58 format via DOCKETLAYER_WALLET_PRIVATE_KEY. The server uses this key to sign USDC payments on your behalf.
// macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
// Windows: %APPDATA%\\Claude\\claude_desktop_config.json
{
"mcpServers": {
"docketlayer": {
"command": "npx",
"args": ["-y", "@docketlayer/mcp-server"],
"env": {
"DOCKETLAYER_WALLET_PRIVATE_KEY": "your_base58_private_key"
}
}
}
}// Project: .cursor/mcp.json | Global: ~/.cursor/mcp.json
{
"mcpServers": {
"docketlayer": {
"command": "npx",
"args": ["-y", "@docketlayer/mcp-server"],
"env": {
"DOCKETLAYER_WALLET_PRIVATE_KEY": "your_base58_private_key"
}
}
}
}// Refer to your client's documentation for config file location.
// The mcpServers schema is standard across MCP-compatible clients.
{
"mcpServers": {
"docketlayer": {
"command": "npx",
"args": ["-y", "@docketlayer/mcp-server"],
"env": {
"DOCKETLAYER_WALLET_PRIVATE_KEY": "your_base58_private_key"
}
}
}
} Key Security
env block, not as a command-line argument. Keep it out of version control. The wallet needs a USDC balance on Solana mainnet — see the wallet setup guide. Each paid query costs $0.99.
Available Tools
The server exposes seven tools. The two below cover the core quickstart use case. The full catalog — including docketlayer_case_monitor, docketlayer_case_batch, and docketlayer_wallet_info — is in the API reference.
docketlayer_status free Returns operational status, API version, and the full list of covered courts with court codes and coverage levels. Use this to verify connectivity and look up a court_code before querying a case.
docketlayer_case_query $0.99 Returns normalized case context and docket activity for a known case. Pass last_checked to receive only activity since your prior query.
court_code string required Court identifier. Full list from docketlayer_status or docketlayer.ai/coverage.
case_id string required Case identifier in the format used by the court registry.
last_checked ISO-8601 optional Your prior query timestamp. Returns only activity since this time.
context enum optional basic (default) or full. basic returns activity summary; full includes all docket entries.
language enum optional en or fr. Relevant for bilingual Canadian jurisdictions.
Make Your First Query
Restart your MCP client after updating the config. Ask your AI assistant to query a case — the tool call, payment, and response are handled automatically. The first call will take a moment while npx fetches the package.
{
"tool": "docketlayer_case_query",
"arguments": {
"court_code": "nysd",
"case_id": "1:24-cv-09822"
}
} {
"meta": {
"request_id": "req_8f3a...",
"queried_at": "2026-05-10T09:14:22-07:00",
"query_cost_usd": 0.99
},
"case_id": "1:24-cv-09822",
"court_code": "nysd",
"case": {
"case_number": "1:24-cv-09822",
"case_name": "Acme Corp v. Widget Inc",
"status": "open",
"filed_at": "2024-06-15T00:00:00Z"
},
"delta": {
"changed": true,
"since": "2026-05-01T00:00:00Z",
"change_count": 1,
"new_filings": [
{
"filing_type": "order",
"description": "Order granting motion to dismiss",
"filed_at": "2026-04-13T08:47:22Z"
}
]
}
} Verify Connectivity
The status endpoint is free and requires no payment. Use it to confirm connectivity and retrieve the full list of covered courts.
/v2/status free Returns operational status, API version, and all covered courts with case ID formats.
curl https://api.docketlayer.ai/v2/statusimport httpx
resp = httpx.get("https://api.docketlayer.ai/v2/status")
print(resp.json())const resp = await fetch("https://api.docketlayer.ai/v2/status");
const data = await resp.json();
console.log(data); GET /v2/status HTTP/1.1
Host: api.docketlayer.ai {
"operational_status": "nominal",
"api_version": "2.0.0",
"court_count": 2148,
"courts": [ ... ]
} Pick a Court
Every query requires a court_code. Codes are short, stable identifiers — nysd for the Southern District of New York, ca9 for the Ninth Circuit, on_sc for Ontario Superior Court. The full list is at docketlayer.ai/coverage or in the courts array from /v2/status.
Coverage
Handle the Payment Gate
Paid endpoints return 402 on the first request. Parse X-Payment-Requirements from the response header — it contains the payment destination and amount as JSON. Build a signed Solana USDC transfer, wrap it in an x402 payment payload, base64-encode it, and retry with the x402-payment request header. Payment is only settled on a successful 200. See the How x402 Works guide for a full implementation with reusable helper functions.
GET /v2/case Initial request — no payment header
HTTP 402 Payment Required Response includes receiver address, amount (0.99 USDC), and network
Construct USDC transaction Sign and serialize a Solana USDC transfer to the receiver address
GET /v2/case Retry with x402-payment header containing base64-encoded signed transaction bytes
Verify and broadcast DocketLayer simulates the transaction, verifies payment, and broadcasts to Solana
HTTP 200 OK Payment confirmed — case data returned
402 response header — parse this JSON to construct the payment.
X-Payment-Requirements {"payTo":"GvR3...qF8","maxAmountRequired":"990000","network":"solana-mainnet","asset":"EPjF...t1v"} Full payment specification as JSON. payTo is the USDC destination wallet; maxAmountRequired is 990000 ($0.99 at 6 decimal places). Parse this to construct the signed Solana transaction. Why No curl?
402 with payment details; your client must then build and sign a Solana USDC transaction before retrying with x402-payment. curl has no mechanism for that orchestration. Use the Python or JavaScript examples below to complete the full flow.
import httpx, json, base64, os
from solders.keypair import Keypair
from solders.pubkey import Pubkey
from solana.rpc.api import Client
from solana.transaction import Transaction
from spl.token.instructions import transfer, TransferParams, get_associated_token_address
ENDPOINT = "https://api.docketlayer.ai/v2/case"
PARAMS = {"court_code": "nysd", "case_id": "1:24-cv-09822"}
USDC_MINT = Pubkey.from_string("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
TOKEN_PROG = Pubkey.from_string("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
# 1. Probe — expect 402 with X-Payment-Requirements
probe = httpx.get(ENDPOINT, params=PARAMS)
assert probe.status_code == 402
requirements = json.loads(probe.headers["X-Payment-Requirements"])
receiver = Pubkey.from_string(requirements["payTo"])
amount = int(requirements["maxAmountRequired"]) # 990000 = $0.99 in USDC base units
# 2. Build and sign the USDC transfer
payer = Keypair.from_base58_string(os.environ["WALLET_PRIVATE_KEY"])
client = Client("https://solana-mainnet.publicnode.com")
src_ata = get_associated_token_address(payer.pubkey(), USDC_MINT)
dest_ata = get_associated_token_address(receiver, USDC_MINT)
ix = transfer(TransferParams(
program_id=TOKEN_PROG,
source=src_ata,
dest=dest_ata,
owner=payer.pubkey(),
amount=amount,
))
blockhash = client.get_latest_blockhash().value.blockhash
tx = Transaction(recent_blockhash=blockhash, fee_payer=payer.pubkey())
tx.add(ix)
tx.sign(payer)
# Wrap in x402 payload and base64-encode
payment = base64.b64encode(json.dumps({
"x402Version": 1,
"scheme": "exact",
"network": "solana-mainnet",
"payload": {"transaction": base64.b64encode(bytes(tx)).decode()},
}).encode()).decode()
# 3. Retry with x402-payment header
resp = httpx.get(ENDPOINT, params=PARAMS, headers={"x402-payment": payment})
print(resp.json())import {
Connection, Keypair, PublicKey, Transaction,
} from "@solana/web3.js";
import {
createTransferInstruction, getAssociatedTokenAddress, TOKEN_PROGRAM_ID,
} from "@solana/spl-token";
const ENDPOINT = "https://api.docketlayer.ai/v2/case";
const PARAMS = new URLSearchParams({ court_code: "nysd", case_id: "1:24-cv-09822" });
const USDC_MINT = new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
// 1. Probe — expect 402 with X-Payment-Requirements
const probe = await fetch(`${ENDPOINT}?${PARAMS}`);
const requirements = JSON.parse(probe.headers.get("X-Payment-Requirements"));
const receiver = new PublicKey(requirements.payTo);
const amount = BigInt(requirements.maxAmountRequired); // 990000n = $0.99
// 2. Build and sign the USDC transfer
const payer = Keypair.fromSecretKey(YOUR_SECRET_KEY);
const connection = new Connection("https://solana-mainnet.publicnode.com");
const srcAta = await getAssociatedTokenAddress(USDC_MINT, payer.publicKey);
const destAta = await getAssociatedTokenAddress(USDC_MINT, receiver);
const tx = new Transaction().add(
createTransferInstruction(srcAta, destAta, payer.publicKey, amount, [], TOKEN_PROGRAM_ID)
);
tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
tx.feePayer = payer.publicKey;
tx.sign(payer);
// Wrap in x402 payload and base64-encode
const payment = Buffer.from(JSON.stringify({
x402Version: 1,
scheme: "exact",
network: "solana-mainnet",
payload: { transaction: Buffer.from(tx.serialize()).toString("base64") },
})).toString("base64");
// 3. Retry with x402-payment header
const resp = await fetch(`${ENDPOINT}?${PARAMS}`, {
headers: { "x402-payment": payment },
});
console.log(await resp.json()); Signature Expiry
402.
Query a Case
Pass your encoded payment in x402-payment. Optionally include last_checked to receive only activity since your prior query — this keeps responses tight for polling agents.
/v2/case $0.99 Returns normalized case context and docket activity. Accepts last_checked for delta responses.
Query parameters for GET /v2/case
court_code string required Court identifier. Full list from /v2/status or docketlayer.ai/coverage. case_id string required Case identifier in the format used by the court registry. last_checked ISO-8601 optional Your prior query timestamp. Returns only activity since this time. context enum optional basic (default) or full. basic returns activity summary; full includes all docket entries. language enum optional en or fr. Relevant for bilingual jurisdictions. curl -G https://api.docketlayer.ai/v2/case \
-d court_code=nysd \
-d case_id=1:24-cv-09822 \
-H "x402-payment: <base64_x402_payload>"resp = httpx.get(
"https://api.docketlayer.ai/v2/case",
params={"court_code": "nysd", "case_id": "1:24-cv-09822"},
headers={"x402-payment": payment},
)
print(resp.json())const resp = await fetch(
"https://api.docketlayer.ai/v2/case?court_code=nysd&case_id=1:24-cv-09822",
{ headers: { "x402-payment": payment } }
);
console.log(await resp.json()); GET /v2/case?court_code=nysd&case_id=1:24-cv-09822 HTTP/1.1
Host: api.docketlayer.ai
x402-payment: <base64_x402_payload> {
"meta": {
"request_id": "req_8f3a...",
"queried_at": "2026-05-10T09:14:22-07:00",
"query_cost_usd": 0.99
},
"case_id": "1:24-cv-09822",
"court_code": "nysd",
"case": {
"case_number": "1:24-cv-09822",
"case_name": "Acme Corp v. Widget Inc",
"status": "open",
"filed_at": "2024-06-15T00:00:00Z"
},
"delta": {
"changed": true,
"since": "2026-05-01T00:00:00Z",
"change_count": 1,
"new_filings": [
{
"filing_type": "order",
"description": "Order granting motion to dismiss",
"filed_at": "2026-04-13T08:47:22Z"
}
]
}
} Configure the MCP Server
The prompt path runs on top of the MCP server. Add DocketLayer to your client's configuration file with your Solana wallet private key. Once configured, your AI assistant can query court dockets in response to natural language — no further integration work is required.
// macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
// Windows: %APPDATA%\\Claude\\claude_desktop_config.json
{
"mcpServers": {
"docketlayer": {
"command": "npx",
"args": ["-y", "@docketlayer/mcp-server"],
"env": {
"DOCKETLAYER_WALLET_PRIVATE_KEY": "your_base58_private_key"
}
}
}
}// Project: .cursor/mcp.json | Global: ~/.cursor/mcp.json
{
"mcpServers": {
"docketlayer": {
"command": "npx",
"args": ["-y", "@docketlayer/mcp-server"],
"env": {
"DOCKETLAYER_WALLET_PRIVATE_KEY": "your_base58_private_key"
}
}
}
}// Refer to your client's documentation for config file location.
// The mcpServers schema is standard across MCP-compatible clients.
{
"mcpServers": {
"docketlayer": {
"command": "npx",
"args": ["-y", "@docketlayer/mcp-server"],
"env": {
"DOCKETLAYER_WALLET_PRIVATE_KEY": "your_base58_private_key"
}
}
}
} Ask Your Assistant
Restart your client after updating the config. Prompt your assistant directly — it will invoke docketlayer_case_query or docketlayer_status automatically, handle payment, and return a response in natural language.
"What is the current status of case 1:24-cv-09822 in the Southern District of New York?"
"Pull the full docket for D. Delaware patent case 1:23-cv-00917. I need all entries from the past 30 days."
"Check Federal Court of Canada case T-1045-24 and summarize anything filed since April 1."
"Which circuits does DocketLayer cover? I'm tracking a Ninth Circuit appeal." Payment
Next Steps