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

# Build with AI coding agents

> Set up Claude Code or VS Code to configure Lorikeet agents and call them from your backend.

Your coding agent can build on Lorikeet for you. It configures agents, tools, guardrails and simulations through the Lorikeet MCP server, and it writes the backend code that talks to your agent with the Node SDK.

This page gives your coding agent four things:

1. A connection to the Lorikeet MCP server. The server also searches these docs for the agent (`search_documentation` and `get_documentation_page`).
2. Instructions for your `AGENTS.md` or `CLAUDE.md` file, which prevent the mistakes agents make most often on Lorikeet.
3. Prompts that you copy into your agent, one for each common task.
4. Tips for good results.

## Prerequisites

* A Lorikeet workspace.
* A coding agent that supports remote MCP servers with OAuth sign-in: Claude Code, or VS Code with GitHub Copilot.
* For backend code: Node.js 20 or later, and an API key pair from **Settings > Lorikeet API**. One key pair works for the REST API, the Node SDK and the MCP server.

## Connect the Lorikeet MCP server

The server URL is `https://mcp.lorikeetcx.ai` for every region. The first time your agent connects, a browser window opens so you can sign in to Lorikeet. The agent then works in the organization you choose.

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http lorikeet https://mcp.lorikeetcx.ai
> ```
>
> Then run `/mcp` in Claude Code and select **lorikeet** to sign in.

> [tab] VS Code
>
> Add the server to `.vscode/mcp.json` in your project:
>
> ```json theme={null}
> {
>   "servers": {
>     "lorikeet": {
>       "type": "http",
>       "url": "https://mcp.lorikeetcx.ai"
>     }
>   }
> }
> ```

> [!NOTE]
>
> Cursor cannot sign in to the Lorikeet MCP server yet, because the server does not accept its OAuth redirect.

To check the connection, ask your agent: "Call the Lorikeet whoami tool and tell me which workspace you are connected to."

For scripts and CI that run without a browser, use an API key pair instead. See [Headless and automated clients](https://docs.lorikeetcx.ai/mcp/headless-clients.md).

## Add agent instructions

Copy this block into `AGENTS.md` or `CLAUDE.md`. Your agent reads it at the start of each session.

```markdown AGENTS.md theme={null}
## Lorikeet

- Lorikeet is configured through the `lorikeet` MCP server. Call `whoami` first, and confirm the workspace name with the user before any write.
- Before you plan a configuration change, call `get_prompt` with `patterns`, then load the pattern that matches the task. Use `search_documentation` for product questions.
- Put rules that must always hold, such as who may delete what, in our API. A tool returns a status (for example `not_admin`), and the agent's instructions say what to reply for each status.
- Lorikeet calls our tools over public HTTPS. A tool that calls our API needs an API config (`save_api`), an auth config (`save_auth_config`) and an API tool (`save_tool`). A code tool cannot make network calls.
- To pass the signed-in user's identity to a tool, bind a tool input to `@subscriberToken` in the agent instructions, for example `@remove_member{userToken=@subscriberToken}`. Our backend sets `subscriberToken` when it creates the customer.
- An outcome that hands the conversation to a human must also have a `ReplyToCustomer` or a `PostInternalNote` action.
- `publish_agent` needs a completed simulation batch on the draft when the agent serves a channel. Create a test customer and a simulation, run it, then publish.
- On Pay as you go, a workspace has one agent. Add to it. Do not try to create a second one.
- Read `LORIKEET_CLIENT_ID` and `LORIKEET_CLIENT_SECRET` from the environment. Never print them or write them to a file other than `.env`.
```

## Prompts

Copy a prompt into your agent. Replace the text in angle brackets first.

> [accordion] Explore my workspace (read only)
>
> ```text theme={null}
> Use the lorikeet MCP server. Do not change anything.
> 1. Call whoami and tell me the workspace, brands, agents and environments.
> 2. For each agent, call get_agent_metadata and summarize its outcomes, guardrails and the channels it serves.
> 3. List the tools and APIs (search_tools, search_apis) and say which agent uses each one.
> Finish with a short table.
> ```

> [accordion] Give my agent a tool that calls my API
>
> ```text theme={null}
> Use the lorikeet MCP server. Confirm the workspace with me before any write.
> Goal: the agent can <do the task, for example "remove a workspace member"> by calling my API.
> 1. Call get_prompt with "patterns" and follow the pattern for an API tool.
> 2. My endpoint is <METHOD https://api.example.com/path>. It authenticates with the header <x-tool-secret>. Ask me for the secret value and do not print it.
> 3. Create the API config, the auth config and the tool. The tool input userToken is bound to @subscriberToken.
> 4. Update the agent instructions: ask the user to confirm before the tool runs, and say what to reply for each status the endpoint returns: <list the statuses>.
> 5. Run the tool once with run_tool and show me the response.
> Do not publish yet.
> ```

> [accordion] Add a guardrail and test it
>
> ```text theme={null}
> Use the lorikeet MCP server. Confirm the workspace with me before any write.
> Goal: a guardrail that blocks any reply that <describes the bad reply, for example "offers a discount">.
> 1. Call get_prompt with "build-guardrail" and follow it.
> 2. Before you save, call test_guardrail with the detection prompt on one reply that must be blocked and one that must pass. Show me both results.
> 3. Save the guardrail and attach it to <agent name>.
> ```

> [accordion] Simulate and publish
>
> ```text theme={null}
> Use the lorikeet MCP server. Confirm the workspace with me before any write.
> 1. Call get_prompt with "create-simulations" and follow it for <agent name>.
> 2. Create a test customer. If a tool input is bound to @subscriberToken and the customer has no value for it, set it in profile_variables.global.
> 3. Add tool mocks for every tool the scenario calls, so the simulation does not call my API.
> 4. Run the simulations against the draft. Show me any failure and its cause.
> 5. If every simulation passes, tell me which channels serve this agent, then publish only after I confirm.
> ```

> [accordion] Call my agent from my backend with the Node SDK
>
> ```text theme={null}
> Add Lorikeet to my backend with @lorikeetai/node-sdk.
> 1. Read LORIKEET_CLIENT_ID and LORIKEET_CLIENT_SECRET from the environment.
> 2. When a signed-in user opens the assistant, create a Lorikeet customer with lorikeet.customer.create. Set subscriberCustomerId to our user id and subscriberToken to a token our API can verify.
> 3. Start a conversation with lorikeet.conversation.chat.start, passing customerId and the chat widget public key from <where the key is stored>.
> 4. Send each user message with chat.generate. Then poll chat.get every 2 seconds, until a new bot response arrives or the status is Escalated or Error. Stop after 120 seconds.
> 5. Write a test that starts a conversation, sends "<a question>" and checks the reply.
> ```

## Tips for good results

* **Name the skill.** In Claude Code, start a prompt with `/lorikeet:<skill>`, for example `/lorikeet:create-simulations`. See [Running simulations from MCP](https://docs.lorikeetcx.ai/mcp/skills.md).
* **Read before write.** Ask the agent to read the current agent with `get_agent` and show you the change before it saves.
* **Test each step.** Use `run_tool` for tools, `test_guardrail` for guardrails and simulations for the whole agent, before you publish.
* **Keep the config in code.** For a repeatable setup, ask the agent to write a script that makes the same MCP calls, and run it again after each change.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.