# MeiQia MCP

> MeiQia connects your AI agent directly to a major live chat and CRM system. Your client can list active conversations, pull full message histories, look up customer profiles, update contact details, and monitor team workload—all without you ever opening the web interface. It makes complex customer engagement data instantly accessible for any workflow.

## Overview
- **Category:** customer-support
- **Price:** Free
- **Tags:** customer-engagement, helpdesk, messaging, conversation-history, crm-integration, real-time-chat

## Description

Your AI agent hooks up directly to your live chat and CRM system with MeiQia. It lets you run complex customer service operations without ever opening a single browser tab or juggling multiple dashboards. You're not just reading data; your client acts on it, making sure every conversation gets handled instantly.

For managing active conversations, the agent first pulls a list of all chats—whether they’re live, closed out, or waiting for follow-up (`list_conversations`). Once you identify a specific thread ID, your AI client retrieves all key details about that chat (`get_conversation`), giving context right away. To see what actually went down in the discussion, it fetches the complete, ordered text log of every message sent and received within that thread (`list_messages`). When an agent needs to reply, your AI client sends a direct outgoing message straight through the live chat interface (`send_message`), ensuring the customer gets an immediate response without you having to copy and paste anything.

When it comes to handling customer data, your agent keeps everything current in the CRM. You can run a comprehensive list of every single customer record stored—it's paginated so you don’t miss a thing (`list_customers`). If you need a specific person's file, you look them up by their identifier using `get_customer`. Need to add someone brand new? It handles that too; it creates the whole record in the CRM database right away (`create_customer`). Beyond just reading profiles, your agent updates things. You can modify existing customer records with updated contact info or any other details you need to capture.

For team management and routing incoming work, your agent gives you full visibility into who's available and how much capacity the team has. It provides a roster of every support agent connected to the platform (`list_agents`), showing their real-time status—are they online, busy, or offline? To get the big picture on staffing levels, it pulls a workload summary that shows high-level metrics on who's overworked and who's got bandwidth for more queries (`get_workload_summary`). These tools let your AI client check specific agent availability right now (`get_agent_status`), helping you route incoming calls or chats to the best available person. It lets you process everything—from finding a customer record, gathering their chat history, and sending the final reply—all in one continuous workflow.

## Tools

### create_customer
Adds a brand new customer record directly into the CRM database.

### get_agent_status
Checks and reports on if specific support agents are online, busy, or offline.

### get_conversation
Retrieves all key details for a specified chat thread ID.

### get_customer
Looks up the complete profile of an existing customer by their identifier.

### get_workload_summary
Pulls high-level statistics on team capacity, showing who is overworked or underutilized.

### list_agents
Provides a roster and status of all support agents connected to the platform.

### list_conversations
Retrieves a list of active and closed chat conversations in your workspace.

### list_customers
Pulls a paginated list of every customer record stored in the CRM.

### list_messages
Gets the full, ordered text history for messages within a specific conversation thread.

### send_message
Sends an outgoing message reply to the customer through the live chat interface.

## Prompt Examples

**Prompt:** 
```
List all open conversations on MeiQia.
```

**Response:** 
```
I've retrieved your open conversations. There are 8 active chats, including queries about 'API integration' and 'Enterprise pricing'. Which one would you like to view messages for?
```

**Prompt:** 
```
Send a reply to conversation 'conv-8821' saying 'We are looking into this for you'.
```

**Response:** 
```
Done! I've sent your reply to the customer in conversation 'conv-8821'. Your message 'We are looking into this for you' has been successfully delivered.
```

**Prompt:** 
```
Show me the profile for customer 'Mario'.
```

**Response:** 
```
I've retrieved the profile for Mario. He is a high-value customer from 'Tech Corp' with a history of 12 interactions. Would you like me to list his recent messages or update his contact info?
```

## Capabilities

### List Active Conversations
The agent pulls a list of all live chat threads, showing which are active, closed, or pending follow-up.

### Retrieve Full Message History
You can request the complete message log for any conversation, seeing every comment and interaction that has taken place.

### Update Customer Profiles
The agent writes new customer records or modifies existing ones with contact details and updated information.

### Send Direct Replies to Customers
You send a reply directly through the chat interface, making sure the customer gets an immediate response without manual copy/pasting.

