Metadata-Version: 2.4
Name: gatecore-crewai
Version: 0.1.0
Summary: CrewAI tools for GateCore marketplace discovery, procurement, and governed execution
Author-email: GateCore AI LLC <hello@gatecoreai.com>
License-Expression: MIT
Project-URL: Homepage, https://gatecoreai.com
Project-URL: Repository, https://github.com/GateCoreAI-com/GateCoreAI
Classifier: Development Status :: 4 - Beta
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
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: crewai<1.16.0,>=1.15.2
Requires-Dist: gatecore-sdk<0.2.0,>=0.1.0
Requires-Dist: httpx<0.29.0,>=0.27.2
Requires-Dist: mcp<1.29.0,>=1.26.0
Dynamic: license-file

# gatecore-crewai

`gatecore-crewai` provides three CrewAI tools for GateCore marketplace discovery and
procurement, plus helpers that execute a procured capability through GateCore's signed gateway.
The adapter contains transport and configuration only; GateCore services enforce identity,
policy, trust, pricing, funding, delegation, and settlement.

The MCP tools support public `full`-mode GateCore endpoints only. `read` mode passes the server's
fail-closed procurement error through unchanged. `off` mode is unsupported because it does not
replace the adapter's legacy placeholder identity with the MCP credential identity.

This package intentionally duplicates the small adapter configuration, execution, and transport
modules. A shared adapter-core package is a future decision that waits until a third framework
adapter establishes the common surface.

## Install from the GateCore monorepo

```bash
python -m pip install -e ./libs/sdk -e ./libs/adapters/gatecore-crewai
```

## Install from PyPI (effective on publish)

*Effective once `gatecore-sdk` and this package have a real PyPI release — see
`.github/workflows/publish-pypi.yml`. Until then, use the monorepo install above.*

```bash
python -m pip install gatecore-crewai
```

## Configuration

Discovery and procurement require:

```text
GATECORE_MCP_URL=https://mcp.example.com/mcp
GATECORE_MCP_KEY=gcmk_...
```

`execute_procured` and `aexecute_procured` validate these variables lazily on first use:

```text
GATECORE_GATEWAY_URL=https://api.example.com
GATECORE_BEARER_TOKEN=...
GATECORE_AGENT_ID=agent:example
GATECORE_ACCESS_GRANT_ID=grant:example
GATECORE_KEY_ID=key:example
GATECORE_PRIVATE_KEY_PATH=/secure/path/agent-key.pem
```

Set exactly one of `GATECORE_PRIVATE_KEY_PATH` or `GATECORE_PRIVATE_KEY_PEM`.

## Usage

```python
from gatecore_crewai import GateCoreToolkit, execute_procured

tools = GateCoreToolkit().get_tools()
procure_result = tools[2].run(listing_id="listing:example")
decision = execute_procured(procure_result, {"query": "example"})
```

CrewAI tools are sync-native. Their synchronous implementation uses `asyncio.run()` for the MCP
transport and therefore must not be called from a thread that already owns a running event loop;
use `arun()` in async applications.
