Tutorials & Integrations

Integration Libraries

Written by , Product docsLast updated

Hive exposes two integration surfaces:

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

Current REST contract

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

ActionEndpointNotes
Discover toolsGET /api/v1/toolsUse this to inspect the live catalog and schemas
Execute a toolPOST /api/v1/executeSend 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": {
      "receipt_id": "3f6f0ad4-7f43-4b8f-92d8-2d4dc2db7f4e",
      "receipt_version": "1.0",
      "tool": "get_price",
      "provider": "CoinGecko",
      "runtime_status": "ok",
      "fetched_at": "2026-07-11T14:23:18.000Z",
      "observed_at": "2026-07-11T14:23:18.000Z",
      "cache_age_ms": 0,
      "source": "live"
    }
  },
  "meta": {
    "receipt_id": "3f6f0ad4-7f43-4b8f-92d8-2d4dc2db7f4e",
    "receipt_version": "1.0",
    "tool": "get_price",
    "provider": "CoinGecko",
    "runtime_status": "ok",
    "fetched_at": "2026-07-11T14:23:18.000Z",
    "observed_at": "2026-07-11T14:23:18.000Z",
    "cache_age_ms": 0,
    "source": "live"
  }
}

REST execution returns { ok, data, meta }. The provider-shaped result lives inside data, and Hive adds execution metadata in meta and the nested data._hive block. fetched_at, observed_at, cache_age_ms, source, and cache_status describe Hive's retrieval/cache timeline; provider-native timestamps, blocks, slots, or candle closes establish source recency when present. Preserve receipt_id and receipt_version for support and multi-call correlation. Validate 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

GuideStatusFocus
JavaScript / TypeScriptREST guide plus official MCP adapterBrowser, Node.js, Deno, Bun, and TypeScript-first integrations. npm is currently hive-mcp-client@0.1.5; the public github.com/hive-intel/hive-sdk mirror under client/ contains the 0.2.0 release candidate. Verify npm before using new APIs.
Python integrationCommunity-maintained package disclosedREST 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 languagesUse the REST APIGo, Java, Rust, Ruby, .NET, and any other backend can call POST /api/v1/execute with the same auth header and the 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({
    "retrieved_at": payload["meta"]["fetched_at"],
    "observed_at": payload["meta"].get("observed_at"),
    "cache_age_ms": payload["meta"].get("cache_age_ms"),
    "receipt_id": payload["meta"]["receipt_id"],
    "receipt_version": payload["meta"]["receipt_version"],
})

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({
  retrievedAt: payload.meta.fetched_at,
  observedAt: payload.meta.observed_at,
  cacheAgeMs: payload.meta.cache_age_ms,
  receiptId: payload.meta.receipt_id,
  receiptVersion: payload.meta.receipt_version,
});

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" }
});