### Monitor Agent Status and Workload
The agent checks if specific support agents are online or pulls aggregate metrics on team capacity to route incoming queries better.

## Use Cases

### Handling an Escalated Support Query
A customer complains about billing. Instead of manually checking three places, the agent prompts: 'Get details for John Doe and list his last 5 messages.' The AI runs `get_customer` followed by `list_messages`. You immediately see his account history and can use `send_message` to confirm the fix.

### Daily Shift Handoff Audit
At end-of-shift, you need a status report. You ask your agent to 'Give me a summary of today's volume and who was busy.' The AI runs `get_workload_summary` and `list_agents`, giving the next person an instant, data-backed handover.

### Capturing a New Lead's Details
A prospect chats with you. When they leave, you prompt: 'Create a customer for this chat.' The AI runs `create_customer` using the contact info from the chat, and then updates their profile using `get_customer` to ensure data integrity.

### Reviewing Old Campaign Interactions
You need to check what a specific customer talked about last month. You prompt: 'Show me all chats for user X.' The AI runs `list_conversations`, narrows it down, and executes `get_conversation` to pull the required data.

## Benefits

- You get real-time team metrics. Instead of asking a human for an update, your AI client runs `get_workload_summary` to tell you exactly where the bottlenecks are right now.
- Customer history is immediate. You don't need to navigate five different tabs; one prompt triggers `list_conversations`, then `get_customer`, and finally `list_messages` for full context.
- Never lose a lead again. Your agent can use `create_customer` immediately after a chat ends, ensuring all contact data is captured before you move to the next ticket.
- Direct action in conversation. You send replies using `send_message`, meaning your AI doesn't just read the context—it acts on it instantly.
- Team visibility improves dramatically. You can use `get_agent_status` and `list_agents` to confirm who is available before assigning a high-priority query.

## How It Works

The bottom line is: You talk to your AI client, and it does the multi-step API calls needed behind the scenes.

1. First, subscribe to the MeiQia server and provide your access token.
2. Next, tell your AI client exactly what you need (e.g., 'List all open chats for Enterprise clients').
3. Finally, the agent executes the required tools—like `list_conversations` then `get_customer`—and returns the structured data to your chat window.

## Frequently Asked Questions

**How do I check if an agent is available using `get_agent_status`?**
You ask your agent to 'Check support team availability.' The system runs `get_agent_status`, giving you a real-time list of who is online, busy, or away. It's instant status checks for routing.

**Can I use `list_customers` if I only know the name?**
No. `list_customers` requires running a search query on the CRM database to pull all records. If you need specific details, run `get_customer` and provide the customer ID.

**What's the difference between `list_conversations` and `get_conversation`?**
`list_conversations` gives you a list of *all* chats (like a directory). You must then use `get_conversation` on a specific chat ID to pull the actual details or message history.

**How do I send an automatic reply using `send_message`?**
You simply instruct your agent: 'Send the message [text] to conversation ID [ID].' The tool handles authentication and delivery through the live chat system.

**When using `create_customer`, what information must I provide?**
You must include mandatory fields like name, primary email, and associated account ID. The tool validates these parameters before creating the record in the CRM.

**What specific data points does `get_workload_summary` return?**
This function provides aggregate metrics on team performance, including the total count of open chats, average response time per agent, and number of pending tickets for the shift.

**How does `list_messages` handle deep conversation history?**
`list_messages` retrieves a paginated log of every message exchanged in a thread. You can specify date ranges or maximum message counts to limit the data retrieved.

**What fields are available when I call `get_customer`?**
The tool returns comprehensive customer details, including contact information, account tier status, and a summary of all past interactions linked through MeiQia.

**How do I obtain a MeiQia Access Token?**
Log in to your MeiQia workspace, go to [Settings] → [Developer] → [APIs], and generate a new Access Token. Make sure to copy it carefully.

**Can I reply to customers through the agent?**
Yes. Use the `send_message` tool with the specific conversation ID and your message content. This allows for rapid responses directly from your AI workspace.

**Is it possible to see the current team workload?**
Yes! Use the `get_workload_summary` tool to retrieve a real-time overview of how many active chats each agent is handling, helping you manage team capacity.