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": {
      "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

GuideStatusFocus
JavaScript / TypeScriptREST guide plus official MCP adapter on npmBrowser, 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 under client/.
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(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" }
});