Laki.ai for coding agents

Connect Laki.ai to your CLI and API agents

A widget-less MCP endpoint that gives Codex CLI, Claude Code, the Claude Agent SDK, and custom Anthropic API agents clean, text-rich access to Finnish legal research — no in-chat widget. EU legislation is onboarded but search is not yet enabled on this endpoint.

Requires a Laki.ai account
Creating an API key requires Laki.ai PRO or Enterprise in good standing. Claude Code can alternatively connect with a one-time browser sign-in (OAuth) — no API key to manage.

Get started

On Laki.ai PRO or Enterprise in good standing, create an API key in personal or Organization settings (shown once — copy it then), export it, and point your agent at the headless endpoint. With Claude Code you can skip the API key and sign in through your browser instead (see Claude Code below).

Endpoint URL

https://api.laki.ai/mcp/headless
  1. Open personal or Organization settings → API keys and create an API key.
  2. Copy the API key — it is shown only once.
  3. Export it for your shell: export LAKI_API_KEY="paste_api_key_here"
  4. Configure one of the agents below with the endpoint URL and the API key as a bearer.

API keys belong to the Laki.ai account that created them. Personal keys serve that account; Organization keys are only for internal integrations serving members covered by the Organization subscription. They may support ordinary professional client work permitted by the applicable terms. See the headless MCP developer reference. Offering a Laki.ai-based product or service to third parties requires a Developer subscription or an Enterprise contract with redistribution rights. End-customer attribution is optional for Developer subscriptions; negotiated contracts retain their own requirements. For access inquiries, contact info@laki.ai.

Per-agent setup

Codex CLI, the Claude Agent SDK, and the API connector authenticate with an API key bearer; Claude Code can use the same API key too, or a one-time browser sign-in (OAuth). The six stateless tools return self-sufficient plain text by default, with an explicit structured mode for custom clients.

Codex CLI

Add the server to your Codex config and reference the API key via an env var.

~/.codex/config.toml
[mcp_servers.laki]
url = "https://api.laki.ai/mcp/headless"
bearer_token_env_var = "LAKI_API_KEY"

Claude Code

Recommended: install the Laki.ai plugin — it registers the server for you, and a one-time browser sign-in (OAuth) finishes the setup (Claude Code stores and refreshes the token). Or add the server by hand, with OAuth or an API key in an Authorization header.

Terminal
# Option A — install the plugin (recommended; also works in Claude Cowork)
/plugin marketplace add Helsinki-AI-Labs/laki-ai-claude-plugin
/plugin install laki-ai@laki-ai-plugins
# then sign in once: run /mcp, pick laki, Authenticate (opens your browser)
# Full guide: https://laki.ai/claude-plugin

# Option B — add the server by hand (OAuth, -s user loads it in every project)
claude mcp add -s user --transport http laki https://api.laki.ai/mcp/headless
claude mcp login laki   # opens your browser once; token is stored and refreshed

# Option C — API key instead of OAuth
claude mcp add -s user --transport http laki \
  https://api.laki.ai/mcp/headless \
  --header "Authorization: Bearer $LAKI_API_KEY"

# Confirm it connected:
claude mcp list

Claude Agent SDK

Register the server as an HTTP MCP server and allow its tools.

TypeScript
const options = {
  mcpServers: {
    laki: {
      type: 'http',
      url: 'https://api.laki.ai/mcp/headless',
      headers: { Authorization: `Bearer ${process.env.LAKI_API_KEY}` },
    },
  },
  allowedTools: ['mcp__laki__*'],
}

Anthropic API MCP connector

Pass the server in the mcp_servers param with the beta header, and expose it as an mcp_toolset.

TypeScript
const response = await client.messages.create(
  {
    model: 'claude-opus-4-8',
    max_tokens: 1024,
    messages: [{ role: 'user', content: 'Research: …' }],
    mcp_servers: [
      {
        type: 'url',
        url: 'https://api.laki.ai/mcp/headless',
        name: 'laki',
        authorization_token: process.env.LAKI_API_KEY,
      },
    ],
    tools: [{ type: 'mcp_toolset', mcp_server_name: 'laki' }],
  },
  { headers: { 'anthropic-beta': 'mcp-client-2025-11-20' } },
)

What the agent can do

Finnish legal research returned as rich text. EU primary and secondary legislation is onboarded but search is not yet enabled on this endpoint; call get_source_coverage for current availability.

Find sources by concept

Search Finnish statutes, case law, preparatory works, and tax guidance with Finnish queries. EU legislation search is not yet enabled on this endpoint; call get_source_coverage for current availability.

search_legal_sources

Read full documents

Fetch a Finnish document or an exact section, with related sources surfaced inline. EU reads are not yet enabled on this endpoint.

read_document

Navigate structure

Get the nested outline of a statute to jump to the right chapter and section.

get_table_of_contents

Search within a set

Full-text and semantic search inside a chosen set of Finnish documents.

search_within_documents

Amendment history

Trace how a statute section changed over time, with the amending acts.

get_statute_section_history

Check source coverage

Get curated guidance on which Finnish and EU legal sources are currently searchable and which are not yet covered.

get_source_coverage

Requirements

  • A Laki.ai account.
  • A Laki.ai PRO or Enterprise subscription in good standing to create a new API key in settings (shown once) — or, with Claude Code, a one-time browser sign-in.
  • An agent that speaks MCP over Streamable HTTP: Codex CLI, Claude Code, the Claude Agent SDK, or the Anthropic API MCP connector.

Authentication & data

Authenticate your own agent with an API key sent as a bearer, or — with Claude Code — a one-time browser sign-in (OAuth) that issues a short-lived access token plus a refresh token. Creating an API key requires PRO or Enterprise in good standing. Account standing is checked on every call: existing keys continue during payment retries and stop at final lapse, expiry, revocation, or account deletion. Personal keys belong to the account that created them, while Organization keys are only for internal integrations serving members covered by the Organization subscription. These credentials may support ordinary professional client work permitted by the applicable terms. Third-party-facing products require a Developer subscription or an Enterprise contract with redistribution rights. End-customer attribution is optional for Developer subscriptions; negotiated contracts retain their own requirements. Usage is tracked the same way as the in-app connectors. See our privacy policy for details. When Laki.ai processes personal data on behalf of a customer, the applicable terms and subprocessors are described in the DPA and subprocessor list.