# Server MCP
Datero expune un server [MCP (Model Context Protocol)](https://modelcontextprotocol.io) — agenții AI folosesc API-ul ca set de tool-uri, fără să scrie cod HTTP. Serverul rulează pe **Streamable HTTP**:

```
https://api.datero.ro/mcp
```

Fiecare tool MCP este aceeași operație ca endpoint-ul REST echivalent: aceeași validare, același cost în credite, aceleași limite, același contor per organizație.

## Conectare din clienți

**Claude (claude.ai / Claude Desktop):** Settings → Connectors → *Add custom connector* → URL: `https://api.datero.ro/mcp`. Autorizarea OAuth pornește automat.

**Claude Code:**

```bash
claude mcp add --transport http datero https://api.datero.ro/mcp
```

**Cursor / VS Code (sau orice client cu config JSON):**

```json
{
  "mcpServers": {
    "datero": {
      "url": "https://api.datero.ro/mcp"
    }
  }
}
```

**Acces programatic (fără OAuth):** trimite cheia API în header:

```json
{
  "mcpServers": {
    "datero": {
      "url": "https://api.datero.ro/mcp",
      "headers": { "Authorization": "Bearer dat_live_CHEIA_TA" }
    }
  }
}
```

## Tool-uri disponibile

| Tool | Ce face | Cost | Docs |
| --- | --- | --- | --- |
| `get_company` | Get a company by CUI | 1 credit | [detalii](/docs/api/companies/get) |
| `search_companies` | Search companies | 1 credit | [detalii](/docs/api/companies/search) |
| `search_caen_codes` | Search the CAEN Rev.3 classification | gratuit | [detalii](/docs/api/caen/search) |
| `get_caen_code` | Get a CAEN code with hierarchy and Rev.2 mapping | gratuit | [detalii](/docs/api/caen/get) |
| `search_counties` | List / search Romanian counties (județe) | gratuit | [detalii](/docs/api/locations/counties) |
| `search_cities` | Search Romanian localities (localități) | gratuit | [detalii](/docs/api/locations/cities) |
| `get_fx_rates` | BNR exchange rates for one day | gratuit | [detalii](/docs/api/fx/rates) |
| `get_fx_rate_history` | BNR exchange-rate history for one currency | gratuit | [detalii](/docs/api/fx/history) |
| `convert_currency` | Convert an amount between currencies at the BNR rate | gratuit | [detalii](/docs/api/fx/convert) |

Lista de mai sus este generată din același registru care servește API-ul — un tool nou apare aici automat. Costurile și creditele rămase vin pe fiecare răspuns în `_meta.creditsUsed` / `_meta.creditsRemaining`.
