A production-ready Model Context Protocol (MCP) server that provides seamless integration between AI assistants (like Claude) and the Respond.io customer engagement platform. Built with TypeScript following industry best practices.
- Contact Management: Full CRUD operations, tagging, custom fields
- Messaging: Multi-channel support (WhatsApp, Email, SMS, Social Media)
- Conversations: Assignment, status management, closing notes
- Workspace: Users, channels, custom fields management
- Comments: Internal team collaboration
- Type Safety: Full TypeScript with strict mode
- Input Validation: Comprehensive validation for all inputs
- Error Handling: Detailed error messages and recovery
- Rate Limiting: Built-in rate limit handling
- Logging: Structured logging for debugging
- Complete API reference with examples
- Step-by-step setup guide
- Contributing guidelines
- Security best practices
- Troubleshooting documentation
{
"runtime": "Node.js 18+",
"language": "TypeScript 5.3+",
"protocol": "Model Context Protocol (MCP)",
"code_quality": ["ESLint", "Prettier"],
"architecture": "Modular, event-driven"
}mcp-server/
├── src/
│ ├── index.ts # Main server implementation
│ ├── types.ts # TypeScript type definitions
│ ├── constants.ts # Application constants
│ ├── utils/ # Utility functions
│ ├── middlewares/ # Express middlewares
│ └── tools/ # Tool definitions
├── dist/ # Compiled JavaScript (auto-generated)
├── README.md # Project overview, features, tool list, examples
├── SETUP_GUIDE.md # Installation instructions
├── CONTRIBUTING.md # Contribution guidelines
├── .env.example # Environment configuration template
├── .eslintrc.json # Code linting rules
├── .prettierrc.json # Code formatting rules
├── tsconfig.json # TypeScript compiler config
├── package.json # Dependencies and scripts
├── LICENSE # MIT License
└── .gitignore # Git ignore rules
See README.md for the full list and usage examples. Response shapes and API behavior follow the Respond.io Developer API and the SDK.
get_contact, create_contact, update_contact, delete_contact, list_contacts, add_contact_tags, remove_contact_tags, create_or_update_contact, merge_contacts, list_contact_channels, update_contact_lifecycle
send_message, get_message, list_messages
assign_conversation, update_conversation_status
create_comment
list_users, get_user, list_custom_fields, get_custom_field, create_custom_field, list_channels, list_closing_notes, list_templates, create_tag, update_tag, delete_tag
{
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
}- TypeScript recommended rules
- Prettier integration
- No unused variables
- Explicit function return types (where needed)
- No floating promises
- 2-space indentation
- Semicolons required
- Single quotes disabled (double quotes)
- 100 character line limit
- Trailing commas (ES5)
-
API Key Protection
- Environment variable storage
- Never logged or exposed
- Rotation support
-
Input Sanitization
- All inputs validated
- SQL injection prevention
- XSS protection
-
Rate Limiting
- Built-in rate limit handling
- Exponential backoff
- Request queueing
-
Error Handling
- No sensitive data in errors
- Proper error codes
- Detailed logging
- Connection Pooling: Reusable HTTP connections
- Timeout Management: 30-second default timeout
- Retry Logic: Exponential backoff for failures
- Pagination: Efficient data retrieval
- Type Safety: Reduced runtime errors
# Setup
npm install
cp .env.example .env
# Development
npm run dev # Hot reload
npm run type-check # Type checking
npm run lint # Code linting
npm run format # Code formatting
# Production
npm run build # Compile TypeScript
npm start # Run compiled code
# Quality Checks
npm run lint:fix # Auto-fix linting issues- Contact operations tested
- Message sending verified
- Conversation management validated
- Error scenarios covered
- Input validation for all parameters
- Type checking at compile time
- Runtime validation for API responses
- Real API endpoint testing
- Claude Desktop integration verified
- Multi-tool workflows tested
Respond.io API enforces rate limits (429 handling, retry with backoff). For error types, response format, and environment variables, see README.md and README.md.
@modelcontextprotocol/sdk: MCP protocol implementation@respond-io/typescript-sdk: Respond.io API SDK (includes HTTP client internally)dotenv: Environment configuration
typescript: Type safetytsx: TypeScript executioneslint: Code lintingprettier: Code formatting@types/node: Node.js type definitions
npm run devnpm run build
npm startnpm install -g .
mcp-serverFROM node:18-alpine
WORKDIR /app
COPY . .
RUN npm install && npm run build
CMD ["npm", "start"]- Assign conversations to agents
- Send automated responses
- Track conversation status
- Add internal notes
- Tag leads and customers
- Send targeted WhatsApp campaigns
- Track customer lifecycle
- Manage contact custom fields
- Auto-respond to inquiries
- Route conversations by topic
- Update CRM data
- Generate reports
- Connect with AI assistants
- Sync with other systems
- Automate workflows
- Real-time updates
# ✅ Good
export RESPONDIO_API_KEY=secret_key
# ❌ Bad
const apiKey = "secret_key"; // Hardcoded// ✅ Good
try {
await sendMessage(args);
} catch (error) {
logger.error("Failed to send:", error);
return { error: handleApiError(error) };
}
// ❌ Bad
await sendMessage(args); // Unhandled// ✅ Good
const validation = validateIdentifier(identifier);
if (!validation.valid) {
return { error: validation.errors.join(", ") };
}
// ❌ Bad
// No validation// ✅ Good
interface SendMessageArgs {
identifier: string;
messageType: MessageType;
}
// ❌ Bad
function sendMessage(args: any) { }- Webhook support
- Bulk operations
- Advanced filtering
- Contact merge
- Analytics tools
- Scheduled messages
- Template management
- Workflow automation
- API v3 support
- GraphQL integration
- Enhanced caching
- Multi-workspace
- 📖 Setup Guide
- 🤝 Contributing
- 🔒 Security
Built with ❤️ using TypeScript and Model Context Protocol
Last Updated: 2024