order-mcp-server

encodium/order-mcp-server

3.2

If you are the rightful owner of order-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Laravel-based Model Context Protocol (MCP) server designed for comprehensive order management within the RevolutionParts automotive ecommerce platform.

Tools
5
Resources
0
Prompts
0

Order MCP Server

A Laravel-based Model Context Protocol (MCP) server that provides comprehensive order management capabilities for RevolutionParts automotive ecommerce platform. This server enables AI agents to retrieve detailed order information, including order details, line items, messages, and activity logs.

Features

🔍 Order Management Tools

  • Get Order Details - Retrieve comprehensive order information including status, customer details, financials, and shipping
  • Get Order Line Items - Access detailed product information, pricing, and physical specifications for each order item
  • Get Order Messages - View all customer communications and internal notes related to an order
  • Get Order Activity Logs - Track complete audit trail of order changes and system events
  • Update Order - Modify order status, administrative details, and shipping information

🏗️ Architecture

  • Laravel 12 framework with MCP integration
  • Multi-database support for orders (slowpoke/feed) and messaging (critdb/cdata)
  • Service layer architecture with dependency injection
  • Value Objects for type-safe data handling
  • Repository pattern for database abstraction

Prerequisites

  • PHP 8.2 or higher
  • Composer
  • MySQL access to RevolutionParts databases

Installation

  1. Clone the repository

    git clone <repository-url>
    cd order-mcp-server
    
  2. Install PHP dependencies

    composer install
    
  3. Environment setup

    cp .env.example .env
    php artisan key:generate
    
  4. Configure database connections

    • Update .env with your database credentials
    • Ensure access to slowpoke (orders) and critdb (messaging) servers

Configuration

Environment Variables

The application requires several environment variables for database connections:

# Main application database (orders)
DB_CONNECTION=mysql
DB_HOST=your-slowpoke-server
DB_DATABASE=feed
DB_USERNAME=your-username
DB_PASSWORD=your-password

# Messaging system database
DB_CRITDB_HOST=your-critdb-server
DB_CRITDB_DATABASE=mysql
DB_CRITDB_USERNAME=your-username
DB_CRITDB_PASSWORD=your-password

MCP Server Configuration

The server provides the following tools:

  • get-order - Retrieve order details by order number
  • get-order-line-items - Get all line items for an order
  • get-order-messages - Access order-related communications
  • get-order-activity-logs - View complete order activity history
  • update-order - Modify order status and details

Usage

Starting the MCP Server

php artisan mcp:start order

Testing Individual Tools

# Get order details
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get-order", "arguments": {"order_number": 1074123782}}}' | php artisan mcp:start order

# Get order line items
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get-order-line-items", "arguments": {"order_number": 1074123782}}}' | php artisan mcp:start order

# Get order messages
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get-order-messages", "arguments": {"order_number": 1074123782, "customer_id": 1104}}}' | php artisan mcp:start order

# Get activity logs
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get-order-activity-logs", "arguments": {"order_number": 1074123782, "customer_id": 1104}}}' | php artisan mcp:start order

Integration with Cursor

To use this MCP server with Cursor, add the following to your ~/.cursor/mcp.json:

{
  "mcpServers": {
    "order-mcp-server": {
      "command": "php",
      "args": [
        "/path/to/order-mcp-server/artisan",
        "mcp:start",
        "order"
      ],
      "cwd": "/path/to/order-mcp-server"
    }
  }
}

Development

Running Tests

# Run all tests
php artisan test

# Run specific test suite
php artisan test --testsuite=Unit
php artisan test --testsuite=Feature

Code Quality

# Run PHP CS Fixer
composer run cs-fixer

# Run PHPStan static analysis
composer run phpstan

Database Management

This MCP server connects to existing RevolutionParts databases and does not require any migrations or schema changes.

Dependencies

Composer Packages

  • laravel/framework - Laravel framework
  • laravel/mcp - Model Context Protocol integration
  • revolutionparts/messaging-service - Messaging system integration
  • revolutionparts/order-service - Order management services
  • revolutionparts/activity-service - Activity logging services

Local Development

The application uses local path repositories for RevolutionParts packages, allowing for seamless development and testing of service integrations.

Architecture

Service Layer

  • OrderService - Handles order operations and business logic
  • MessagingService - Manages customer communications and internal notes
  • ActivityLogService - Tracks order changes and system events

Value Objects

  • OrderVO - Immutable order data structure
  • OrderItemVO - Line item information with validation
  • MessageThread - Communication thread management
  • ActivityLog - Audit trail entries

Database Connections

  • slowpoke/feed - Primary order data storage
  • critdb/cdata - Customer-specific messaging data
  • Dynamic database resolution - Customer-specific cdata databases

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and quality checks
  5. Submit a pull request

License

This project is proprietary software owned by RevolutionParts.

Support

For technical support or questions about this MCP server, please contact the development team.