# Plain — how to use (mcp.ai)

Connect your Plain account and use 23 tools for customer support straight from your AI agent. Connect with your own API key. Plain is a collaborative support platform for B2B support teams, offering a modern, AI-powered interface to consolidate support channels and assist customers efficiently.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_plain?ms=1787291460000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `plain_add_customer_to_group`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/plain`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/plain/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/plain/add/customer/to/group` — Tool to add a customer to one or more customer groups. Use when you have a customer and groups ready.
  - body: { customerId: string, customerGroupIdentifiers: object[] }
- `POST https://api.mcp.ai/api/plain/create/customer/group` — Creates a new customer group in Plain for organizing and segmenting customers. Customer groups allow you to categorize customers (e.g., by pricing tier, feature access, or support level) and manage th
  - body: { key: string, name: string, color: string, externalId?: string }
- `POST https://api.mcp.ai/api/plain/create/thread` — Tool to create a new thread. Use after obtaining valid customer identifier.
  - body: { title: string, assignedTo?: object, components?: object[], labelTypeIds?: string[], customerIdentifier: object }
- `POST https://api.mcp.ai/api/plain/delete/customer` — Tool to delete a customer from the system. Use when you need to remove a customer by their ID.
  - body: { customer_id: string }
- `POST https://api.mcp.ai/api/plain/delete/user` — Tool to delete a user from the system. Use when you need to remove a user by their ID after confirming existence.
  - body: { user_id: string }
- `POST https://api.mcp.ai/api/plain/fetch/company` — Tool to fetch company details by ID. Use when you need the full profile of a company, including name, domain, contract value, owner info, and timestamps.
  - body: { company_id: string }
- `POST https://api.mcp.ai/api/plain/fetch/issues` — Fetches external issue tracker links (Jira, Linear, GitHub, etc.) associated with a customer's threads. Returns a flattened list of all issue links across the customer's threads, including the thread 
  - body: { linkFirst?: integer, customerId: string, threadFirst?: integer }
- `POST https://api.mcp.ai/api/plain/fetch/tier` — Tool to fetch a tier by its ID. Use when you have a tier ID and need its metadata before proceeding. Example: "Fetch tier with ID tier_123".
  - body: { tier_id: string }
- `POST https://api.mcp.ai/api/plain/get/customer/by/email` — Fetch customer details by email address. Returns customer information if found, or null if no customer exists with that email.
  - body: { email: string }
- `POST https://api.mcp.ai/api/plain/get/customer/by/id` — Tool to retrieve details of a specific customer by their unique ID. Use after obtaining the customer's ID to fetch their complete record.
  - body: { id: string }
- `POST https://api.mcp.ai/api/plain/get/customers` — Tool to fetch a list of customers. Use when retrieving multiple customer records with pagination, filtering, or sorting.
  - body: { last?: integer, after?: string, first?: integer, before?: string, sortBy?: object, filters?: object }
- `POST https://api.mcp.ai/api/plain/get/thread/by/id` — Fetches comprehensive details of a specific thread by ID, including customer info, status, priority, labels, and assignments. Returns null if thread not found.
  - body: { id: string }
- `POST https://api.mcp.ai/api/plain/get/user/by/id` — Fetch workspace user/team member by ID. Returns detailed information about a workspace team member including their name, email, status, and avatar. Note: This fetches workspace users (team members), n
  - body: { user_id: string }
- `POST https://api.mcp.ai/api/plain/list/customer/groups` — Tool to list all customer groups. Use when you need to retrieve group metadata with optional pagination or filters.
  - body: { last?: integer, after?: string, first?: integer, before?: string, filters?: object }
- `POST https://api.mcp.ai/api/plain/list/threads` — DEPRECATED: Use PLAIN_PLAIN_QUERY_THREADS instead. Lists all threads (support conversations) in Plain. Returns thread summaries including ID, reference, title, status, and priority. Use this action to
  - body: { last?: integer, after?: string, first?: integer, before?: string }
- `POST https://api.mcp.ai/api/plain/list/tiers` — Tool to retrieve a list of tiers with pagination. Use when you need to browse available tiers after determining pagination cursors. Example: 'List tiers with first=25'.
  - body: { last?: integer, after?: string, first?: integer, before?: string }
- `POST https://api.mcp.ai/api/plain/query/threads` — Tool to retrieve a paginated list of threads. Use when you need to list threads with optional status filtering.
  - body: { cursor?: string, statuses?: string[] }
- `POST https://api.mcp.ai/api/plain/remove/customer/from/group` — Removes a customer from one or more customer groups in Plain. Use this action to revoke customer group memberships. The customer must be a member of the specified group(s) - attempting to remove a cus
  - body: { customerId: string, customerGroupIdentifiers: object[] }
- `POST https://api.mcp.ai/api/plain/run/graphql/query` — Execute any GraphQL query or mutation against Plain API. Use when no specific action exists or for complex operations like thread timelines, advanced filtering, and custom data retrieval. Supports que
  - body: { query: string, variables?: object }
- `POST https://api.mcp.ai/api/plain/send/message` — Tool to send a new message within a thread. Use after identifying the thread and preparing message content.
  - body: { threadId: string, textContent: string, impersonation?: object, markdownContent?: string, channelSpecificOptions?: object }
- `POST https://api.mcp.ai/api/plain/update/company` — Upserts (creates or updates) a company in Plain. Provide either companyId (for updating an existing company by ID) or companyDomainName (for upserting by domain). Use this to create new companies, upd
  - body: { name: string, companyId?: string, domainName: string, contractValue?: integer, companyDomainName?: string, accountOwnerUserId?: string }
- `POST https://api.mcp.ai/api/plain/update/thread` — Tool to update a thread's title. Use when renaming a thread after confirming its ID.
  - body: { title: string, threadId: string }
- `POST https://api.mcp.ai/api/plain/upsert/customer` — Tool to upsert (create or update) a customer. Use when syncing or ensuring a customer record exists before subsequent actions.
  - body: { onCreate: object, onUpdate: object, identifier: object }

## Example prompts
- "What can I do in Plain?"
- "Show me a summary of my Plain account"

## More
- Page: https://mcp.ai/plain
- Agent spec (llms.txt): https://mcp.ai/plain/llms.txt
- Postman collection: https://mcp.ai/plain/postman.json
