Developer Documentation Protocol v2024-11-05

Model Context Protocol (MCP)

Seamlessly stream live tools, code executors, web search, and data stores into Cursor, Claude Desktop, autonomous agents, and Python SDKs.

Endpoints & Gateway Architecture

All MCP requests route through our edge gateway at https://api.wiserlab.ai. We support both scoped and unified streaming endpoints:

Endpoint Protocol Description
GET/POST /mcp/{server_slug} Streamable HTTP Scoped endpoint connecting directly to a specific MCP server (recommended for Cursor, Claude Desktop & Claude Code).
GET/POST /mcp Streamable HTTP Unified gateway aggregating all authorized MCP servers into a single multi-server session.
POST /mcp-rest/tools/call HTTPS POST Stateless REST execution for invoking a specific tool by name without maintaining a stream.
GET /mcp-rest/tools/list HTTPS GET OpenAI-compatible function definitions for all authorized tools in the catalog.
Active Server Endpoints
Server Slug Streamable HTTP URL
Smart Search Engine smart_search https://api.wiserlab.ai/mcp/smart_search
WiserLab Tools wiserlab https://api.wiserlab.ai/mcp/wiserlab

Authentication & Keys

Authentication uses your standard Wiser Lab API key (prefixed with wsl-...). Our gateway edge translates this token seamlessly. Both standard and LiteLLM headers are supported:

HTTP Authorization Headers
# Standard Bearer Auth:
Authorization: Bearer wsl-...

# Or LiteLLM Proxy Compatible Header:
x-litellm-api-key: Bearer wsl-...
User Integrations & Tool Credentials (GitHub, AWS, etc.)
Manage Integrations

Certain MCP servers (such as github_tools or cloud infrastructure tools) require personal authentication to access private repositories, resources, or files on your behalf. Wiser Lab supports two seamless options:

Option 1: Client Header Pass-Through

If you prefer not to store credentials in your account, add the custom header directly into your local IDE client config (Cursor, Windsurf, Claude Desktop):

"X-MCP-User-Token": "YOUR_TOKEN"
Option 2: Account Vault
Recommended

Connect your personal token (e.g. GitHub PAT or cloud access key) once in your Integrations Vault. Tokens are encrypted at rest with AES-128 and automatically attached when your IDE calls the tool.

Zero IDE Config

Cursor IDE Integration

To configure tools in Cursor, open Cursor Settings > Features > MCP or edit your project-level configuration file at .cursor/mcp.json:

.cursor/mcp.json
{
  "mcpServers": {
    "brave_search": {
      "url": "https://api.wiserlab.ai/mcp/brave_search",
      "headers": {
        "Authorization": "Bearer wsl-..."
      }
    },
    "github_tools": {
      "url": "https://api.wiserlab.ai/mcp/github_tools",
      "headers": {
        "Authorization": "Bearer wsl-..."
      }
    }
  }
}
Tip: After saving, Cursor will automatically connect and show green status indicators next to each server in the MCP settings panel.

Claude Desktop Integration

Edit your Claude Desktop configuration located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "brave_search": {
      "url": "https://api.wiserlab.ai/mcp/brave_search",
      "headers": {
        "Authorization": "Bearer wsl-..."
      }
    }
  }
}

Claude Code CLI Integration

To configure tools with the Claude Code CLI, add any active server directly via the terminal:

Terminal CLI Command
claude mcp add brave_search https://api.wiserlab.ai/mcp/brave_search \
  -H "Authorization: Bearer wsl-..."
Tip: Alternatively, you can supply the LiteLLM-compatible header: -H "x-litellm-api-key: Bearer wsl-..."

Codex Integration

For Codex CLI and extensions, configure remote MCP servers in ~/.codex/config.toml:

~/.codex/config.toml
[mcp_servers.brave_search]
url = "https://api.wiserlab.ai/mcp/brave_search"
transport = "http"
headers = { "Authorization" = "Bearer wsl-..." }

Windsurf & Continue.dev

For Codeium Windsurf, place your configuration in ~/.codeium/windsurf/mcp_config.json:

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "brave_search": {
      "serverUrl": "https://api.wiserlab.ai/mcp/brave_search",
      "headers": {
        "Authorization": "Bearer wsl-..."
      }
    }
  }
}

For Continue.dev in VS Code / JetBrains, place your configuration in ~/.continue/config.json:

~/.continue/config.json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "streamable-http",
          "url": "https://api.wiserlab.ai/mcp/brave_search",
          "requestOptions": {
            "headers": {
              "Authorization": "Bearer wsl-..."
            }
          }
        }
      }
    ]
  }
}

AGY (Antigravity) Integration

For Google Antigravity (AGY) CLI and IDE, configure your MCP servers in ~/.gemini/config/mcp_config.json or project workspace .agents/mcp_config.json:

~/.gemini/config/mcp_config.json
{
  "mcpServers": {
    "brave_search": {
      "serverUrl": "https://api.wiserlab.ai/mcp/brave_search",
      "headers": {
        "Authorization": "Bearer wsl-..."
      }
    }
  }
}
Tip: Tools are automatically discovered and registered into the agent's context upon conversation start.

OpenCode Integration

