mcp-perfex-crm

mcp-perfex-crm

High-performance MCP server for Perfex CRM that provides direct MySQL access for managing customers, invoices, leads, projects, and more, with 10-100x faster performance than REST API.

Category
访问服务器

README

MCP Perfex CRM - High-Performance MCP Server for Perfex CRM

npm version TypeScript License Model Context Protocol N8N Compatible

🎯 Overview

MCP Perfex CRM is a high-performance Model Context Protocol (MCP) server that provides direct and optimized access to Perfex CRM's MySQL database. This project offers a high-performance alternative to traditional REST APIs, with focus on code quality, security, and maintainability.

✅ Current Status - v1.0.0-stable

  • 14 functional modules with 186+ tested tools covering comprehensive Perfex CRM functionality
  • Zero warnings in ESLint and TypeScript
  • Complete CI/CD with GitHub Actions
  • Robust type system implemented
  • Complete API documentation

🚀 Features

  • 🔥 Performance: Direct MySQL access, 10-100x faster than REST API
  • 🛡️ Security: Prepared statements, input validation, read-only connections
  • 📊 Modular: Extensible architecture with independent modules
  • 🧪 Tested: Jest testing framework with growing coverage
  • 📝 Documented: Complete API documentation with examples
  • 🔄 CI/CD: Automated pipeline with quality gates

📦 Available Modules

Core (100% Functional)

  • Customers - Complete customer management
  • Estimates - Estimates and proposals
  • Invoices - Complete invoice management with payments and statistics (8 tools)
  • Leads - Lead management, conversion, and lifecycle tracking (9 tools)
  • Projects - Project management
  • Tasks - Task control
  • Contracts - Contract management
  • Payments - Payment processing
  • Expenses - Expense control
  • Tickets - Complete support system with delete/export tools

Reporting

  • Financial Reporting - Advanced financial reports
  • Resource Management - Resource management
  • Timesheets - Time tracking

Utilities

  • Subscriptions - Subscription management
  • Credit Notes - Credit notes

🛠️ Installation

Option 1: NPM Installation (Recommended)

npm install -g mcp-perfex-crm

Option 2: Local Installation

# Clone repository
git clone https://github.com/YOUR_USERNAME/mcp-perfex-crm
cd mcp-perfex-crm

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env with your MySQL settings

# Compile project
npm run build

# Run tests
npm test

⚙️ Configuration

1. Database Configuration

# .env
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=perfex_readonly
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=perfex_crm

# Log optimization for production
LOG_LEVEL=error
NODE_ENV=production
ENABLE_AUDIT_LOG=false

2. N8N Integration

MCP Perfex CRM is fully compatible with N8N for workflow automation:

# Install as N8N tool
npm install -g mcp-perfex-crm

# Or use in N8N Docker
FROM n8nio/n8n:latest
RUN npm install -g mcp-perfex-crm

N8N Workflow Example:

{
  "nodes": [
    {
      "parameters": {
        "command": "mcp-perfex-crm",
        "options": {
          "env": {
            "MYSQL_HOST": "your-db-host",
            "MYSQL_USER": "readonly_user",
            "MYSQL_PASSWORD": "secure_password",
            "MYSQL_DATABASE": "perfex_crm"
          }
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [250, 300],
      "id": "perfex-crm-tool"
    }
  ]
}

3. Claude Desktop Integration

{
  "mcpServers": {
    "mcp-perfex-crm": {
      "command": "mcp-perfex-crm",
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "perfex_readonly",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "perfex_crm"
      }
    }
  }
}

For local installation:

{
  "mcpServers": {
    "mcp-perfex-crm": {
      "command": "node",
      "args": ["/path/to/mcp-perfex-crm/dist/index.js"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "perfex_readonly",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "perfex_crm"
      }
    }
  }
}

📖 Usage

Example: List Customers

// Via MCP
const result = await use_mcp_tool({
  server_name: "mcp-perfex-crm",
  tool_name: "get_customers",
  arguments: {
    limit: 10,
    active: true
  }
});

Example: Create Project

const result = await use_mcp_tool({
  server_name: "mcp-perfex-crm",
  tool_name: "create_project",
  arguments: {
    name: "New Website",
    client_id: 123,
    start_date: "2025-02-01",
    billing_type: "fixed_rate",
    project_cost: 5000
  }
});

🧪 Development

# Development mode with hot reload
npm run dev

# Run linter
npm run lint

# Format code
npm run format

# Run tests with coverage
npm run test:coverage

# Production build
npm run build

📊 Code Quality

  • TypeScript: Robust type system
  • ESLint: Zero warnings, strict configuration
  • Prettier: Consistent formatting
  • Jest: Configured testing framework
  • GitHub Actions: Automated CI/CD
  • Optimized Logging: Production configuration with minimal context impact

🔒 Security

  • All queries use prepared statements
  • Input validation on all tools
  • Read-only connections by default
  • Audit logs for sensitive operations
  • Masks for sensitive data in logs

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Code Standards

  • Follow the configured TypeScript/ESLint style
  • Add tests for new functionality
  • Keep documentation updated
  • Zero warnings is mandatory

📈 Roadmap

v1.0.1 (February 2025)

  • [ ] Enhanced error handling
  • [ ] Performance metrics dashboard
  • [ ] Automated documentation generation
  • [ ] Extended test coverage

v1.1.0 (Q1 2025)

  • [ ] Test coverage >80%
  • [ ] Complete TypeScript strict mode
  • [ ] Webhook support
  • [ ] Intelligent caching

v1.2.0 (Q2 2025)

  • [ ] Analytics dashboard
  • [ ] Batch operations
  • [ ] GraphQL gateway
  • [ ] Enhanced multi-tenant support

📝 Documentation

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Emanuel Almeida

🙏 Acknowledgments

  • Anthropic team for the Model Context Protocol
  • Perfex CRM community
  • All contributors

📊 Performance Benchmarks

Operation REST API MCP Direct Improvement
Get Customers (100) 2.3s 0.23s 10x faster
Create Project 1.8s 0.18s 10x faster
Complex Query 5.2s 0.52s 10x faster

🏗️ Architecture

mcp-perfex-crm/
├── src/
│   ├── modules/          # Business logic modules
│   ├── tools/            # MCP tools implementation
│   ├── types/            # TypeScript definitions
│   ├── utils/            # Utility functions
│   └── connections/      # Database connections
├── tests/                # Test suites
├── docs/                 # Documentation
└── examples/             # Usage examples

⭐ If this project helped you, please consider giving it a star!

🚀 Ready to supercharge your Perfex CRM integration? Get started now!

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选