---
title: Use from AI Applications (MCP)
description: Connect MarsYoo to an MCP-capable AI application so it can search and read the data you have access to.
type: guide
status: stable
updated: 2026-12-03
url: /en/docs/mcp
markdown: /en/docs/mcp.md
---

Read as needed; not a required onboarding step. Path：[Data Access Path](/en/docs)

# Use from AI Applications (MCP)

By the end of this page you'll have MarsYoo connected to an MCP-capable AI application, so it can search and read data directly.

The AI uses your API key, with the same access as calling the API, and normal billing and rate limits apply. It never starts collecting new data on its own.

## Before you start [#prepare]

- An API key; see [Get an API key](/en/docs/authentication).
- An MCP client that supports Streamable HTTP and custom request headers. For clients without header support, use the [SDKs](/en/docs/sdk) or call the API directly.

## Connect [#connect]

Add a remote MCP server in your client:

| Setting | Value |
| --- | --- |
| URL | `https://www.marsyoo.com/mcp` |
| Transport | Streamable HTTP |
| Header | `Authorization: Bearer <your API key>` |

For clients that use the `mcpServers` format:


```json
{
  "mcpServers": {
    "whale": {
      "url": "https://www.marsyoo.com/mcp",
      "headers": { "Authorization": "Bearer ${WHALE_API_KEY}" }
    }
  }
}
```


> Note: Supply the key through the client's credential settings or environment variables. Never write the full key into a shared config file or paste it into a conversation.

If your client doesn't expand `${...}` variables, enter the header in its credential settings.

If you've installed the `whale-mcp` program on your `PATH`, you can also run it locally:


```json
{
  "mcpServers": {
    "whale": {
      "command": "whale-mcp",
      "env": { "WHALE_API_KEY": "${WHALE_API_KEY}", "MCP_TRANSPORT": "stdio" }
    }
  }
}
```


This configuration doesn't install the program.

## Verify [#verify]

1. Refresh the tool list and look for `whale_search`.
2. Ask the AI to call it with `{"query": "artificial intelligence", "mode": "keyword", "limit": 10}`.
3. If there are results, take a `document_id` and call `whale_get_document_content`.

If you can read a body, you're connected. An empty search doesn't mean the connection failed; try another keyword or check your access.

## Test the connection in the console [#console]

Open [console MCP](/en/portal/mcp):

1. Choose an application and enter its API key. Organization owners and admins can also generate a new key here; save it immediately.
2. Click test. The console connects to the MCP server for real, sending `initialize`, `notifications/initialized` and `tools/list`, and shows the available tools.

- The test checks only the connection and the tool list. It doesn't search or collect. Passing doesn't prove data access or credits.
- The key stays in page memory only and is cleared when you switch applications. Copied configuration templates contain no real key.

## Available tools [#tools]

| Tool | Use | Main parameters |
| --- | --- | --- |
| `whale_search` | Search stored documents | `query`, `mode`, `platforms`, `languages`, `published_from`, `published_to`, `limit` |
| `whale_get_document` | Document metadata and current version | `document_id` |
| `whale_get_document_content` | Full body | `document_id`, `version_id` |
| `whale_docs_search` | Search these customer docs and return matching pages, sections and links | `query`, `locale` (`zh` or `en`), `limit` |
| `whale_docs_read` | Read one customer docs page as Markdown | `path`, such as `/en/docs/search` |

Before writing integration code, an AI can look up endpoints and error codes with `whale_docs_search`, then read the whole page with `whale_docs_read`. These two tools read only the public customer docs and use no credits.

- `whale_search` supports only `mode=keyword`, which is also the default.
- `limit` defaults to 20, up to 100.
- Parameters mean the same as in [keyword search](/en/docs/search).

## When something fails [#errors]

- `401`: the client isn't sending a valid key.
- `403`: outside the application's access.
- `429`: wait for `Retry-After`.

Full list: [Error codes](/en/docs/errors).

## Continue Your Task

[Return to the integration path](/en/docs); return to your task after consulting this reference.
