Skip to main content

Installation

Requirements​

  • Python 3.10 or newer.
  • An external agent registered in CortexHub.
  • An API key beginning with cxh_key_, or a programmatic MCP OAuth client.

Install​

pip install cortexhub
pip install "cortexhub[ai]"
pip install "cortexhub[mcp]"
pip install "cortexhub[all]"

The core package builds connection objects. The ai extra provides the OpenAI-compatible client and the mcp extra provides the official MCP client support.

Environment variables​

VariableDefaultUsed by
CORTEXHUB_API_KEYnoneAgent API key
CORTEXHUB_URLhttps://mcp.cortexhub.aiMCP connection and OAuth token requests
CORTEXHUB_ROUTER_URLhttps://api.cortexhub.ai/v1AI gateway
CORTEXHUB_CLIENT_IDnoneProgrammatic MCP OAuth
CORTEXHUB_CLIENT_SECRETnoneProgrammatic MCP OAuth
from cortexhub import Cortexhub

cx = Cortexhub()

Keep credentials out of source control and application logs. If both API-key and OAuth credentials are configured, the API-key path takes precedence.

Next steps​