Skip to main content

Installable CLI and MCP tools for the Esheria Regulatory Pack API.

Project description

Esheria CLI And MCP

Installable command-line and MCP tools for the Esheria Regulatory Pack API.

The package exposes two commands:

esheria --help
esheria-mcp --help

Version 1.0.0 is the production/stable public release. The CLI, Python client, and MCP software distributed in the esheria Python package are licensed under the Apache License 2.0. Hosted API/MCP access, regulatory data, service outputs, and Esheria trademarks are not licensed under Apache-2.0; they remain governed by the Esheria Terms of Service, Privacy Policy, and any applicable customer agreement. See LICENSE and NOTICE for the exact boundary.

CLI Quickstart

  1. Create a data API token in the Esheria dashboard.
  2. Install the command. pipx is recommended because it keeps command-line tools isolated from project dependencies:
pipx install esheria

If you do not use pipx, use normal pip:

python3 -m pip install esheria
  1. Configure your shell. Put these in your terminal for a one-off test, or in ~/.zshrc, ~/.bashrc, or your shell profile to keep them:
export ESHERIA_API_BASE_URL="https://api.esheria.ai"
export ESHERIA_API_KEY="<client-api-key>"

PowerShell:

$env:ESHERIA_API_BASE_URL = "https://api.esheria.ai"
$env:ESHERIA_API_KEY = "<client-api-key>"

ESHERIA_API_TOKEN is also accepted as an alias when ESHERIA_API_KEY is unset.

Do not commit API keys. The CLI and MCP server read credentials from environment variables or command-line flags and redact API key values from diagnostic output. Prefer the environment variable: --api-key can be exposed through shell history or the operating-system process list.

  1. Confirm the API is reachable:
esheria --version
esheria health --format json
esheria ready --format json
  1. Discover packs, choose a domain_pack_id, then pass that pack ID to pack-specific commands:
esheria packs list --format json
export ESHERIA_PACK_ID="UK-DATA-PROTECTION-PRIVACY"
esheria packs inspect "$ESHERIA_PACK_ID" --format json
esheria packs versions "$ESHERIA_PACK_ID" --format json
esheria packs diff "$ESHERIA_PACK_ID" --format json
esheria packs change-events "$ESHERIA_PACK_ID" --format json
esheria obligations list "$ESHERIA_PACK_ID" --limit 3 --format json
esheria penalties list "$ESHERIA_PACK_ID" --limit 5 --format json
esheria legal-review audit "$ESHERIA_PACK_ID" --limit 5 --format json

Output flags can be placed globally or on a leaf command:

esheria --format json packs list
esheria packs list --format json

Use esheria --help and <group> --help to discover the full command tree. The CLI includes source-watch operations, graph coverage/rebuild operations, workspace-scoped customer lifecycle commands, and workspace/token/billing management commands in addition to the read workflows above.

Workspace, token, and billing commands require a management token. Normal dashboard-created and OAuth connector tokens carry only regulatory:read. State-changing regulatory workflows require an explicitly created operator data token with one or more of monitoring:write, graph:write, or customer:write; regulatory:read alone is rejected. For example:

esheria tokens create \
  --name "Monitoring operator" \
  --scope regulatory:read \
  --scope monitoring:write \
  --pack UK-DATA-USE-AND-ACCESS

The dashboard remains the recommended place for self-serve workspace, token, billing, and subscription administration. Keep operator tokens short-lived and grant only the scopes and pack entitlements they require.

The CLI and MCP server are catalog-first: users list packs and then call tools with the explicit pack ID they want. ESHERIA_DEFAULT_PACK_ID is an optional client preference, not a server-side jurisdiction default.

The CLI reports the API's readiness labels, limitations, citations, and trace IDs; preserve them in downstream workflows. Published packs may represent a reviewed subset of the full legal corpus, and evaluator-gated claim verification is not available for every pack. Esheria output is regulatory intelligence, not legal advice or a substitute for qualified counsel.

Hosted MCP

Production MCP uses the hosted Esheria endpoint:

https://mcp.esheria.ai/mcp

Use this endpoint for normal customer onboarding. It avoids local Python, uvx, virtual environments, and package discovery on the user's machine.

Agent hosts send the dashboard-created Esheria data token as a bearer token. The hosted MCP server forwards that token to the Regulatory Pack API, so normal API billing, pack entitlements, trace IDs, and published-only behavior still apply.

