CRM AI Agent with Laravel MCP and Agent Kit - Relaticle  

 [Developer guides](https://relaticle.com/developers)

 CRM AI Agent with Laravel MCP and Agent Kit 
=============================================

Build a sales agent for Slack or Telegram with Laravel Agent Kit. It reads and updates Relaticle through the MCP server and asks before each write.

 Updated December 3, 2026

[Laravel Agent Kit](https://laravel.com/php/docs/agent-kit) is Laravel's starter kit for AI agents that work in Slack, Telegram and GitHub. This guide gives one of those agents your CRM. The agent answers questions from Relaticle in a chat thread. It asks for approval before it changes a record.

You add three things to a new Agent Kit application: a Relaticle client, an agent class and a bot.

---

[](#what-you-need "Permalink")What You Need
-------------------------------------------

- PHP 8.4 or higher and Composer, which Agent Kit requires
- An API key for an AI provider. Agent Kit uses OpenAI by default
- A Relaticle workspace where your role may create and update records

---

[](#create-the-application "Permalink")Create the Application
-------------------------------------------------------------

Create the application with Composer:

```
composer create-project laravel/agent-kit sales-agent

```

Then add your provider key to `.env`:

```
OPENAI_API_KEY=sk-your-key

```

---

[](#create-an-access-token "Permalink")Create an Access Token
-------------------------------------------------------------

The agent signs in to Relaticle with a personal access token. One token reaches one workspace, so create it for the workspace the agent should work in.

1. In Relaticle, open **Settings → Access Tokens** from your avatar menu.
2. Name the token and choose the workspace.
3. Under **Permissions**, tick **Read**, **Create** and **Update**. Leave **Delete** and the email permissions off.
4. Click **Create** and copy the token. Relaticle shows it once.

A new token has only **Read** ticked. An agent with a read-only token can still answer questions. Every write it tries returns `Invalid ability provided.`

The agent works as the member who created the token, with that member's role. The token expires on the date you choose, 180 days from now by default.

Add the token to `.env`:

```
MCP_RELATICLE_TOKEN=your-token

```

---

[](#add-the-relaticle-client "Permalink")Add the Relaticle Client
-----------------------------------------------------------------

`config/mcp.php` lists the MCP servers your application can call. Add Relaticle to its `clients` array:

```
'relaticle' => [
    'url' => env('MCP_RELATICLE_URL', 'https://mcp.relaticle.com'),
    'token' => env('MCP_RELATICLE_TOKEN'),
    'tools' => [
        'except' => [
            'delete-company-tool',
            'delete-people-tool',
            'delete-opportunity-tool',
            'delete-task-tool',
            'delete-note-tool',
        ],
    ],
],

```

The `except` list keeps the delete tools away from the agent, whatever the token allows.

A self-hosted install serves its MCP server at `/mcp` on its own domain. Point the client there in `.env`:

```
MCP_RELATICLE_URL=https://crm.example.com/mcp

```

---

[](#write-the-agent "Permalink")Write the Agent
-----------------------------------------------

Create `app/Ai/Agents/SalesAssistant.php`:

```
