mcpcfc

MCPCFC - CF2023 CLI Enhanced Edition πŸš€

Overview

This is the enhanced CF2023 edition of MCPCFC, leveraging Adobe ColdFusion 2023’s capabilities to provide:

Current Status

βœ… All Phases Complete

Requirements

πŸ”’ Security Enhancements

Enhanced REPL Security Implementation

The REPL tools now include comprehensive security filtering:

  1. Pattern-Based Blocking with Word Boundaries
    • Uses regex patterns with \b word boundaries to prevent partial matches
    • Blocks over 80 dangerous patterns organized by category
    • Prevents bypass attempts through precise pattern matching
  2. Reflection and Class Loading Protection
    • Explicit blocking of .class(, .getClass(, classloader patterns
    • Prevents dynamic class loading and reflection attacks
    • Blocks access to Java internals
  3. Comprehensive Operation Blocking
    • File operations: fileread, filewrite, cffile, etc.
    • System commands: cfexecute, runtime.exec, processbuilder
    • Network operations: cfhttp, cfmail, cfsocket
    • Database operations: cfquery, queryexecute, cfstoredproc
    • Scope modifications: application., server., session.
    • Serialization: objectload, objectsave (RCE vectors)
  4. Thread Isolation and Timeout Protection
    • Code executes in separate cfthread context
    • Configurable timeout limits (default: 30 seconds)
    • Graceful thread termination on timeout

Security Recommendations

  1. Development Only: Use REPL tools only in trusted development environments
  2. Network Isolation: Run MCP server on isolated network in production
  3. Access Control: Implement authentication for all endpoints
  4. Audit Logging: All executions are logged to database
  5. Resource Monitoring: Use dashboards to monitor usage patterns

πŸ“Š Monitoring and Analytics

Database Setup

  1. Create MySQL database and configure datasource mcpcfc_ds
  2. Run http://localhost:8500/mcpcfc/database-setup.cfm to create tables:
    • tools - Tool registry
    • tool_executions - Execution logging with success/error tracking
    • example_data - Sample data for testing

Dashboards

  1. Full Dashboard (tool-dashboard.cfm)
    • Real-time statistics with auto-refresh
    • Filter by time period, tool, or session
    • Tool performance summary with success rates
    • Recent execution details with input preview
    • Visual indicators for success/failure rates
  2. Simple Dashboard (tool-dashboard-simple.cfm)
    • Basic statistics overview
    • Recent executions list
    • Lightweight alternative for quick monitoring

Log Management

Quick Start

  1. Clone the repository:

    git clone https://github.com/revsmoke/mcpcfc.git
    cd mcpcfc
    
  2. Set up the database:
    • Create MySQL database mcpcfc_db
    • Configure datasource mcpcfc_ds in CF Admin
    • Run http://localhost:8500/mcpcfc/database-setup.cfm
  3. Configure Claude Desktop:

    Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

    {
      "mcpServers": {
        "coldfusion-mcp": {
          "command": "/path/to/mcpcfc/cf-mcp-cf2023-cli.sh"
        }
      }
    }
    
  4. Start using 28 powerful tools!

Complete Tool List

  1. hello - Connection test
  2. sendEmail - Plain text emails
  3. sendHTMLEmail - HTML emails
  4. validateEmailAddress - Email validation
  5. queryDatabase - Database queries
  6. generatePDF - PDF generation
  7. extractPDFText - PDF text extraction
  8. mergePDFs - PDF merging

    • REPL Tools (4) - With Enhanced Security
  9. executeCode - Execute CFML with isolation
  10. evaluateExpression - Evaluate expressions
  11. testSnippet - Run code with assertions
  12. inspectVariable - Debug variables

    • Server Management (4)
  13. serverStatus - Server information
  14. configManager - Configuration management
  15. logStreamer - Log file access
  16. clearCache - Cache management

    • Package Management (6) - Requires CommandBox
  17. packageInstaller - Install packages
  18. packageList - List packages
  19. packageSearch - Search ForgeBox
  20. packageUpdate - Update packages
  21. packageRemove - Remove packages
  22. moduleManager - ColdBox modules

    • Development Workflow (6) - Requires CommandBox
  23. codeFormatter - Format CFML code
  24. codeLinter - Code analysis
  25. testRunner - Run tests
  26. generateDocs - Generate documentation
  27. watchFiles - File monitoring
  28. gitOperations - Git integration

Project Structure

/mcpcfc/
β”œβ”€β”€ Application.cfc              # Main application config with tool registration
β”œβ”€β”€ components/                  # Core MCP components
β”‚   β”œβ”€β”€ JSONRPCProcessor.cfc    # Protocol handler
β”‚   β”œβ”€β”€ SessionManager.cfc      # Session management
β”‚   β”œβ”€β”€ ToolHandler.cfc         # Tool execution with logging
β”‚   └── ToolRegistry.cfc        # Tool registration
β”œβ”€β”€ clitools/                   # CF2023 CLI tools
β”‚   β”œβ”€β”€ REPLTool.cfc           # REPL with enhanced security
β”‚   β”œβ”€β”€ ServerManagementTool.cfc # Server management
β”‚   β”œβ”€β”€ PackageManagerTool.cfc  # Package management
β”‚   └── DevWorkflowTool.cfc    # Development workflow
β”œβ”€β”€ endpoints/                   # HTTP/SSE endpoints
β”‚   β”œβ”€β”€ sse.cfm                 # SSE transport
β”‚   └── messages.cfm            # HTTP message handler
β”œβ”€β”€ tools/                      # Original 8 tools
β”œβ”€β”€ cli-bridge/                 # Bridge scripts
β”‚   └── cf-mcp-cf2023-cli.sh  # CF2023 CLI bridge
β”œβ”€β”€ client-examples/            # Test clients
β”œβ”€β”€ database-setup.cfm          # Database initialization
β”œβ”€β”€ tool-dashboard.cfm          # Full monitoring dashboard
β”œβ”€β”€ tool-dashboard-simple.cfm   # Simple dashboard
└── tool-log-cleanup.cfm        # Log management

Implementation Highlights

Security Improvements in REPLTool.cfc

Database Logging in ToolHandler.cfc

Shell Escaping in PackageManagerTool.cfc

Future Roadmap

Potential Phase 6: Advanced Features

SDK Development

Contributing

We welcome contributions! Areas of interest:

Version History


Elevating ColdFusion development with modern AI integration!

πŸš€ MCPCFC - ColdFusion MCP Server

-Bring AI Superpowers to Your ColdFusion Applications

The world’s first Model Context Protocol (MCP) server for ColdFusion!

License: MIT ColdFusion 2016+ Lucee 5+ Status: Working Claude Desktop: Working

Get Started β†’ View Demo Documentation

πŸŽ‰ NEW: Version 1.0.3 - All 8 tools working perfectly with Claude Desktop! See what’s new β†’


🌟 What is MCPCFC?

MCPCFC enables ColdFusion applications to serve as tool providers for AI assistants like Claude, ChatGPT, and other LLMs through the standardized Model Context Protocol.

In simple terms: Your ColdFusion apps can now talk to AI, and AI can use your CF tools!

🎯 Perfect For


⚑ Features at a Glance

πŸ› οΈ 8 Production-Ready Tools

βœ… PDF Operations - Generate, extract text, and merge PDFs
βœ… Email Automation - Send HTML/plain emails, validate addresses
βœ… Database Queries - Natural language database interactions
βœ… Extensible Design - Easy to add your own tools

πŸ”§ Technical Excellence

βœ… JSON-RPC 2.0 Protocol - Industry-standard communication
βœ… Real-time SSE Support - Live updates and streaming
βœ… Thread-Safe Design - Production-ready architecture
βœ… Claude Desktop Ready - Works out of the box


πŸš€ Quick Start

Option 1: Browser Testing (5 minutes)

# Clone the repository
git clone https://github.com/revsmoke/mcpcfc.git

# Place in your ColdFusion webroot
# Navigate to http://localhost:8500/mcpcfc/
# Open the test client and start using AI tools!

Option 2: Claude Desktop Integration (10 minutes)

  1. Install MCPCFC in your CF webroot
  2. Make bridge executable: chmod +x cf-mcp-clean-bridge.sh
  3. Add to Claude Desktop config:

    {
    "mcpServers": {
       "coldfusion-mcp": {
          "command": "/path/to/mcpcfc/cf-mcp-clean-bridge.sh"
       }
    }
    }
    
  4. Restart Claude Desktop - Your CF tools are now available!

πŸ“š Full Setup Guide β†’


🎬 See It In Action

Working Tools Demo

πŸ€– Claude: "Generate a PDF invoice for customer John Doe"
πŸ“„ MCPCFC: *Creates PDF with CF's built-in PDF tools*

πŸ€– Claude: "Email it to john@example.com"  
πŸ“§ MCPCFC: *Sends email with the PDF attached*

πŸ€– Claude: "Show me all customers from the database"
πŸ—„οΈ MCPCFC: *Queries your CF datasource and returns results*

Live Example

// Your existing CF code
component {
    function generateReport(customerId) {
        // Your business logic here
    }
}

// Now accessible to AI assistants!
// Claude can call: "Generate a report for customer 123"

πŸ“Š Why MCPCFC?

Challenge MCPCFC Solution
Legacy CF systems can’t use modern AI βœ… Bridge CF to any AI assistant
Complex integration requirements βœ… Drop-in solution, minimal setup
Security concerns βœ… Built-in controls and query limits
Limited CF community tools βœ… Open source and extensible

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude    │────▢│    MCPCFC    │────▢│ Your CF App β”‚
β”‚  Desktop    │◀────│  MCP Server  │◀────│   & Tools   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       ↓                    ↓                     ↓
   AI Assistant      JSON-RPC 2.0          PDF, Email,
                    + SSE Transport          Database

Directory Structure

/mcpcfc/
β”œβ”€β”€ Application.cfc           # Application configuration
β”œβ”€β”€ /components/             # Core MCP components
β”œβ”€β”€ /endpoints/              # HTTP/SSE endpoints
β”œβ”€β”€ /tools/                  # Tool implementations
β”œβ”€β”€ /client-examples/        # Test clients
β”œβ”€β”€ cf-mcp-clean-bridge.sh   # Claude Desktop bridge
└── README.md               # You are here!

πŸ”§ Available Tools

Current Tools (v1.0.3)

Tool Description Status
hello Simple greeting tool βœ… Working
queryDatabase Execute SELECT queries βœ… Working
generatePDF Create PDFs from HTML βœ… Working
extractPDFText Extract text from PDFs βœ… Working
mergePDFs Combine multiple PDFs βœ… Working
sendEmail Send plain text emails βœ… Working
sendHTMLEmail Send HTML emails βœ… Working
validateEmailAddress Validate email format βœ… Working

Adding Custom Tools

// 1. Register in Application.cfc
application.toolRegistry.registerTool("myTool", {
    "description": "My custom tool",
    "inputSchema": {
        "type": "object",
        "properties": {
            "param1": {"type": "string"}
        }
    }
});

// 2. Implement in ToolHandler.cfc
case "myTool":
    return executeMyTool(arguments.args);

πŸ›‘οΈ Security & Configuration

Database Security


🀝 Contributing

We need your help to make MCPCFC even better!

How to Contribute

  1. Star the repo - Help others discover MCPCFC
  2. Report issues - Found a bug? Let us know!
  3. Submit PRs - Add features or fix issues
  4. Share your use cases - Tell us how you’re using it
  5. Write documentation - Help others get started

Contributing Guide β†’

Roadmap


πŸ“š Resources

Community


πŸ™ Acknowledgments


πŸ“„ License

MCPCFC is open source software licensed under the MIT License.


πŸš€ Ready to Get Started?

Download MCPCFC | View on GitHub | Read the Docs

Show Your Support

If MCPCFC helps your project, please consider:


CFLOVE

-Made with ❀️ for the ColdFusion community

🌐 mcpcfc.dev πŸ“§ hello@mcpcfc.dev