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

# Detailed MCP integration guide

> Integrate ActionX as a remote MCP service into MCP-compatible clients and agent runtimes.

ActionX can expose monetization capabilities as MCP tools instead of relying only on a frontend SDK.

```mermaid theme={null}
flowchart LR
    register["Register MCP service"] --> auth["Attach API key"]
    auth --> call["Call ads.request"]
    call --> consume["Consume structuredContent.data.ads"]
```

## When to use MCP

* You already use an MCP-compatible client
* You want structured monetization results through tool calling
* You do not need the direct frontend rendering layer from the SDK

## Production endpoint

Recommended endpoint:

```text theme={null}
https://mcp.actionx.top/mcp
```

Legacy SSE-compatible paths:

* `GET https://mcp.actionx.top/sse?token=ak_your_api_key`
* `POST https://mcp.actionx.top/message?sessionId=<session_id>`

## Authentication

You can pass the token using any of the following methods:

* `Authorization: Bearer ak_your_api_key`
* `X-API-Key: ak_your_api_key`
* `?token=ak_your_api_key`

## Primary tool today

ActionX currently exposes one main MCP tool: `ads.request`

| Field      | Type    | Required | Description                                        |
| ---------- | ------- | -------- | -------------------------------------------------- |
| `query`    | string  | Yes      | The user query or prompt you want to match against |
| `response` | string  | No       | The assistant response content                     |
| `count`    | integer | No       | Number of results to return, defaults to `3`       |
| `user_id`  | string  | No       | Stable user identifier, recommended when available |

## Minimal tool input

```json theme={null}
{
  "query": "best bluetooth headset",
  "response": "Here are a few good options for work and travel.",
  "count": 3,
  "user_id": "u_001"
}
```

## How to read the returned result

* Tool output appears in both the text response and `structuredContent`.
* `structuredContent.data.ads` is the most important structured result to inspect.
* Each result usually includes a type, title, copy, image, and tracked click link.

## Integration steps

<Steps>
  <Step title="Register the remote MCP service">
    Point the client at `https://mcp.actionx.top/mcp`.
  </Step>

  <Step title="Attach an API key">
    `Authorization` or `X-API-Key` is the safest option.
  </Step>

  <Step title="Call ads.request">
    Pass at least `query`, and preferably `response` plus a stable `user_id`.
  </Step>

  <Step title="Consume the structured result">
    Read from `structuredContent.data.ads` and render or process the returned results.
  </Step>
</Steps>

## Additional note

Before an MCP session is created, the service validates the token. If validation fails, no session is created and no tool list or call result is returned.
