MCP Connection & API Key

Everything needed to connect an MCP client to Lawmadi OS and issue a key for tool calls. This guide is readable without signing in; key issuance takes one email verification below.

Server registration and health checks need no key. initialize, tools/list and ping (discovery) answer unauthenticated. A key is required only for tools/call.

1. Connection details

Enter these values as-is in your MCP client or registration console.

MCP endpointhttps://lawmadi.com/mcp
TransportStreamable HTTP — JSON-RPC 2.0 over POST (one JSON response per request)
Identifierlawmadios · server name Lawmadi OS
Protocol versions2024-11-05 · 2025-03-26 · 2025-06-18 · 2025-11-25 (the requested version is echoed back)
AuthenticationKey/Token — HTTP header Authorization: Bearer <API key>
GET /mcpNo server-initiated SSE channel, so it returns 405 Method Not Allowed — expected per the MCP spec. Use POST for all calls.
No key
initializetools/listpingget_pricing
Registration, status checks, pricing and the key-issuance path all answer unauthenticated — a registry health check lands here.
Key needed
askask_expertlookup_statutelookup_precedentverify_citationsgenerate_document
Every other tools/call. No key sent → -32001; wrong or revoked key → -32002, both carrying the issuance path in the response.
One tool needs more than a key — ask_expert (expert answers, 2 credits) is Pro plan only. A positive balance is not enough: non-Pro callers are refused, no credits are charged, and the response carries the required plan plus a checkout link. The standard ask tool (1 credit) works on any plan.

2. Where do I get the API key?

Right here — no application or approval step. Only a hash of the key is stored, so the full key is shown once, immediately after creation.

01

Sign in with email

Enter the 6-digit code sent to your inbox. No application form, no approval step.

No signup form3 free credits · one time
02

Issue the key — on this page

Press Issue API key below and it is created instantly. Only a hash is stored, so the full key is shown once.

lmk_live_…Up to 10 active keysRevocation is immediate
03

Send it as a Bearer header

Add it to your MCP client and tools/call opens up.

Authorization: Bearer lmk_live_…
04

Top up when needed

After the free credits, buy more on the pricing page. Purchased credits never expire.

Lookup tools cost no credits
Checking your session…

3. Agents: get a key over OAuth 2.0 instead

If you are an autonomous agent, do not ask your user to copy a key out of this page. Register yourself, send them through one consent screen, and refresh on your own after that — the same way an assistant connects to a mail or drive account.

01

Read the metadata

GET /.well-known/oauth-authorization-server (RFC 8414) and GET /mcp/.well-known/oauth-protected-resource (RFC 9728). MCP clients that support auth read the second one before tools/call.

RFC 8414RFC 9728
02

Register yourself

POST /oauth/register with your redirect_uris — open to any client, no pre-arrangement (RFC 7591). Loopback http://127.0.0.1:PORT/… is accepted for native agents (RFC 8252).

RFC 7591No approval step
03

One consent, then autonomy

Send your user to /oauth/authorize with code_challenge_method=S256 (PKCE is required; plain is not supported), then exchange the code at /oauth/token. You get a refresh token and rotate it yourself.

PKCE S256 onlyRefresh rotates
04

Ask for the narrow scope when you can

mcp:read cannot spend the user's credits: credit-spending tools are refused outright, and the verified-asset lookups stop at their free daily allowance instead of charging. People approve that far more readily than mcp.

mcpmcp:read

The access token is an lmk_live_… key — the same credential this page issues. Quotas, daily allowances, billing and get_account behave identically, and the user can revoke it from their key list. There is no second authentication path to keep in sync.

Two more surfaces agents ask for: POST /a2a with the agent card at /.well-known/agent-card.json (synchronous tasks — streaming and push notifications are declared false and refused, because this host buffers SSE), and x402 machine payment, which is implemented but not enabled/.well-known/x402 returns 404 on purpose while no on-chain wallet is configured. Buy credits in the browser until that changes.

4. Client configuration

Passing the key in the Authorization header works the same way in every MCP client.

MCP client config (JSON)
{
  "mcpServers": {
    "lawmadi": {
      "type": "http",
      "url": "https://lawmadi.com/mcp",
      "headers": {
        "Authorization": "Bearer lmk_live_YOUR_KEY_HERE"
      }
    }
  }
}
Verify the connection without a key
curl -s https://lawmadi.com/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",
       "params":{"protocolVersion":"2025-06-18","capabilities":{},
                 "clientInfo":{"name":"health-check","version":"1"}}}'
Call a tool with the key
curl -s https://lawmadi.com/mcp \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer lmk_live_YOUR_KEY_HERE' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
       "params":{"name":"lookup_statute","arguments":{"reference":"민법 제750조"}}}'
Agents can discover this path through tools too: get_pricing needs no key and returns the sign-up → key → top-up sequence, and get_account reports the balance for a key.

5. Key management rules

6. MCP key vs. expert REST API key

There are two kinds of key. For MCP, use the one issued on this page.

MCP key (this page)Email sign-in is enough · for https://lawmadi.com/mcp tool calls · metered by credits
Expert REST API keyFor B2B /api/v1/expert/ask only · issued in the expert API console on the Pro plan · see Expert API
If issuance does not work, or you need a key for a platform review, contact admin@lawmadi.com.