What You’ll Build
Build an intelligent support bot that:- Monitors your Slack support channels for customer questions
- Automatically checks ticket status in Zendesk when customers ask
- Uses AI to respond to common questions without human intervention
- Routes complex issues to your support team with proper context
What you’ll learn:
- Deploying multiple MCP servers (Slack and Zendesk)
- Setting up OAuth for user authentication
- Creating an AI agent that uses tools from multiple services
- Implementing decision logic for automated responses
- Create a Metorial account
- Create API keys
- Slack workspace with admin access
- Zendesk account with API access
- OpenAI or Anthropic API key
Prerequisites
Before building the support bot, ensure you have:-
Metorial setup:
- Active Metorial account at app.metorial.com
- Project created in your organization
- Metorial API key (generate in Dashboard → Home → Connect to Metorial)
-
Slack workspace:
- Admin access to create OAuth apps
- Support channel where bot will listen (e.g.,
#customer-support)
-
Zendesk account:
- Admin access to create API tokens
- Active tickets for testing
-
AI provider:
- OpenAI API key (GPT-4 recommended) OR
- Anthropic API key (Claude Sonnet 4.5 recommended)
-
Development environment:
- Node.js 18+ (TypeScript) or Python 3.9+ installed
- Basic knowledge of async/await patterns
Architecture Overview
The support bot follows this workflow:- Listen: Monitor Slack channels for customer messages
- Analyze: AI determines if message is about ticket status, common question, or complex issue
- Act:
- Ticket status: Query Zendesk and post status to Slack
- Common question: AI generates and posts response to Slack
- Complex issue: Tag support team in dedicated channel with context
- Slack MCP Server: Read messages, post responses, send DMs
- Zendesk MCP Server: Search tickets, read ticket details, add internal notes
- AI Model: Decision-making and response generation
Step 1: Deploy Slack MCP Server
Deploy the Slack MCP server from Metorial’s catalog to enable your bot to interact with Slack.Deploy Slack Server
Click the Slack server, then click Deploy Server → Server Deployment.Give your deployment a descriptive name like “Support Bot Slack”.
Keep your Slack deployment ID handy. You’ll use it when setting up OAuth and writing bot code.
Step 2: Deploy Zendesk MCP Server
Deploy the Zendesk MCP server to enable ticket querying and management.Configure API Authentication
Zendesk requires API token authentication:
- In Zendesk Admin Center, go to Apps and Integrations → APIs → Zendesk API
- Enable Token Access
- Click Add API token, give it a description (e.g., “Metorial Support Bot”)
- Copy the token and paste it in the Metorial deployment configuration
- Enter your Zendesk subdomain (e.g.,
yourcompany.zendesk.com)
Step 3: Set Up OAuth Authentication
Your support bot needs permission to access your Slack workspace on behalf of your team.Authorize in Browser
- Open the printed OAuth URL in your browser
- Select your Slack workspace
- Review and approve the permissions
- You’ll be redirected to your callback URL (or see a confirmation page)
OAuth vs API Keys:
- Slack uses OAuth (user authorization)
- Zendesk uses API tokens (configured in deployment)
Step 4: Build the Support Bot Core Logic
Create the main bot that connects to both Slack and Zendesk with AI-powered decision making.- Creates a provider session with both Slack and Zendesk tools available
- Sends customer message to AI with instructions on how to handle different scenarios
- AI decides and executes tools:
- Searches Zendesk if ticket status requested
- Posts to Slack with responses
- Routes to support team if needed
- Handles multi-step tool calls in an agentic loop until complete
This example uses Claude’s agentic capabilities—the AI autonomously decides which tools to call and when. You don’t need to write routing logic yourself.
Step 5: Check Ticket Status
Let’s test the bot with a ticket status inquiry. Scenario: Customer asks “What’s the status of my ticket #1234?” The bot will:- Parse ticket number from message
- Call Zendesk’s
search_ticketsorget_tickettool - Format ticket details (status, assignee, last update)
- Post to Slack
The AI autonomously chains tool calls:
- First calls
zendesk_get_ticket - Receives ticket data
- Then calls
slack_post_messagewith formatted response
Step 6: AI-Powered Auto-Response
Test the bot with a common question that doesn’t require tools. Scenario: Customer asks “How do I reset my password?” The bot will:- Recognize this as a common question
- Generate helpful response using its knowledge
- Post directly to Slack
Customizing Auto-Responses:For production bots, enhance the system prompt with:
- Your company’s knowledge base articles
- FAQs and standard responses
- Links to help documentation
- Escalation criteria (e.g., “always escalate billing questions”)
Step 7: Route Complex Issues to Humans
Test the bot with a complex issue that needs human attention. Scenario: Customer reports “Your API is returning 500 errors and our production is down!” The bot will:- Recognize this as urgent and complex
- Post to escalation channel
- Tag support team
- Include original message and urgency
Configuring Escalation Rules:Update the system prompt to define when to escalate:
- Keywords: “down”, “urgent”, “billing”, “refund”, “legal”
- Customer sentiment: angry or frustrated tone
- Business rules: questions about enterprise plans, integrations
Step 8: Test End-to-End
Run a complete test to verify all functionality.Verify Bot Behavior
Check that:
- ✓ Ticket status posted to Slack with correct details
- ✓ Password reset instructions posted clearly
- ✓ Urgent issue escalated to #support-escalations
- ✓ Acknowledgment posted to customer in original channel
Debugging Tips:If tools aren’t being called:
- Check OAuth session is active (try re-authorizing)
- Verify deployment IDs are correct
- Check API tokens for Zendesk haven’t expired
- Review Metorial dashboard logs under Monitoring
What’s Next?
Congratulations! You’ve built a production-ready support bot that integrates Slack and Zendesk with AI-powered decision making.Enhancements to Try
Add Message Monitoring
Use Slack’s Events API to trigger bot on new messages automatically instead of manual calls.
Sentiment Analysis
Enhance AI prompt to detect frustrated customers and escalate proactively.
Create Zendesk Tickets
Allow bot to create new tickets when customers report issues without ticket IDs.
Multi-Language Support
Add language detection and translation for global support teams.
Learn More
SDK Documentation
Explore advanced SDK features and patterns.
OAuth Guide
Learn more about managing user authorizations.
Monitoring Guide
Monitor tool calls and debug issues.
Production Considerations
Before deploying to production:- Error handling: Add try/catch blocks and retry logic
- Rate limiting: Implement backoff for high-volume channels
- Security: Store API keys in environment variables or secrets manager
- Monitoring: Set up alerts for failed tool calls
- Testing: Create automated tests for common scenarios
Need help? Email us at support@metorial.com.