Skip to main content

Python client for the clariBI MCP server. Typed tool methods auto-generated from the live tool catalog.

Project description

claribi-mcp

Python client for the clariBI MCP Server.

The clariBI MCP Server lets you sign up users, list dashboards, run analyses, and generate reports via the Model Context Protocol. This SDK is a thin synchronous JSON-RPC client built on httpx with one typed Python method per registered server tool:

from claribi_mcp import Client

with Client(api_key="claribi_mcp_...") as client:
    client.initialize()
    dashboards = client.list_dashboards()
    print(dashboards.structured["items"])

    result = client.run_analysis(question="What was revenue last quarter?")
    print(result.text)

Install

pip install claribi-mcp

Authentication

Either:

from claribi_mcp import Client, BearerTokenAuth

def refresh():
    new_token, new_expires_at = some_oauth_refresh()
    return new_token, new_expires_at

client = Client(
    auth=BearerTokenAuth(
        access_token=initial_token,
        expires_at=initial_expires_at,
        refresh_callable=refresh,
    ),
)

Tool surface

The SDK exposes one typed method per server tool. Methods are auto-generated from the live /api/mcp-server/tool-catalog/ endpoint so they always match what the server actually supports.

Headline methods (read-only):

  • client.list_dashboards(limit=20, offset=0, search=None)
  • client.get_dashboard(dashboard_id=...)
  • client.list_reports(...), client.get_report(...)
  • client.list_data_sources(...), client.get_data_source_schema(...)
  • client.get_usage(), client.get_billing_status()
  • client.check_pricing(tier=None)

Write methods (require analysis:run, reports:write, etc. scopes):

  • client.run_analysis(question=..., wait_seconds=30)
  • client.get_analysis_status(job_id=...)
  • client.generate_report(name=..., template_id=None, output_format='pdf')
  • client.create_checkout_session(tier='professional', billing_period='monthly')

Signup methods (no auth required):

  • client.register_account(email=..., organization_name=..., accept_terms=True)
  • client.verify_email(pending_id=..., code=..., password=...)

Sign up via SDK

client = Client()  # no auth — public tools only
pending = client.register_account(
    email="me@example.com",
    organization_name="My Team",
    accept_terms=True,
)
pending_id = pending.structured["pending_id"]
code = input("Enter the 6-digit code from your email: ")
verified = client.verify_email(
    pending_id=pending_id,
    code=code,
    password="a-strong-password",
)
api_key = verified.structured["mcp_api_key"]
print(f"Save this key: {api_key}")

Codegen

Regenerate the typed tool surface against your server:

python scripts/codegen.py \
    --catalog https://claribi.com/api/mcp-server/tool-catalog/ \
    --output  claribi_mcp/generated

License

MIT.

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

claribi_mcp-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

claribi_mcp-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file claribi_mcp-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for claribi_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf678514442c76cb264514507c5a056a9bd52b2708c7aa2a5f561e60d1be550d
MD5 54a312f52a0d7275e5995331cba033cf
BLAKE2b-256 dbedaaec70301dcc3e1998405bdbfdd49e0f66dea82f29afbbdba57a2137f624

See more details on using hashes here.

Provenance

The following attestation bundles were made for claribi_mcp-0.1.0.tar.gz:

Publisher: sdk-python.yml on ICS-cz/Claribi

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

File details

Details for the file claribi_mcp-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for claribi_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70fc883b335fa60c099a1ddce4da06e3c292db5e367c06f1e1a83c813f8cf4e4
MD5 81985966ddbd10c80666df35fd15bb22
BLAKE2b-256 5eaea7aa5a0e5501e8e9f79d400f000f38696a495d98acc1e6a76eb5fbc4f939

See more details on using hashes here.

Provenance

The following attestation bundles were made for claribi_mcp-0.1.0-py3-none-any.whl:

Publisher: sdk-python.yml on ICS-cz/Claribi

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