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 is still supported for interactive local OAuth login

Base URL resolution order:

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

Auth API URL resolution order:

  1. CTXD_AUTH_API_URL
  2. https://api.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.4.tar.gz (12.1 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.4-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ctxd-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d029d1e2a321d8295101b76290a8a64249eb3a2b18b5d32ff3e9b16c4688f748
MD5 354520de2adbc697671dc2894cb70dc1
BLAKE2b-256 7bba4fb68b5b9334d7bda571b8be8087d6a5120b866adf35b577b5f47e5f6002

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ctxd-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1bd4fd2a643be4a911b627a764747572c70f5fa89c904adc000b6d70bca5bcf4
MD5 f321688f67ab611ff18566861a4d85fc
BLAKE2b-256 f96bb429f3243689cd0423863d0ef327169ba203039f09c622a5a20a48f47ab1

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