Bitrix24 MCP Server
Enables AI agents to interact with Bitrix24 CRM for managing contacts, deals, tasks, and leads via a comprehensive set of tools. It supports advanced features like sales team monitoring, performance analytics, and automated CRM searching.
README
Bitrix24 MCP Server
A comprehensive Model Context Protocol (MCP) server for Bitrix24 CRM integration, enabling AI agents to seamlessly interact with your Bitrix24 instance through a powerful set of tools.
🚀 Features
- Complete CRM Management: Create, read, update, and list contacts, deals, and tasks
- Advanced Search: Search across all CRM entities with flexible filtering
- Rate Limiting: Built-in rate limiting to respect Bitrix24 API limits
- Type Safety: Full TypeScript implementation with comprehensive type definitions
- Error Handling: Robust error handling and validation
- Easy Integration: Simple setup with Claude Desktop and other MCP-compatible clients
📋 Available Tools
Contact Management
bitrix24_create_contact- Create new contactsbitrix24_get_contact- Retrieve contact by IDbitrix24_list_contacts- List contacts with filteringbitrix24_update_contact- Update existing contacts
Deal Management
bitrix24_create_deal- Create new dealsbitrix24_get_deal- Retrieve deal by IDbitrix24_list_deals- List deals with filteringbitrix24_update_deal- Update existing deals
Task Management
bitrix24_create_task- Create new tasksbitrix24_get_task- Retrieve task by IDbitrix24_list_tasks- List tasks with filteringbitrix24_update_task- Update existing tasks
User Management
bitrix24_get_user- Get user information by IDbitrix24_get_all_users- Get all users in the system with names and detailsbitrix24_resolve_user_names- Resolve user IDs to user namesbitrix24_get_contacts_with_user_names- Get contacts with user names resolvedbitrix24_get_deals_with_user_names- Get deals with user names resolvedbitrix24_get_leads_with_user_names- Get leads with user names resolvedbitrix24_get_companies_with_user_names- Get companies with user names resolved
Lead Management
bitrix24_create_lead- Create new leadsbitrix24_get_lead- Retrieve lead by IDbitrix24_list_leads- List leads with filteringbitrix24_get_latest_leads- Get most recent leadsbitrix24_get_leads_from_date_range- Get leads from specific date rangebitrix24_update_lead- Update existing leads
Company Management
bitrix24_create_company- Create new companiesbitrix24_get_company- Retrieve company by IDbitrix24_list_companies- List companies with filteringbitrix24_get_latest_companies- Get most recent companiesbitrix24_get_companies_from_date_range- Get companies from specific date rangebitrix24_update_company- Update existing companies
Enhanced Deal Filtering
bitrix24_get_deal_pipelines- Get all deal pipelines/categoriesbitrix24_get_deal_stages- Get deal stages for pipelinesbitrix24_filter_deals_by_pipeline- Filter deals by pipelinebitrix24_filter_deals_by_budget- Filter deals by budget rangebitrix24_filter_deals_by_status- Filter deals by stage/status
Utilities
bitrix24_search_crm- Search across CRM entitiesbitrix24_get_current_user- Get current user infobitrix24_validate_webhook- Validate webhook connectionbitrix24_diagnose_permissions- Diagnose webhook permissionsbitrix24_check_crm_settings- Check CRM settings and configurationbitrix24_test_leads_api- Test leads API endpoints
Sales Team Monitoring
bitrix24_monitor_user_activities- Monitor user activities (calls, emails, timeline interactions, response times)bitrix24_get_user_performance_summary- Get comprehensive performance summary with deal metrics and conversion ratesbitrix24_analyze_account_performance- Analyze performance for specific accounts (companies/contacts)bitrix24_compare_user_performance- Compare performance metrics between multiple usersbitrix24_track_deal_progression- Track deal progression through pipeline stages with timing analysisbitrix24_monitor_sales_activities- Monitor sales-related activities (tasks, follow-ups, meetings)bitrix24_generate_sales_report- Generate comprehensive sales reports with customizable metricsbitrix24_get_team_dashboard- Get real-time team performance dashboardbitrix24_analyze_customer_engagement- Analyze customer engagement patterns and relationship healthbitrix24_forecast_performance- Generate performance forecasts and predictive analytics
🛠️ Installation
Prerequisites
- Node.js 18+
- npm or yarn
- Bitrix24 webhook URL
Setup
- Clone and install dependencies:
git clone <repository-url>
cd bitrix24-mcp-server
npm install
- Configure environment:
cp .env.example .env
# Edit .env with your Bitrix24 webhook URL
- Build the project:
npm run build
- Test the connection:
npm test
⚙️ Configuration
Environment Variables
Create a .env file with the following variables:
BITRIX24_WEBHOOK_URL=https://your-domain.bitrix24.com/rest/USER_ID/WEBHOOK_CODE/
NODE_ENV=development
LOG_LEVEL=info
Bitrix24 Webhook Setup
- Go to your Bitrix24 instance
- Navigate to Applications → Webhooks
- Create an Incoming webhook
- Copy the webhook URL (format:
https://domain.bitrix24.com/rest/USER_ID/WEBHOOK_CODE/) - Set appropriate permissions for CRM and Tasks
🔧 Claude Desktop Integration
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"bitrix24": {
"command": "node",
"args": ["/path/to/your/bitrix24-mcp-server/build/index.js"],
"env": {
"BITRIX24_WEBHOOK_URL": "https://your-domain.bitrix24.com/rest/USER_ID/WEBHOOK_CODE/"
}
}
}
}
📖 Usage Examples
Creating a Contact
Create a new contact named John Smith with email john@example.com and phone +39 123 456 789
Creating a Deal with Contact
Create a new contact for Maria Rossi with email maria@company.com, then create a deal titled "Website Development Project" for €5000 and link it to this contact
Managing Tasks
Create a task titled "Follow up with client" with high priority, deadline tomorrow, and link it to contact ID 123
Searching CRM
Search for all contacts and deals related to "example.com"
🏗️ Development
Project Structure
bitrix24-mcp-server/
├── src/
│ ├── bitrix24/
│ │ └── client.ts # Bitrix24 API client
│ ├── tools/
│ │ └── index.ts # MCP tools definitions
│ ├── utils/
│ │ └── logger.ts # Logging utilities
│ ├── config/
│ │ └── index.ts # Configuration management
│ └── index.ts # Main MCP server
├── test/
│ └── integration.test.js # Integration tests
├── build/ # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md
Development Commands
# Install dependencies
npm install
# Build the project
npm run build
# Watch mode for development
npm run dev
# Run tests
npm test
# Start the server
npm start
Adding New Tools
- Define the tool in
src/tools/index.ts:
export const newTool: Tool = {
name: 'bitrix24_new_action',
description: 'Description of the new action',
inputSchema: {
type: 'object',
properties: {
// Define parameters
},
required: ['requiredParam']
}
};
- Add the execution handler:
case 'bitrix24_new_action':
// Implementation
return { success: true, result: 'Action completed' };
- Add to
allToolsarray and rebuild.
🔒 Security Considerations
- Webhook Security: Keep your webhook URL secret and rotate it regularly
- Environment Variables: Never commit
.envfiles to version control - Rate Limiting: The client includes built-in rate limiting (2 requests/second)
- Error Handling: Sensitive information is not exposed in error messages
🐛 Troubleshooting
Common Issues
"Webhook validation failed"
- Verify your webhook URL is correct
- Check that the webhook has appropriate permissions
- Ensure your Bitrix24 instance is accessible
"Cannot find module" errors
- Run
npm installto install dependencies - Ensure you've built the project with
npm run build
Rate limiting errors
- The client automatically handles rate limiting
- If you see persistent rate limit errors, consider reducing request frequency
Debug Mode
Set NODE_ENV=development and LOG_LEVEL=debug in your .env file for detailed logging.
📝 API Reference
Bitrix24Client Methods
Contacts
createContact(contact: BitrixContact): Promise<string>getContact(id: string): Promise<BitrixContact>updateContact(id: string, contact: Partial<BitrixContact>): Promise<boolean>listContacts(params?: ListParams): Promise<BitrixContact[]>
Deals
createDeal(deal: BitrixDeal): Promise<string>getDeal(id: string): Promise<BitrixDeal>updateDeal(id: string, deal: Partial<BitrixDeal>): Promise<boolean>listDeals(params?: ListParams): Promise<BitrixDeal[]>
Tasks
createTask(task: BitrixTask): Promise<string>getTask(id: string): Promise<BitrixTask>updateTask(id: string, task: Partial<BitrixTask>): Promise<boolean>listTasks(params?: TaskListParams): Promise<BitrixTask[]>
Users
getUser(userId: string): Promise<any>getAllUsers(): Promise<any[]>getUsersByIds(userIds: string[]): Promise<any[]>resolveUserNames(userIds: string[]): Promise<Record<string, string>>enhanceWithUserNames<T>(items: T[], userIdFields?: string[]): Promise<T[]>
Utilities
getCurrentUser(): Promise<any>searchCRM(query: string, entityTypes?: string[]): Promise<any>validateWebhook(): Promise<boolean>
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📄 License
MIT License - see LICENSE file for details.
🆘 Support
For issues and questions:
- Check the troubleshooting section
- Review Bitrix24 API documentation
- Open an issue on GitHub
Built with ❤️ for the AI automation community
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。