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
- An API key; see Get an API key.
- An MCP client that supports Streamable HTTP and custom request headers. For clients without header support, use the SDKs or call the API directly.
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:
{
"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:
{
"mcpServers": {
"whale": {
"command": "whale-mcp",
"env": { "WHALE_API_KEY": "${WHALE_API_KEY}", "MCP_TRANSPORT": "stdio" }
}
}
}This configuration doesn’t install the program.
Verify
- Refresh the tool list and look for
whale_search. - Ask the AI to call it with
{"query": "artificial intelligence", "mode": "keyword", "limit": 10}. - If there are results, take a
document_idand callwhale_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
Open console MCP:
- Choose an application and enter its API key. Organization owners and admins can also generate a new key here; save it immediately.
- Click test. The console connects to the MCP server for real, sending
initialize,notifications/initializedandtools/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
| 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_searchsupports onlymode=keyword, which is also the default.limitdefaults to 20, up to 100.- Parameters mean the same as in keyword search.
When something fails
401: the client isn’t sending a valid key.403: outside the application’s access.429: wait forRetry-After.
Full list: Error codes.