Configure OpenCode remote MCP servers in your project or global ~/.config/opencode/opencode.json:

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "brave_search": {
      "type": "remote",
      "url": "https://api.wiserlab.ai/mcp/brave_search",
      "headers": {
        "Authorization": "Bearer wsl-..."
      },
      "enabled": true
    }
  }
}

OpenClaw Agent Integration

For OpenClaw autonomous agents, you can register tools via the terminal CLI command or by configuring the JSON file:

Method 1: Terminal CLI Command (openclaw mcp set)
Terminal CLI Command
openclaw mcp set brave_search '{"url":"https://api.wiserlab.ai/mcp/brave_search","transport":"streamable-http","headers":{"Authorization":"Bearer wsl-..."}}'
Method 2: Config File (~/.openclaw/config.json)
~/.openclaw/config.json
{
  "mcp": {
    "servers": {
      "brave_search": {
        "url": "https://api.wiserlab.ai/mcp/brave_search",
        "transport": "streamable-http",
        "headers": {
          "Authorization": "Bearer wsl-..."
        }
      }
    }
  }
}
Tip: You can verify connectivity anytime using openclaw mcp doctor brave_search --probe.

Hermes Agent Integration

For NousResearch Hermes Agent, you can connect MCP servers via the terminal CLI command or by configuring the YAML file:

Method 1: Terminal CLI Command (hermes mcp add)
Terminal CLI Command
hermes mcp add brave_search --url https://api.wiserlab.ai/mcp/brave_search
Method 2: Config File (~/.hermes/config.yaml)
~/.hermes/config.yaml
mcp_servers:
  brave_search:
    url: "https://api.wiserlab.ai/mcp/brave_search"
    transport: "streamable-http"
    headers:
      Authorization: "Bearer wsl-..."
Tip: Run /reload-mcp inside Hermes chat or test the server with hermes mcp test brave_search.

Python SDK & Async Streams

Using the official Model Context Protocol Python SDK (pip install mcp):

agent_tool_caller.py
import asyncio
from mcp.client.streamable_http import streamablehttp_client
from mcp import ClientSession

async def run():
    endpoint = "https://api.wiserlab.ai/mcp/brave_search"
    headers = {"Authorization": "Bearer wsl-..."}

    async with streamablehttp_client(endpoint, headers=headers) as (read_stream, write_stream):
        async with ClientSession(read_stream, write_stream) as session:
            await session.initialize()
            
            # 1. Discover capabilities
            tools = await session.list_tools()
            print("Tools available:", [t.name for t in tools.tools])

            # 2. Execute a tool
            result = await session.call_tool(
                "brave_web_search",
                arguments={"query": "Wiser Lab AI high performance platform"}
            )
            print("Tool Result:", result.content)

asyncio.run(run())

Node.js SDK & TypeScript Integration

Connect via the official Model Context Protocol TypeScript SDK (npm install @modelcontextprotocol/sdk):

mcp-client.mjs
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(
  new URL("https://api.wiserlab.ai/mcp/brave_search"),
  {
    requestInit: {
      headers: {
        Authorization: "Bearer wsl-..."
      }
    }
  }
);

const client = new Client(
  { name: "wiserlab-node-agent", version: "1.0.0" },
  { capabilities: {} }
);

await client.connect(transport);

// 1. List available tools
const tools = await client.listTools();
console.log("Tools available:", tools.tools.map(t => t.name));

// 2. Call an MCP tool
const result = await client.callTool({
  name: "brave_web_search",
  arguments: { query: "Wiser Lab high performance AI cluster" }
});
console.log("Result:", result.content);

LLM Chat Completions with Automatic MCP Tools

When querying our OpenAI-compatible /v1/chat/completions endpoint, pass MCP servers directly in the tools array. The gateway automatically resolves tool schemas, queries the upstream MCP server during reasoning, and provides completed results to the model:

chat_with_mcp_tools.py (§12.5 Example A)
from openai import OpenAI

client = OpenAI(
    base_url="https://api.wiserlab.ai/v1",
    api_key="wsl-..."
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "user", "content": "What are the latest developments in quantum computing and TSLA stock price today?"}
    ],
    tools=[
        {
            "type": "mcp",
            "server_name": "brave_search"
        }
    ]
)

print(response.choices[0].message.content)

Direct REST Tool Invocation

If your backend or pipeline doesn't use the MCP streaming protocol, you can call any tool synchronously via standard HTTPS POST:

POST /mcp-rest/tools/call
curl -X POST https://api.wiserlab.ai/mcp-rest/tools/call \
  -H "Authorization: Bearer wsl-..." \
  -H "Content-Type: application/json" \
  -d '{
    "server_slug": "brave_search",
    "name": "brave_web_search",
    "arguments": {
      "query": "Quantum computing breakthroughs"
    }
  }'

Error Codes & Troubleshooting

Status Error Message Resolution
401 Unauthorized Invalid API key format Ensure your Authorization header starts with Bearer wsl-....
429 Too Many Requests Budget has been exceeded! Your balance has fallen to $0.00. Add AI credits in your Billing dashboard to restore instant access.
404 Not Found MCP server not found or inactive Check the server slug in the URL against our Server Catalog.
502 Bad Gateway MCP upstream connection failed The third-party upstream service or database is momentarily unreachable. The gateway automatically retries.
We use cookies to securely maintain your session, analyze our traffic, and improve your experience. By continuing to use our site, you agree to our Privacy Policy and Terms of Service.