---
title: Integration Libraries
lastUpdated: '2026-05-31'
nextjs:
  metadata:
    title: Integration Libraries - REST API, MCP, and language guides
    description: Current Hive Intelligence integration docs for REST and MCP, with working examples for JavaScript, Python, Go, Java, and Rust.
    alternates:
      canonical: https://www.hiveintelligence.xyz/sdk
---


Hive exposes two integration surfaces:

- **REST API** for application code and backend services
- **MCP** for AI agents, assistants, and tool-aware runtimes

{% ai-doc-actions path="/sdk" title="Integration Libraries" /%}

---

## Current REST Contract

**Base URL:** `https://mcp.hiveintelligence.xyz`

| Action | Endpoint | Notes |
|--------|----------|-------|
| Discover tools | `GET /api/v1/tools` | Use this to inspect the live catalog and schemas |
| Execute a tool | `POST /api/v1/execute` | Send JSON with `tool` and `args` |

Older REST examples that use `toolName` and `arguments` are legacy.

### Execute Example

```bash
curl -X POST https://mcp.hiveintelligence.xyz/api/v1/execute \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_HIVE_API_KEY" \
  -d '{
    "tool": "get_price",
    "args": {
      "ids": "bitcoin",
      "vs_currencies": "usd"
    }
  }'
```

### Response Example

```json
{
  "ok": true,
  "data": {
    "bitcoin": {
      "usd": 67234.0
    },
    "_hive": {
      "tool": "get_price",
      "provider": "CoinGecko",
      "runtime_status": "ok",
      "fetched_at": "2026-05-30T14:23:18.000Z"
    }
  },
  "meta": {
    "tool": "get_price",
    "provider": "CoinGecko",
    "runtime_status": "ok",
    "fetched_at": "2026-05-30T14:23:18.000Z"
  }
}
```

REST execution returns `{ ok, data, meta }`. The provider-shaped result lives inside `data`, and Hive adds execution metadata such as `runtime_status`, `fetched_at`, `duration_ms`, cache state, and warnings in `meta` and the nested `data._hive` block. Validate the provider fields inside `data` against each tool schema rather than assuming one universal provider object.

---

## MCP For Agents

Use the root MCP server when you want resource discovery and schema lookup:

```json
{
  "mcpServers": {
    "hive-intelligence": {
      "url": "https://mcp.hiveintelligence.xyz/mcp"
    }
  }
}
```

Use category-scoped MCP endpoints when you want a smaller direct `tools/list` surface, for example:

- `/hive_market_data/mcp`
- `/hive_security_risk/mcp`
- `/hive_portfolio_wallet/mcp`
- `/hive_prediction_markets/mcp`

Helpful MCP discovery resources:

- `hive://tools`
- `hive://providers`
- `hive://categories`

---

## Language Guides

| Guide | Status | Focus |
|-------|--------|-------|
| [JavaScript / TypeScript](/sdk/javascript) | REST guide plus official MCP adapter on npm | Browser, Node.js, Deno, Bun, and TypeScript-first integrations. The adapter is published on npm as `hive-mcp-client@0.1.5` (`npm install hive-mcp-client`); its source is public in [`github.com/hive-intel/hive-sdk`](https://github.com/hive-intel/hive-sdk) under [`client/`](https://github.com/hive-intel/hive-sdk/tree/main/client). |
| [Python integration](/sdk/python) | Community-maintained package disclosed | REST examples for scripts, data pipelines, and backend services. The PyPI package is maintained outside the canonical Hive MCP source repo, so production workloads should call the REST API directly until an official Python SDK ships. |
| Other languages | Use the REST API | Go, Java, Rust, Ruby, .NET, and any other backend can call [`POST /api/v1/execute`](/api-integration) — same auth header and same REST execution contract. |

---

## Minimal Examples

### Python

```python
import requests

response = requests.post(
    "https://mcp.hiveintelligence.xyz/api/v1/execute",
    headers={"Authorization": "Bearer YOUR_HIVE_API_KEY"},
    json={
        "tool": "get_price",
        "args": {"ids": "bitcoin", "vs_currencies": "usd"},
    },
    timeout=30,
)

response.raise_for_status()
payload = response.json()
if not payload.get("ok", False):
    raise RuntimeError(payload.get("error", {}).get("message", "Hive execution failed"))

print(payload["data"]["bitcoin"]["usd"])
print(payload["meta"]["fetched_at"])
```

### JavaScript

```javascript
const response = await fetch("https://mcp.hiveintelligence.xyz/api/v1/execute", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${process.env.HIVE_API_KEY}`,
  },
  body: JSON.stringify({
    tool: "get_price",
    args: { ids: "bitcoin", vs_currencies: "usd" },
  }),
});

if (!response.ok) {
  throw new Error(`Hive request failed: ${response.status} ${await response.text()}`);
}

const payload = await response.json();
if (payload.ok === false) {
  throw new Error(payload.error?.message ?? "Hive execution failed");
}

console.log(payload.data.bitcoin.usd);
console.log(payload.meta.fetched_at);
```

### Go

```go
payload := map[string]any{
    "tool": "get_price",
    "args": map[string]any{
        "ids": "bitcoin",
        "vs_currencies": "usd",
    },
}
```

### Java

```java
Map<String, Object> payload = Map.of(
    "tool", "get_price",
    "args", Map.of("ids", "bitcoin", "vs_currencies", "usd")
);
```

### Rust

```rust
let payload = json!({
    "tool": "get_price",
    "args": { "ids": "bitcoin", "vs_currencies": "usd" }
});
```

---

## Related

- [API Integration](/api-integration)
- [Quick Start](/quick-start)
- [Live Catalog](/tools/live-catalog)
