MCP Integration
Use ClassifAI with AI agents via Model Context Protocol
What is MCP?
The Model Context Protocol (MCP) allows AI agents to use ClassifAI as a tool for routing, decision-making, and content analysis.
When integrated, MCP clients can classify content, get project statistics, and submit feedback—all while conversing with users.
Note: These instructions are specifically for Claude Desktop, but ClassifAI can be integrated with any MCP client that supports the Model Context Protocol.
Quick Setup (Claude Desktop)
1. Get Your API Key
Sign up to get your API key from the dashboard.
2. Add to Claude Desktop
Add ClassifAI to your Claude Desktop MCP configuration:
macOS/Linux:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
Edit %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"classifai": {
"url": "https://api.classifai.dev/mcp",
"headers": {
"X-API-Key": "your-api-key-here"
}
}
}
}3. Restart Claude Desktop
Close and reopen Claude Desktop to load the MCP server.
4. Verify Connection
Ask Claude: "What classification tools do you have access to?"
Claude should list the ClassifAI tools:
classify- Classify text/images for routing and decision-makingclassify_ground_truth- Submit feedback to improve accuracyclassify_stats- Get project analytics and metrics
Available Tools
classify
Classify content for routing, decision-making, sentiment analysis, or content moderation.
Example conversation:
You: "Classify this customer message: 'My order hasn't arrived and it's been 2 weeks!'"
Claude: [Uses classify tool] This appears to be an urgent complaint about shipping delays. I've classified it as "urgent_shipping_issue" with high confidence. This should be routed to your shipping support team immediately.
Parameters:
content- Array of text/image content itemslabels(optional) - Explicit classification labelsdescription(optional) - Description for automatic label inferenceproject_id(optional) - Reuse existing project labels
classify_ground_truth
Submit the correct label for a previous classification to improve accuracy.
Example conversation:
You: "Actually, that was correctly classified. Mark it as accurate."
Claude: [Uses classify_ground_truth tool] I've recorded that feedback. The system will learn from this to improve future classifications for your project.
Parameters:
detection_id- ID from previous classificationground_truth- Correct label
classify_stats
Get analytics and accuracy metrics for a classification project.
Example conversation:
You: "How accurate is my support routing system?"
Claude: [Uses classify_stats tool] Your "support-routing" project has processed 1,234 classifications with an accuracy rate of 89% based on 150 feedback submissions. The most common category is "technical_support" (42%).
Parameters:
project_id- Project to get statistics for
Use Cases
Customer Support Routing
Claude can automatically route customer inquiries:
You: "New ticket from john@example.com: 'I can't log into my account'"
Claude: [Uses classify tool]
This is a technical/authentication issue. I've classified it as "technical_auth"
and here's what I recommend:
1. Route to: Technical Support Team
2. Priority: High (login issues prevent product usage)
3. Suggested response: Send password reset instructions
Would you like me to draft a response?Content Moderation
Claude can help moderate user-generated content:
You: "Check if this comment violates our policies: [comment text]"
Claude: [Uses classify tool]
I've analyzed the comment and classified it as "hate_speech" with 92% confidence.
This violates your content policy. I recommend:
1. Remove the comment
2. Send warning to user
3. Flag account for review
Should I proceed with these actions?Sentiment Analysis
Claude can analyze customer feedback trends:
You: "Analyze today's customer reviews"
Claude: [Uses classify tool for each review, then classify_stats]
Based on 45 reviews classified today:
- Positive: 62% (mainly praising fast shipping)
- Neutral: 28% (mixed feedback on pricing)
- Negative: 10% (quality concerns on Product X)
The overall sentiment is positive. I notice an uptick in negative reviews for
Product X specifically—you may want to investigate the quality issues there.Advanced Usage
Multi-Step Workflows
Claude can chain multiple tool calls:
You: "Process this support ticket and track the outcome"
Claude:
1. [Uses classify] Classification: "billing_issue"
2. [Provides response to customer]
3. You confirm it was helpful
4. [Uses classify_ground_truth] Feedback recorded
5. [Uses classify_stats] Updated project accuracy: 91%Project Management
Track classification accuracy over time:
You: "Give me a weekly report on classification performance"
Claude: [Uses classify_stats for each project]
Weekly Classification Report:
├─ support-routing: 1,234 classifications, 89% accuracy
├─ spam-detection: 5,621 classifications, 94% accuracy
└─ sentiment-analysis: 892 classifications, 87% accuracy
Overall performance is strong. Spam detection has the highest accuracy due
to consistent feedback. Consider providing more feedback on sentiment analysis
to improve its accuracy.Rate Limits
MCP requests follow the same rate limits as direct API usage:
| Tier | Rate Limits |
|---|---|
| Free (Test) | 10/min, 100/day |
| Hobby | 10/min, 1,000/day |
| Production | 100/min, 10,000/day |
Troubleshooting
Claude Can't See ClassifAI Tools
- Check your
claude_desktop_config.jsonsyntax - Ensure the URL is correct:
https://api.classifai.dev/mcp - Restart Claude Desktop completely
- Check Claude Desktop logs: Help → View Logs
Rate Limit Errors
If you see "Rate limit exceeded":
- Reduce request frequency
- Upgrade to a higher tier for increased limits
Classification Errors
If classifications seem inaccurate:
- Provide feedback using
classify_ground_truth - Use consistent
project_idvalues - Provide more descriptive labels or descriptions
- Submit more ground truth feedback to improve accuracy
Using ClassifAI with Other MCP Clients
While these instructions are tailored for Claude Desktop, ClassifAI can be integrated with any MCP client that supports the Model Context Protocol. The MCP server is available at:
https://api.classifai.dev/mcpWhen configuring other MCP clients, ensure you:
- Set the server URL to
https://api.classifai.dev/mcp - Include your API key in the
X-API-Keyheader - Consult your MCP client's documentation for specific configuration instructions
Next Steps
- API Reference - Direct API usage
- Examples - Code samples and use cases
- Getting Started - Basic setup guide