> For the complete documentation index, see [llms.txt](https://docs.kickbot.com/dashboard/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kickbot.com/dashboard/api/build-an-agent.md).

# Build your own agent

Point your own AI agent at the KickBot MCP server with an API key, and follow an example flow that sets up commands, timed messages, and TTS for a channel.

Any agent framework that supports remote MCP servers (Streamable HTTP) can use KickBot. Give it:

* **Server URL:** `https://kickbot.com/api/v1/mcp`
* **Header:** `Authorization: Bearer kb_live_...` (an [API key](/dashboard/api/api-keys.md))

The server also sends instructions to the agent when it connects. A longer guide for agents, with every tool and field, is at [kickbot.com/api/v1/mcp.md](https://kickbot.com/api/v1/mcp.md). You can give that file to an agent as context.

## Example agent flow

A request like "Set up my channel for a chill Minecraft stream" usually goes like this:

1. **`get_account_overview`.** The agent learns the plan, the limits (for example 5 enabled custom commands on the free plan), and which areas it can use. If KickBot is not a moderator yet, it asks you to type `/mod KickBot` in your Kick chat and then calls `check_moderator_status`.
2. **`list_commands`, `list_timers`, `get_tts_settings`.** The agent reads what exists before it changes anything. `get_channel_activity` shows what your viewers use most.
3. **`set_command_by_name`** for `discord`, `socials`, and `lurk`. Running it again later does not make duplicates.
4. **`create_timer`** with a follow reminder every 30 minutes.
5. **`update_tts_settings`** to set the max message length and cooldowns.
6. The agent reports what it changed. You can check the same list in **API & MCP > Recent API activity** in the dashboard.

## Test the server with curl

MCP is JSON-RPC over HTTP POST. You can try it without an agent:

```bash
curl https://kickbot.com/api/v1/mcp \
  -H "Authorization: Bearer $KICKBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

Call a tool:

```bash
curl https://kickbot.com/api/v1/mcp \
  -H "Authorization: Bearer $KICKBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_account_overview","arguments":{}}}'
```

A tool error comes back as a normal result with `isError: true` and an error `code`, so the agent can read it and react. For example, `limit_reached` means the free plan blocks the change.

## Tips for reliable agents

* Use a **read-only key** for agents that only report on your channel.
* Keep the key in an environment variable or a secret store, never in the prompt.
* Prefer `set_*_by_name` and `update_*` tools: they are safe to run again.
* Respect `rate_limited` errors. Wait for `retry_after_seconds`, then try again.
* Changes apply to the live channel at once. Ask the agent to confirm big changes with you first.

## Need help?

Email <support@kickbot.com> or visit the `#support` channel on [Discord](https://discord.gg/MAg3gBbc89).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kickbot.com/dashboard/api/build-an-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
