Tutorials

Create custom MCP server for Intercom - without code

H

Hoshang Mehta

Create custom MCP server for Intercom - without code

Intercom is your customer engagement platform. It holds your conversations, user profiles, product usage data, and support interactions. But when you want to build an AI agent that can answer "What's the sentiment of recent conversations?" or "Show me all users who haven't engaged in 30 days," you hit complexity.

The Intercom API requires careful pagination, webhook management, and understanding of nested conversation threads. Building a backend service just to query this data is time-consuming.

Pylar makes it simple.

Pylar syncs your Intercom data to a SQL-queryable warehouse and lets you build MCP (Model Context Protocol) tools with natural language prompts—no code, no API complexity.

Why Pylar for Intercom?

  • Unified Customer View: Join Intercom conversations with Stripe subscription data or HubSpot CRM records.
  • No Pagination: Pylar handles all the API complexity. You just write SQL.
  • Real-Time Insights: Query conversation data without slowing down your Intercom instance.

Step-by-Step Walkthrough

Step 1: Connect Intercom to Pylar

  1. In Pylar, go to Connections -> Intercom.
  2. Authenticate via OAuth or provide an Intercom Access Token.
  3. Pylar will begin syncing your Intercom data (users, conversations, tags, segments, etc.).

Intercom connection setup

You'll receive an email when the sync completes.

Step 2: Create a Sandboxed View

Let's say you want an agent to help your support team identify at-risk users.

In Pylar's SQL IDE, create a view:

-- view: at_risk_users
SELECT 
  u.id as user_id,
  u.email,
  u.name,
  u.last_seen_at,
  u.session_count,
  COUNT(c.id) as conversation_count,
  MAX(c.created_at) as last_conversation_date
FROM intercom.users u
LEFT JOIN intercom.conversations c ON u.id = c.user_id
GROUP BY u.id, u.email, u.name, u.last_seen_at, u.session_count
HAVING u.last_seen_at < NOW() - INTERVAL '30 days'
  OR COUNT(c.id) = 0

Creating a sandboxed view in SQL IDE

This view surfaces users who haven't been active recently or have never had a conversation.

Step 3: Auto-Build the MCP Tool

  1. Select your view (at_risk_users) in the right sidebar.
  2. Click "Create MCP Tool" and choose "Create with AI".
  3. Type a prompt: "Create a tool that finds users who haven't engaged in the last 30 days."
  4. Pylar generates the tool configuration:
    • Name: get_at_risk_users
    • Description: "Returns users who haven't been active or had conversations recently."
    • Parameters: None (or optionally days_inactive)

Auto-generating MCP tool from view

Step 4: Publish & Connect

  1. Click "Publish" in the right sidebar.
  2. Click "Generate Token".
  3. Copy your MCP HTTP Stream URL (https://mcp.publish.pylar.ai/mcp) and Authorization Bearer Token.

Publishing MCP server

Connect to Slack Bot: You can now build a Slack bot that alerts your team about at-risk users.

  1. Use a workflow automation tool like n8n or Zapier.
  2. Schedule a daily check that calls Pylar's MCP endpoint.
  3. Post results to a Slack channel: "5 users haven't engaged in 30+ days."

Advanced Use Cases for Intercom Agents

1. Conversation Sentiment Analysis

Goal: Identify conversations with negative sentiment to prioritize support responses.

  • View: Join conversations with messages and filter by keywords or tags.
  • Tool Prompt: "Create a tool that finds conversations tagged with 'frustrated' or 'angry'."
  • User Query: "Which customers are unhappy right now?"

2. Product Engagement Insights

Goal: Help product teams understand which features users are asking about.

  • View: Aggregate conversations by topic or tag.
  • Tool Prompt: "Create a tool that counts conversations mentioning a specific feature."
  • User Query: "How many users asked about the new dashboard this week?"

Conclusion

Intercom is a powerful customer engagement platform, but giving AI agents access to conversation data has always required complex API integrations and careful handling of customer privacy. With Pylar, you can transform your Intercom engagement data into an AI-ready resource in under 2 minutes—no coding required.

By connecting Pylar to your Intercom account, creating sandboxed views that protect sensitive customer information, and auto-generating MCP tools with natural language, you unlock the full potential of your engagement data for AI agents while maintaining complete security and privacy.

Whether you're building a customer support assistant, a product engagement insights tool, or any other Intercom-powered AI application, Pylar gives you the governance layer you need. Your views act as security boundaries, and with support for all standard and custom user attributes, you can query your engagement data just like any SQL database.

Turn your Intercom engagement data into an AI-ready resource. Start building customer success agents today.

Start building your Intercom MCP server for free at pylar.ai.