> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getovra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CrewAI

> Give a CrewAI team Ovra payment capabilities with role separation.

[CrewAI](https://crewai.com) orchestrates specialized agents as a team — purchaser, auditor, reporter. Ovra's MCP server connects natively; each role gets the same tool surface but with different instructions and goals.

<Note>
  Sandbox-only today. Use a `sk_sandbox_*` or `sk_test_*` key.
</Note>

## Install

```bash theme={}
pip install crewai mcp
```

## Setup

```python theme={}
from crewai import Agent, Task, Crew
from crewai.mcp import MCPServerHTTP

ovra_server = MCPServerHTTP(
    url="https://api.getovra.com/api/mcp",
    headers={"Authorization": "Bearer sk_sandbox_..."},
    streamable=True,
)

purchasing = Agent(
    role="Purchasing Agent",
    goal="Find and buy products under budget",
    backstory="Expert online shopper with payment authority",
    mcps=[ovra_server],
)

auditor = Agent(
    role="Compliance Auditor",
    goal="Verify every purchase complies with policy and is receipt-attached",
    backstory="Financial-controls specialist",
    mcps=[ovra_server],
)
```

## Multi-agent workflow

```python theme={}
purchase_task = Task(
    description="Buy a USB-C hub under EUR 30 on amazon.de",
    expected_output="Order confirmation with transaction ID",
    agent=purchasing,
)

audit_task = Task(
    description=(
        "Verify the purchase complies with policy and attach the receipt. "
        "Surface any policy advisories."
    ),
    expected_output="Compliance report with intent ID, transaction ID, and policy decision",
    agent=auditor,
)

crew = Crew(
    agents=[purchasing, auditor],
    tasks=[purchase_task, audit_task],
    verbose=True,
)

result = crew.kickoff()
```

## Tool usage by role

```text theme={}
Purchasing:
  ovra_intent { declare }
  ovra_pay    { checkout }   <- MPP-aware merchant
  ovra_intent { verify }

Auditor:
  ovra_transaction { get }
  ovra_policy      { get }
  ovra_receipt     { upload }   <- attaches PDF evidence
  ovra_outcome     { report }
```

## Why CrewAI

* **Role-based agents** — separate purchasing, auditing, reporting concerns
* **Policy enforcement** — Ovra validates every charge regardless of which agent triggered it
* **Receipt chain** — auditor attaches receipts; chain is audit-logged

## Recommended tools to expose

| Tool               | Purpose                |
| ------------------ | ---------------------- |
| `ovra_pay`         | Full flow in one call  |
| `ovra_intent`      | Declare and verify     |
| `ovra_credential`  | Fine-grained lifecycle |
| `ovra_transaction` | Audit history          |
| `ovra_receipt`     | Attach evidence        |
| `ovra_policy`      | Read before declaring  |
| `ovra_outcome`     | Report results         |

## Next

<CardGroup cols={2}>
  <Card title="MCP overview" icon="info" href="/mcp/overview">
    Architecture and the full 19-tool list.
  </Card>

  <Card title="OpenAI Agents" icon="brain" href="/integrations/openai-agents">
    Hosted MCP integration.
  </Card>

  <Card title="LangGraph" icon="diagram-project" href="/integrations/langgraph">
    Stateful graph workflows.
  </Card>
</CardGroup>
