Metadata-Version: 2.4
Name: cortexhub
Version: 2.0.3
Summary: MCP gateway client for CortexHub programmatic agent access.
Project-URL: Homepage, https://cortexhub.ai
Project-URL: Documentation, https://docs.cortexhub.ai
Author-email: CortexHub <hello@cortexhub.ai>
License: MIT
License-File: LICENSE
Keywords: agents,ai,governance,mcp,programmatic
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# cortexhub

Official Python SDK for CortexHub programmatic MCP access.

[Documentation](https://docs.cortexhub.ai/docs/sdks/overview)

## Install

```bash
pip install cortexhub
```

## Credentials

Create an MCP OAuth client in CortexHub Cloud: **Account** → **MCP API access** → copy `client_id` and `client_secret`.

## Usage

```python
from cortexhub import Cortexhub

session = Cortexhub().session(
    agent="helpdesk-bot",
    mcp_session_id="chat-42",  # optional: separate conversations in Cloud
    conversation_title="Engineering standup",  # optional: shown to operators
    last_user_message="Create a standup page in Engineering Confluence",  # optional
)
# session.mcp.url and session.mcp.headers → pass to your MCP transport
```

## Configuration

| Variable | Default | Purpose |
|---|---|---|
| `CORTEXHUB_URL` | `https://mcp.cortexhub.ai` | MCP gateway and OAuth token base URL |
| `CORTEXHUB_CLIENT_ID` | — | MCP OAuth client id |
| `CORTEXHUB_CLIENT_SECRET` | — | MCP OAuth client secret |

Token exchange: `POST {CORTEXHUB_URL}/v1/mcp/oauth/token` (`client_credentials` or `refresh_token`).

## License

MIT.
