> ## Documentation Index
> Fetch the complete documentation index at: https://docs.konbiniapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom agents

> Connect your own AI agent or framework to KonbiniAPI via the Model Context Protocol HTTP endpoint.

If you're building your own agent or using a framework that supports MCP, you can connect directly to the KonbiniAPI MCP server.

## Endpoint

```
https://mcp.konbiniapi.com
```

The server uses the [Streamable HTTP transport](https://modelcontextprotocol.io/specification/draft/basic/transports) and requires a Bearer token on every request.

## Authentication

The server implements [OAuth 2.0 with dynamic client registration](https://modelcontextprotocol.io/specification/draft/basic/authorization). Most MCP-compatible frameworks handle this automatically.

If your framework supports OAuth discovery, point it at the server URL and it will handle the flow:

```
GET https://mcp.konbiniapi.com/.well-known/oauth-protected-resource
GET https://mcp.konbiniapi.com/.well-known/oauth-authorization-server
```

The access token issued at the end of the flow is a native `knbn_` API key — it can also be used directly against the REST API.

## Making requests

Once authenticated, send MCP JSON-RPC requests to `POST /`:

```bash theme={null}
curl https://mcp.konbiniapi.com \
  -H "Authorization: Bearer knbn_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "tiktok_get_user",
      "arguments": {
        "username": "khaby.lame",
        "projection_preset": "minimal"
      }
    },
    "id": 1
  }'
```

## OpenAI Responses API

If you are building with the OpenAI Responses API, pass KonbiniAPI as an MCP
tool and send your KonbiniAPI API key in the `authorization` field:

```json theme={null}
{
  "model": "gpt-5",
  "input": "Fetch the TikTok profile for khaby.lame and keep the response minimal.",
  "tools": [
    {
      "type": "mcp",
      "server_label": "konbiniapi",
      "server_url": "https://mcp.konbiniapi.com",
      "authorization": "knbn_your_api_key",
      "require_approval": "never"
    }
  ]
}
```

That keeps KonbiniAPI remote while still working in environments where your app
manages OAuth or API keys itself.

## Testing with MCP Inspector

The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is a useful tool for exploring and testing the server:

```bash theme={null}
npx @modelcontextprotocol/inspector
```

Set the transport to **Streamable HTTP** and the URL to `https://mcp.konbiniapi.com`.

## Tools reference

See the [tools reference](/reference/mcp/tools/overview) for the full list of available tools, their parameters, and example inputs.
