Skip to content

MCP Server (PHP)

The Daktela MCP Server is a read-only Model Context Protocol (MCP) server for the Daktela Contact Centre REST API v6. It allows AI assistants such as Claude, ChatGPT, and other LLM-based clients to access and analyse your contact centre data directly.

What is MCP?

The Model Context Protocol is an open standard that lets AI applications connect to external data sources and tools. By running the Daktela MCP Server, you give your AI assistant structured, read-only access to your Daktela instance -- enabling tasks like email quality audits, sales pipeline reviews, and call analysis without writing any code.

Info

The MCP server provides read-only access to your Daktela data. It cannot create, modify, or delete any records in your instance.


Requirements

  • PHP 8.2 or higher
  • Composer (PHP package manager)
  • A Daktela instance with API read access
  • An API Access Token from your Daktela account

Installation

  1. Clone the repository:

    git clone https://github.com/Daktela/daktela-v6-php-mcp-server.git
    cd daktela-v6-php-mcp-server
    
  2. Install dependencies:

    composer install
    

Configuration

The server is configured using environment variables. Create a .env file based on the provided example, or pass the variables directly when running the server.

Variable Required Default Description
DAKTELA_URL Yes β€” Your Daktela instance URL, e.g. https://your-instance.daktela.com
DAKTELA_ACCESS_TOKEN Yes β€” API Access Token from your Daktela account
CACHE_ENABLED No true Enable caching of reference data (queues, users, statuses, etc.)
CACHE_TTL_SECONDS No 3600 Cache duration in seconds

Tip

You can generate an API Access Token in your Daktela instance under Manage > Users > Edit user > Access Tokens.


Deployment Options

The MCP server supports two transport modes: stdio (for local AI desktop apps) and HTTP (for remote/cloud deployments).

Claude Desktop -- Docker

This is the recommended approach. Build the Docker image and configure Claude Desktop to use it.

  1. Build the image:

    docker build -f Dockerfile.prod -t daktela-v6-php-mcp-server .
    
  2. Add the following to your claude_desktop_config.json:

    {
      "mcpServers": {
        "daktela": {
          "command": "docker",
          "args": [
            "run", "-i", "--rm",
            "-e", "DAKTELA_URL=https://your-instance.daktela.com",
            "-e", "DAKTELA_ACCESS_TOKEN=your-api-token",
            "daktela-v6-php-mcp-server"
          ]
        }
      }
    }
    

Claude Desktop -- Direct PHP

If you prefer to run PHP directly without Docker:

{
  "mcpServers": {
    "daktela": {
      "command": "php",
      "args": ["/path/to/daktela-v6-php-mcp-server/bin/server.php"],
      "env": {
        "DAKTELA_URL": "https://your-instance.daktela.com",
        "DAKTELA_ACCESS_TOKEN": "your-api-token"
      }
    }
  }
}

Docker -- Standalone

Run the server as a standalone Docker container:

docker run -i --rm \
  -e DAKTELA_URL=https://your-instance.daktela.com \
  -e DAKTELA_ACCESS_TOKEN=your-api-token \
  daktela-v6-php-mcp-server

HTTP Server Mode (Cloud Deployment)

For remote deployments such as Google Cloud Run, the server operates in HTTP mode where clients pass credentials via headers:

docker run --rm -p 8080:8080 \
  -e DAKTELA_URL=https://your-instance.daktela.com \
  -e DAKTELA_ACCESS_TOKEN=your-api-token \
  daktela-v6-php-mcp-server php bin/http-server.php

Example cloud deployment with Google Cloud Run:

gcloud run deploy daktela-v6-php-mcp-server \
  --source . \
  --dockerfile Dockerfile.prod \
  --region europe-west1 \
  --allow-unauthenticated \
  --memory 1Gi

Warning

When deploying to the cloud with --allow-unauthenticated, ensure you implement appropriate access controls to protect your Daktela data.


Available Tools

The MCP server exposes 43 read-only tools organised into the following categories. All list tools support pagination, sorting, and contextual filtering.

Tickets

Tool Description
count_tickets Count tickets matching filter criteria
get_ticket Get a specific ticket by ID
get_ticket_detail Get detailed ticket information
list_account_tickets List tickets for a specific account
list_ticket_categories List available ticket categories
list_tickets List tickets with filtering and pagination

Activities

Tool Description
count_activities Count activities matching filter criteria
get_activity Get a specific activity by ID
list_activities List activities with filtering and pagination

Calls

Tool Description
count_calls Count calls matching filter criteria
get_call Get a specific call by ID
get_call_transcript Get the transcript of a specific call
list_call_transcripts List available call transcripts
list_calls List calls with filtering and pagination

Emails

Tool Description
count_emails Count emails matching filter criteria
get_email Get a specific email by ID
list_emails List emails with filtering and pagination

Messaging

Covers webchat, SMS, Facebook Messenger, Instagram, WhatsApp, and Viber.

Tool Description
count_chats Count chat messages matching filter criteria
get_chat Get a specific chat message by ID
list_chats List chat messages with filtering and pagination

Contacts and CRM

Tool Description
count_accounts Count accounts matching filter criteria
count_contacts Count contacts matching filter criteria
count_crm_records Count CRM records matching filter criteria
get_account Get a specific account by ID
get_contact Get a specific contact by ID
get_crm_record Get a specific CRM record by ID
list_accounts List accounts with filtering and pagination
list_contacts List contacts with filtering and pagination
list_crm_records List CRM records with filtering and pagination

Campaigns

Tool Description
count_campaign_records Count campaign records matching filter criteria
get_campaign_record Get a specific campaign record by ID
list_campaign_records List campaign records with filtering and pagination
list_campaign_types List available campaign types

Reference Data

Tool Description
list_groups List agent groups
list_pauses List available pause types
list_queues List queues
list_statuses List ticket/activity statuses
list_templates List message templates
list_users List users

Real-time

Tool Description
list_realtime_sessions List current real-time agent sessions

Knowledge Base

Tool Description
list_article_folders List knowledge base folders
list_articles List knowledge base articles
get_article Get a specific knowledge base article

Built-in Prompts

The server includes four pre-built prompt templates for common analysis workflows. These prompts are available directly in your AI client when the MCP server is connected.

Prompt Description
email_quality_audit Audit recent emails for negative sentiment, unprofessional tone, and lost deals
sales_pipeline_review Review deal health and identify at-risk opportunities
call_quality_review Analyse calls for escalations, knowledge gaps, and quality issues
daily_call_analysis Daily call review for churn risk and recurring issues

Usage Examples

Once the MCP server is connected to your AI client, you can ask questions like:

  • "Show me all open tickets from the last 7 days and summarise common issues."
  • "Audit the last 50 emails for negative sentiment and unprofessional tone."
  • "List all missed calls from today and identify patterns."
  • "Review the sales pipeline and flag deals that have been stalled for more than 2 weeks."
  • "Analyse call transcripts from this week and highlight any escalations."

The AI assistant will use the appropriate MCP tools to fetch data from your Daktela instance and provide structured analysis.


Best Practices

  • Token Security: Never share your API Access Token publicly. Use environment variables or secret management services to store credentials.
  • Caching: Keep caching enabled (default) to reduce API calls for reference data like queues, users, and statuses.
  • Access Control: Create a dedicated API user with minimal read-only permissions for the MCP server rather than using an admin token.
  • Cloud Deployments: Always implement authentication when exposing the HTTP server endpoint publicly.

Support

If you encounter bugs or have feature requests, please use the Issues section on the GitHub repository.