# Remote MCP Server Integration

URL: https://interfaze.ai/docs/integrations/mcp-server

Interfaze ships a hosted [Model Context Protocol](https://modelcontextprotocol.io) server that exposes every Interfaze capability as MCP tools. Point any MCP-compatible client Cursor, Claude, VS Code, or your own agent at the server and it can search the web, scrape pages, run OCR, transcribe audio, detect objects, translate text, and forecast time series.

## Connection details

| Field         | Value                          |
| ------------- | ------------------------------ |
| URL           | `https://api.interfaze.ai/mcp` |
| Transport     | Streamable HTTP                |
| Authorization | `Bearer <your-api-key>`        |

Every request must include your Interfaze API key as a bearer token: `Authorization: Bearer <your-api-key>`

Get your API key from the [dashboard](https://interfaze.ai/dashboard).

> **Note:** The server is stateless — no session handshake is required, so you can send `tools/list` and `tools/call` requests directly.

## Available tools

| Tool               | Description                                                                                              |
| ------------------ | -------------------------------------------------------------------------------------------------------- |
| `ask_interfaze`    | Agentic entry point. Give it a natural-language task and it autonomously uses the tools below to answer. |
| `web_search`       | Search the web for current information.                                                                  |
| `scraper`          | Scrape a webpage and extract structured data.                                                            |
| `ocr`              | Extract text from images and PDF documents.                                                              |
| `speech_to_text`   | Transcribe speech from audio or video files.                                                             |
| `object_detection` | Detect objects in an image with bounding boxes.                                                          |
| `gui_detection`    | Detect GUI elements (buttons, inputs, links) in a screenshot for UI automation.                          |
| `translate`        | Translate text between languages.                                                                        |
| `forecast`         | Forecast time-series data from a historical series.                                                      |
| `get_upload_url`   | Get a presigned URL to upload a local file, then pass the returned URL to the file-based tools.          |

Prefer the task-specific tools when a request maps directly to one of them, and reach for `ask_interfaze` for multi-step or open-ended work.

## Connecting your client

### Cursor

Add the server to `.cursor/mcp.json` in your project (or the global `~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "interfaze": {
      "url": "https://api.interfaze.ai/mcp",
      "headers": {
        "Authorization": "Bearer <your-api-key>"
      }
    }
  }
}
```

### VS Code

Add the server to `.vscode/mcp.json`:

```json
{
  "servers": {
    "interfaze": {
      "type": "http",
      "url": "https://api.interfaze.ai/mcp",
      "headers": {
        "Authorization": "Bearer <your-api-key>"
      }
    }
  }
}
```

### Claude Code

Register the server with the CLI:

```bash
claude mcp add --transport http interfaze https://api.interfaze.ai/mcp \
  --header "Authorization: Bearer <your-api-key>"
```

### Claude Desktop & stdio-only clients

Some clients only speak the local stdio transport. Bridge to the remote server with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):

```json
{
  "mcpServers": {
    "interfaze": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.interfaze.ai/mcp", "--header", "Authorization: Bearer <your-api-key>"]
    }
  }
}
```

## Using the MCP SDK

Connect programmatically with the official MCP SDK and the Streamable HTTP transport.

**MCP SDK · typescript**

```typescript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(
  new URL("https://api.interfaze.ai/mcp"),
  {
    requestInit: {
      headers: { Authorization: `Bearer ${process.env.INTERFAZE_API_KEY}` },
    },
  }
);

const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(transport);

const { tools } = await client.listTools();
console.log(tools.map((t) => t.name));

const result = await client.callTool({
  name: "web_search",
  arguments: { prompt: "What are the latest updates to the OpenAI API?" },
});
console.log(result.content);
```

**MCP SDK · python**

```python
import asyncio, os
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async def main():
    headers = {"Authorization": f"Bearer {os.environ['INTERFAZE_API_KEY']}"}
    async with streamablehttp_client("https://api.interfaze.ai/mcp", headers=headers) as (
        read,
        write,
        _,
    ):
        async with ClientSession(read, write) as session:
            await session.initialize()

            tools = await session.list_tools()
            print([t.name for t in tools.tools])

            result = await session.call_tool(
                "web_search",
                {"prompt": "What are the latest updates to the OpenAI API?"},
            )
            print(result.content)

asyncio.run(main())
```

## Using with the Vercel AI SDK

The [Vercel AI SDK](https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools) can connect to the server and convert its tools into AI SDK tools automatically. Your main model then decides which Interfaze tool to call during the agent loop.

Install the dependencies:

```bash
npm install ai @ai-sdk/mcp @ai-sdk/openai
```

Connect over the recommended HTTP transport, pass your API key as a header, and hand the discovered tools to `generateText`:

```typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const mcpClient = await createMCPClient({
  transport: {
    type: "http",
    url: "https://api.interfaze.ai/mcp",
    headers: {
      Authorization: `Bearer ${process.env.INTERFAZE_API_KEY}`,
    },
  },
});

try {
  const tools = await mcpClient.tools();

  const { text } = await generateText({
    model: openai("gpt-5"),
    tools,
    stopWhen: stepCountIs(10),
    prompt: "Search the web for the latest updates to the OpenAI API and summarize the top results.",
  });

  console.log(text);
} finally {
  await mcpClient.close();
}
```

> **Note:** `mcpClient.tools()` loads all Interfaze tools. To limit which tools the model sees (and get full TypeScript types), pass a `schemas` object — see the [AI SDK MCP docs](https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools#schema-definition).

When streaming with `streamText`, close the client in the `onEnd` callback instead of a `finally` block so the connection stays open until the response finishes.
