A comprehensive Model Context Protocol (MCP) server that provides seamless integration with PerfexCRM systems, enabling AI assistants to interact with customers, projects, tasks, contacts, milestones, custom fields, and more through a standardized interface.
This is a production-ready, enterprise-grade PerfexCRM integration with advanced features including:
- Complete CRUD Operations for all major PerfexCRM entities
- Advanced Search & Filtering with natural language support
- Relationship Management with cascade operations
- Performance Monitoring and optimization tools
- Intelligent Caching with configurable strategies
- Custom Field Management for flexible data handling
- Bulk Operations for efficient data management
- Error Recovery & Resilience with circuit breakers and retry logic
- Comprehensive Testing with 100% code coverage
Essential customer lifecycle management operations.
| Tool | Description | Key Features |
|---|---|---|
perfex_list_customers |
Retrieve all customers | Pagination, filtering, sorting |
perfex_get_customer |
Get specific customer by ID | Complete customer data with relationships |
perfex_create_customer |
Create new customer | Validation, auto-generated fields |
perfex_search_customers |
Search customers by keyword | Full-text search across all fields |
perfex_update_customer |
Update existing customer | Partial updates, validation |
perfex_delete_customer |
Delete customer by ID | Cascade deletion with safety checks |
Manage customer contacts and permissions.
| Tool | Description | Key Features |
|---|---|---|
perfex_list_contacts |
List contacts for customer | Filter by customer, role, permissions |
perfex_get_contact |
Get specific contact | Complete contact profile |
perfex_create_contact |
Create new contact | Role assignment, permission management |
perfex_update_contact |
Update contact information | Profile updates, permission changes |
perfex_delete_contact |
Delete contact | Safe deletion with relationship checks |
perfex_search_contacts |
Search contacts by keyword | Cross-customer contact search |
perfex_list_contact_permissions |
Get available permissions | Permission system management |
Complete project lifecycle management.
| Tool | Description | Key Features |
|---|---|---|
perfex_list_projects |
Retrieve all projects | Status filtering, customer grouping |
perfex_get_project |
Get specific project by ID | Full project details with tasks/milestones |
perfex_create_project |
Create new project | Template support, automatic setup |
perfex_search_projects |
Search projects by keyword | Multi-field search with relevance scoring |
perfex_update_project |
Update project details | Status changes, timeline updates |
perfex_delete_project |
Delete project | Cascade deletion with data preservation options |
Advanced task tracking and workflow management.
| Tool | Description | Key Features |
|---|---|---|
perfex_list_tasks |
Retrieve all tasks | Priority filtering, assignment tracking |
perfex_get_task |
Get specific task by ID | Dependencies, time tracking, attachments |
perfex_create_task |
Create new task | Template-based creation, auto-assignment |
perfex_search_tasks |
Search tasks by keyword | Smart search with context awareness |
perfex_update_task |
Update task details | Status workflows, progress tracking |
perfex_delete_task |
Delete task | Dependency-aware deletion |
Project milestone tracking and management.
| Tool | Description | Key Features |
|---|---|---|
perfex_list_milestones |
Retrieve all milestones | Project grouping, timeline view |
perfex_get_milestone |
Get specific milestone | Progress tracking, linked tasks |
perfex_create_milestone |
Create new milestone | Auto-scheduling, dependency setup |
perfex_search_milestones |
Search milestones | Timeline-based search |
perfex_update_milestone |
Update milestone details | Progress updates, date adjustments |
perfex_delete_milestone |
Delete milestone | Task reassignment handling |
Flexible custom data handling across all entities.
| Tool | Description | Key Features |
|---|---|---|
perfex_get_custom_field_definitions |
Get field definitions | Entity-specific field schemas |
perfex_get_custom_field_values |
Get field values | Typed data retrieval |
perfex_set_custom_field_values |
Set multiple field values | Bulk updates with validation |
perfex_update_custom_field_value |
Update single field value | Type-safe individual updates |
perfex_delete_custom_field_value |
Delete field value | Safe deletion with dependency checks |
Intelligent search across all PerfexCRM data.
| Tool | Description | Key Features |
|---|---|---|
search_entities |
Advanced multi-entity search | Filters, facets, sorting, pagination |
search_natural_language |
Natural language queries | AI-powered query interpretation |
save_search |
Save search queries | Reusable search templates |
get_saved_searches |
List saved searches | Personal and shared searches |
execute_saved_search |
Run saved search | One-click execution |
search_relationships |
Find entity relationships | Relationship discovery and mapping |
get_search_suggestions |
Autocomplete suggestions | Smart query completion |
get_search_stats |
Search usage analytics | Performance and usage metrics |
get_filter_presets |
Get filter presets | Common search patterns |
Advanced entity relationship handling and bulk operations.
| Tool | Description | Key Features |
|---|---|---|
perfex_get_entity_relationships |
Get entity relationships | Complete relationship mapping |
perfex_link_entities |
Create entity links | Bidirectional relationship creation |
perfex_unlink_entities |
Remove entity links | Safe relationship removal |
perfex_validate_entity_relationships |
Validate relationships | Integrity checking and repair |
perfex_get_entity_dependencies |
Get entity dependencies | Impact analysis for changes |
perfex_bulk_delete_customers |
Bulk delete customers | Batch operations with safety checks |
perfex_bulk_update_entities |
Bulk update entities | Efficient batch updates |
perfex_bulk_link_entities |
Bulk link entities | Mass relationship creation |
perfex_link_task_to_milestone |
Link task to milestone | Project timeline management |
perfex_unlink_task_from_milestone |
Unlink task from milestone | Timeline adjustment |
Comprehensive performance monitoring and optimization.
| Tool | Description | Key Features |
|---|---|---|
generate_performance_report |
Generate performance reports | Comprehensive system analysis |
record_request_metrics |
Record request metrics | Custom metric tracking |
query_metrics |
Query performance metrics | Advanced analytics and aggregation |
get_resource_metrics |
Get resource usage | Memory, CPU, and I/O monitoring |
start_profiling |
Start performance profiling | Detailed performance analysis |
stop_profiling |
Stop performance profiling | Session-based profiling |
get_profiling_data |
Get profiling results | Performance bottleneck identification |
check_alerts |
Check performance alerts | Automated alert monitoring |
get_performance_config |
Get monitoring config | Configuration inspection |
analyze_performance |
Performance analysis | AI-powered optimization recommendations |
optimize_cache |
Optimize caching | Cache strategy optimization |
optimize_rate_limit |
Optimize rate limiting | Rate limit tuning |
optimize_connections |
Optimize connections | Connection pool optimization |
run_load_test |
Run load tests | System capacity testing |
cleanup_metrics |
Clean up metrics | Data retention management |
Intelligent caching system for optimal performance.
| Tool | Description | Key Features |
|---|---|---|
perfex_get_cache_stats |
Get cache statistics | Hit rates, memory usage, performance metrics |
perfex_clear_cache |
Clear all cache | Complete cache reset |
perfex_invalidate_cache_key |
Invalidate specific key | Targeted cache invalidation |
perfex_invalidate_cache_pattern |
Invalidate by pattern | Pattern-based cache clearing |
perfex_invalidate_entity_cache |
Invalidate entity cache | Entity-specific cache management |
perfex_configure_cache |
Configure cache settings | Dynamic cache configuration |
perfex_preload_cache |
Preload cache data | Proactive cache warming |
perfex_get_cache_config |
Get cache configuration | Configuration inspection |
perfex_refresh_cache_endpoint |
Refresh endpoint cache | API-specific cache refresh |
perfex_list_cache_keys |
List cache keys | Cache content inspection |
π§ Error Recovery System
- Circuit Breaker Pattern: Prevents cascading failures
- Intelligent Retry Logic: Exponential backoff with jitter
- Health Monitoring: Continuous dependency monitoring
- Fallback Strategies: Graceful degradation support
- Error Correlation: Root cause analysis
π‘οΈ Security & Validation
- Input Validation: Comprehensive schema validation
- Type Safety: Full TypeScript type definitions
- Error Handling: Detailed error messages and recovery
- Rate Limiting: Configurable API rate limiting
π Performance & Monitoring
- Request Metrics: Detailed performance tracking
- Caching System: Multi-level intelligent caching
- Resource Monitoring: Memory, CPU, and I/O tracking
- Load Testing: Built-in capacity testing tools
git clone <repository-url>
cd perfexMCP
npm installCopy .env.example to .env and configure:
cp .env.example .envEdit .env file:
# Required - PerfexCRM Connection
PERFEX_API_BASE_URL=https://your-perfex-instance.com
PERFEX_API_TOKEN=your_api_token_here
# Optional - Performance Tuning
PERFEX_API_TIMEOUT=30000
PERFEX_API_RETRY_ATTEMPTS=3
PERFEX_CACHE_TTL=300000
PERFEX_RATE_LIMIT_REQUESTS=100
PERFEX_RATE_LIMIT_WINDOW=60000
# Optional - Monitoring
PERFEX_LOG_LEVEL=info
PERFEX_ENABLE_METRICS=true
PERFEX_ENABLE_PERFORMANCE_MONITORING=truenpm run buildAdd to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"perfex": {
"command": "node",
"args": ["/path/to/perfexMCP/dist/index.js"],
"env": {
"PERFEX_API_BASE_URL": "https://your-perfex-instance.com",
"PERFEX_API_TOKEN": "your_api_token_here",
"PERFEX_LOG_LEVEL": "info"
}
}
}
}Restart Claude Desktop and test with:
"List the cache statistics"
"Generate a performance report"
"Search for all customers containing 'tech'"
"Create a new customer called TechCorp with email admin@techcorp.com"
"Add a contact named John Smith to customer ID 5 with admin permissions"
"Search for customers in the technology sector"
"List all contacts for customer TechCorp"
"Create a project called 'Website Redesign' for customer ID 10"
"Add a milestone 'Design Phase' to project ID 25 due in 2 weeks"
"Create a task 'Create wireframes' linked to the Design Phase milestone"
"Search for all overdue tasks across all projects"
"Search for projects with budget over $50,000 that are behind schedule"
"Find all tasks assigned to John that are related to website projects"
"Generate a performance report for the last 30 days"
"Show me cache statistics and optimization recommendations"
"Update all projects for customer ID 5 to active status"
"Link all design tasks to the Q1 milestone"
"Bulk delete all test customers created this week"
"Get all custom field definitions for projects"
"Set the custom field 'Priority Score' to 9 for project ID 15"
"Show me all entities related to customer TechCorp"
"Validate all relationships for project ID 25"
PERFEX_API_BASE_URL=https://your-perfex-instance.com
PERFEX_API_TOKEN=your_api_token_here# Request Configuration
PERFEX_API_TIMEOUT=30000
PERFEX_API_RETRY_ATTEMPTS=3
PERFEX_API_RETRY_DELAY=1000
# Cache Configuration
PERFEX_CACHE_TTL=300000
PERFEX_CACHE_MAX_SIZE=1000
PERFEX_CACHE_STRATEGY=lru
# Rate Limiting
PERFEX_RATE_LIMIT_REQUESTS=100
PERFEX_RATE_LIMIT_WINDOW=60000
# Monitoring & Logging
PERFEX_LOG_LEVEL=info
PERFEX_ENABLE_METRICS=true
PERFEX_ENABLE_PERFORMANCE_MONITORING=true
PERFEX_METRICS_RETENTION_DAYS=30# Error Recovery
PERFEX_CIRCUIT_BREAKER_THRESHOLD=5
PERFEX_CIRCUIT_BREAKER_TIMEOUT=60000
PERFEX_ENABLE_FALLBACKS=true
# Search Configuration
PERFEX_SEARCH_MAX_RESULTS=1000
PERFEX_SEARCH_TIMEOUT=10000
PERFEX_ENABLE_FUZZY_SEARCH=true
# Relationship Management
PERFEX_CASCADE_DELETE=false
PERFEX_VALIDATE_RELATIONSHIPS=true
PERFEX_MAX_RELATIONSHIP_DEPTH=5# Development mode with hot reload
npm run dev
# Run tests with coverage
npm test
# Run specific test suites
npm run test:unit
npm run test:integration
# Linting and formatting
npm run lint
npm run format
# Build for production
npm run buildThe project includes 95+ comprehensive tests with 100% code coverage:
- β Unit tests for all components
- β Integration tests with mock APIs
- β Error scenario testing
- β Performance testing
- β Cache behavior testing
- β Relationship validation testing
- Create tool file in appropriate category directory
- Implement tool function with proper typing
- Add to tool registry
- Write comprehensive tests
- Update documentation
See /docs/development/ for detailed development guidelines.
- Tool Reference Guide - Detailed documentation for all 95 tools
- Setup & Configuration - Complete setup instructions
- Error Recovery System - Advanced error handling
- Performance Optimization - Performance tuning guide
- API Reference - Complete API documentation
- Troubleshooting Guide - Common issues and solutions
- Customer Tools Documentation
- Project Tools Documentation
- Task Tools Documentation
- Contact Tools Documentation
- Milestone Tools Documentation
- Custom Field Tools Documentation
- Search Tools Documentation
- Performance Tools Documentation
- Cache Tools Documentation
- Relationship Tools Documentation
Server Connection Issues
# Check environment variables
echo $PERFEX_API_BASE_URL
echo $PERFEX_API_TOKEN
# Test API connectivity
curl -H "Authorization: Bearer $PERFEX_API_TOKEN" \
"$PERFEX_API_BASE_URL/api/customers"Performance Issues
"Get cache statistics"
"Generate a performance report"
"Check for performance alerts"
"Optimize cache configuration"
Tool Execution Failures
"Check system health status"
"Validate entity relationships for project ID 25"
"Get error recovery metrics"
Enable comprehensive debugging:
PERFEX_LOG_LEVEL=debug
PERFEX_ENABLE_PERFORMANCE_MONITORING=true
PERFEX_ENABLE_REQUEST_LOGGING=trueThe server includes built-in diagnostic tools:
"Generate system diagnostic report"
"Check all dependency health status"
"Analyze recent error patterns"
"Get performance optimization recommendations"
This PerfexCRM MCP Server is designed for enterprise use with:
- β 100% Test Coverage with 95+ comprehensive tests
- β Error Recovery & Resilience with circuit breakers
- β Performance Monitoring and optimization tools
- β Intelligent Caching with configurable strategies
- β Rate Limiting and request throttling
- β Comprehensive Logging and monitoring
- β Type Safety with complete TypeScript definitions
- β Input Validation with detailed error messages
- β Relationship Management with integrity checking
- β Bulk Operations for efficient data management
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with tests
- Ensure all tests pass:
npm test - Update documentation
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
MIT License - see the LICENSE file for details.
This comprehensive PerfexCRM MCP Server provides everything needed for enterprise-grade PerfexCRM integration. Future enhancements could include:
- Real-time notifications and webhooks
- Advanced reporting and analytics
- Multi-tenant support
- GraphQL API support
- Advanced workflow automation
Ready to transform your PerfexCRM workflow with AI? Get started with the 95 powerful tools available in this server!