Public discovery works without a token, but tool and resource calls that read regulatory data require Authorization: Bearer <token> or X-API-Key: <token>.

Codex MCP

Set the token where Codex can read it:

export ESHERIA_API_KEY="<client-api-key>"

Edit ~/.codex/config.toml and add:

[mcp_servers.esheria]
url = "https://mcp.esheria.ai/mcp"
bearer_token_env_var = "ESHERIA_API_KEY"

Restart Codex, then call esheria_health, esheria_ready, and esheria_list_packs.

Local MCP Fallback

For local development, or for agent hosts that do not support remote MCP URLs, you can run the stdio server yourself:

esheria-mcp serve --stdio

Operator-only HTTP transport command:

ESHERIA_API_BASE_URL="https://api.esheria.ai" \
  esheria-mcp serve --http --host 127.0.0.1 --port 8081 --path /mcp

Production is already deployed at https://mcp.esheria.ai/mcp; end users should not run this command.

The Claude Directory OAuth profile exposes a read-only 20-tool catalog for health, readiness, pack discovery, obligations, applicability, claim verification, versions, diffs, change events, filing calendars, evidence, penalties, audit metadata, relationship queries, exports, and citation context. Legacy API-key MCP sessions also expose selected source-monitoring, graph rebuild, and persisted customer-lifecycle mutations. The API executes those tools only when the supplied token has the corresponding monitoring:write, graph:write, or customer:write scope; OAuth Directory sessions remain read-only.

Use stdio only for hosts that do not support remote MCP URLs:

[mcp_servers.esheria]
command = "uvx"
args = ["--from", "esheria", "esheria-mcp", "serve", "--stdio"]
env = { ESHERIA_API_BASE_URL = "https://api.esheria.ai", ESHERIA_API_KEY = "<client-api-key>" }

Claude Code

Use Claude Code's remote MCP setup when your installed version exposes it:

  • URL: https://mcp.esheria.ai/mcp
  • Authorization: Bearer <client-api-key>

If your Claude Code version only supports local stdio MCP servers, run this fallback once from a terminal:

claude mcp add --scope user --transport stdio \
  --env ESHERIA_API_BASE_URL=https://api.esheria.ai \
  --env ESHERIA_API_KEY=<client-api-key> \
  esheria -- uvx --from esheria esheria-mcp serve --stdio

Then run:

claude mcp list

Start or restart Claude Code and ask it to use the Esheria MCP tools.

Claude Desktop

Use Claude Desktop's remote MCP setup when your installed version exposes it:

  • URL: https://mcp.esheria.ai/mcp
  • Authorization: Bearer <client-api-key>

If your Claude Desktop version only supports local stdio MCP servers, use the fallback below.

Open the Claude Desktop MCP config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add or merge this object:

{
  "mcpServers": {
    "esheria": {
      "command": "uvx",
      "args": ["--from", "esheria", "esheria-mcp", "serve", "--stdio"],
      "env": {
        "ESHERIA_API_BASE_URL": "https://api.esheria.ai",
        "ESHERIA_API_KEY": "<client-api-key>"
      }
    }
  }
}

Restart Claude Desktop after saving the file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esheria-1.0.0.tar.gz (49.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

esheria-1.0.0-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file esheria-1.0.0.tar.gz.

File metadata

  • Download URL: esheria-1.0.0.tar.gz
  • Upload date:
  • Size: 49.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for esheria-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e9d329da26e49160b6a1ef983753b50a8601d8627400ddd8aa20a0d20249b913
MD5 ee4f66a7ff1f40f026854145a51d8fda
BLAKE2b-256 27832a75ff1f0c44d8b2258842b4bbcf46bbd19096787417ebbbecf51b76a245

See more details on using hashes here.

Provenance

The following attestation bundles were made for esheria-1.0.0.tar.gz:

Publisher: publish-pypi.yml on esherialabs/esheria-regulatory-intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file esheria-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: esheria-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for esheria-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 746e153894292a39f92d2eb7791004bbd84149578aa4da47c0362855ee20b1fd
MD5 63d11a2b0ac1b2ab79f20c28b4bf7d85
BLAKE2b-256 dbd84999c10a20019d4739ec8c539c8acf6ad1722e9e94feeed95d16595559bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for esheria-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on esherialabs/esheria-regulatory-intelligence

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page