Skip to main content

Public Python SDK and CLI for the ctxd platform.

Project description

ctxd

Public Python SDK and CLI for the ctxd platform.

Install:

pip install ctxd

The SDK exposes sync and async clients:

  • Client
  • AsyncClient

Authentication:

  1. Preferred for headless and scripts: create a user-bound API key through the authenticated application backend
  2. Provide it with Client(api_key=...) or CTXD_API_KEY
  3. The SDK sends that key as the bearer token directly to the MCP server
  4. ctxd login --api-key ... validates and stores an API key in the OS credential store for future CLI and SDK usage
  5. ctxd login without --api-key validates and stores CTXD_API_KEY, validates an existing secure-store key, or prompts for an API key when neither is available
  6. If the OS credential store is unavailable, use CTXD_API_KEY for CI/headless usage or explicitly set CTXD_CREDENTIAL_STORE=encrypted-file to store the API key in an encrypted local file

Base URL resolution order:

  1. base_url= passed to the client
  2. CTXD_BASE_URL
  3. ~/.ctxd/config.json
  4. https://mcp.ctxd.dev

Example:

from ctxd import Client

client = Client(api_key="297e24c4-4ee9-4739-828f-48f57f48ce11")

results = client.search("text:deployment application:slack")
profile = client.get_profile()
document = client.fetch_document("doc-123")

API key example:

from ctxd import Client

client = Client(api_key="297e24c4-4ee9-4739-828f-48f57f48ce11")
results = client.search("text:deployment application:slack")

Async example:

from ctxd import AsyncClient

async with AsyncClient(api_key="297e24c4-4ee9-4739-828f-48f57f48ce11") as client:
    results = await client.search("text:deployment")

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

ctxd-0.1.9.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

ctxd-0.1.9-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file ctxd-0.1.9.tar.gz.

File metadata

  • Download URL: ctxd-0.1.9.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.26

File hashes

Hashes for ctxd-0.1.9.tar.gz
Algorithm Hash digest
SHA256 ba6124dbd9424c7fa5dbc9e9c83899ee9191e89fde9e33edcd6cb850a85609d5
MD5 ac60f2745ec0e1053aeefa80cefd93bc
BLAKE2b-256 3f856db5118442999bcdfa4a07bac53b7b473f4ee46411c600162c2d8a3e5975

See more details on using hashes here.

File details

Details for the file ctxd-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: ctxd-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.26

File hashes

Hashes for ctxd-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f81270392be98fa95e52b5edac8ec17980b96cdd8c8cd6d30feeb616a4a317ed
MD5 529189456325fef5d65a1df58c9a3437
BLAKE2b-256 a3b50406dc2bd0380120ab047ca75f8f0d02b0613d48a9cb260853f27e1df6c3

See more details on using hashes here.

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