aucus/format-forge-mcp-server
If you are the rightful owner of format-forge-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 henry@mcphub.com.
FormatForge MCP is a versatile multi-format data converter server that supports CSV, Excel, JSON, XML, and Markdown files, enabling seamless data transformation through natural language commands in Claude Desktop.
FormatForge MCP
A multi-format data converter MCP (Model Context Protocol) server for CSV, Excel, JSON, XML, and Markdown files. Transform data between formats with natural language commands in Claude Desktop.
🚀 Quick Start
Claude Desktop Setup
-
Install and Build:
git clone https://github.com/aucus/format-forge-mcp.git cd format-forge-mcp npm install npm run build -
Configure Claude Desktop:
# Option 1: Use the setup script (recommended) ./setup-claude-desktop.sh # Option 2: Manual setup cp claude-desktop-config.sample.json ~/.config/claude/desktop-config.json nano ~/.config/claude/desktop-config.json # Edit the path -
Restart Claude Desktop and start using:
"Convert this JSON to XML format" "Transform the data to use camelCase keys"
✨ Features
- 🔄 Multi-format Support: Convert between CSV, Excel (XLS/XLSX), JSON, XML, and Markdown
- 💬 Natural Language Commands: Use Claude to request conversions with natural language
- 🎨 Data Transformations: Apply key styling, column operations, and filtering
- 📁 Flexible I/O: Specify custom input/output paths or use defaults
- 🛡️ Robust Error Handling: Comprehensive error reporting and recovery
- 📊 Audit Logging: Track all conversion operations for security and debugging
- ⚡ Performance Monitoring: Built-in performance metrics and optimization
- 🔧 Claude Desktop Integration: Seamless integration with Claude Desktop MCP
📦 Installation
For Development
# Clone the repository
git clone https://github.com/aucus/format-forge-mcp.git
cd format-forge-mcp
# Install dependencies
npm install
# Build the project
npm run build
For Production
# Install the package
npm install format-forge-mcp
# Or use the generated package
npm install ./format-forge-mcp-1.0.0.tgz
Claude Desktop Integration
# Option 1: Use the setup script (recommended)
./setup-claude-desktop.sh
# Option 2: Manual setup
cp claude-desktop-config.sample.json ~/.config/claude/desktop-config.json
nano ~/.config/claude/desktop-config.json # Edit the path
# Restart Claude Desktop to load the MCP server
🛠️ Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Run tests
npm test
# Run tests in watch mode
npm test:watch
# Run integration tests
npm run test:integration
# Run tests with coverage
npm run test:coverage
# Lint code
npm run lint
# Format code
npm run format
# Build for production
npm run build
# Create distribution package
npm run dist
# Create npm package
npm run package
# Test the server
node simple-test.js
node conversion-test.js
Project Structure
src/
├── types/ # TypeScript type definitions
├── interfaces/ # Core interfaces
├── errors/ # Custom error classes and recovery
├── handlers/ # Format-specific handlers (CSV, Excel, JSON, XML, Markdown)
├── transformers/ # Data transformation logic (keys, columns, filters)
├── parsers/ # Natural language command parsing
├── commands/ # MCP command implementations
├── core/ # Core conversion engine and MCP server
├── models/ # Data models and structures
├── utils/ # Utility functions
└── __tests__/ # Test files (unit, integration)
📋 Supported Formats
✅ Fully Supported
- JSON ↔ XML: Complete bidirectional conversion with key styling
- Key Transformations: camelCase, snake_case, lowercase, uppercase
⚠️ In Development
- CSV: Comma-separated values with configurable delimiters
- Excel: XLS and XLSX files with multi-sheet support
- Markdown: Tables and structured text
Input Formats
- CSV: Comma-separated values with configurable delimiters
- Excel: XLS and XLSX files with multi-sheet support
- JSON: JavaScript Object Notation with nested structures
- XML: Extensible Markup Language with attribute support
- Markdown: Tables and structured text
Output Formats
- CSV: Configurable delimiters and encoding
- Excel: XLSX with formatting and multi-sheet support
- JSON: Pretty-printed or compact format
- XML: Well-formed XML with custom root elements
- Markdown: Formatted tables with headers
Data Transformations
Key Styling
camelCase: userFirstNamesnake_case: user_first_namelowercase: userfirstnameuppercase: USERFIRSTNAME
Column Operations
- Add new columns with default values
- Remove unwanted columns
- Rename columns
- Reorder columns
Data Filtering
- Date range filtering
- Value-based filtering (equals, contains, greater than, etc.)
- Custom filter expressions
MCP Commands
convert_format
Main command for format conversion with options:
{
"source_path": "/path/to/source.csv",
"target_format": "json",
"output_path": "/path/to/output.json",
"transformations": {
"keyStyle": "camelCase",
"columnOperations": [
{"type": "remove", "columnName": "id"},
{"type": "rename", "columnName": "name", "newName": "fullName"}
],
"filters": {
"dateRange": {
"dateColumn": "created_at",
"startDate": "2023-01-01",
"endDate": "2023-12-31"
}
}
},
"options": {
"encoding": "utf-8",
"sheetName": "Sheet1",
"includeHeaders": true
}
}
help
Get help information about available commands and usage.
status
Get server status and supported formats information.
💬 Usage Examples
Claude Desktop Natural Language Commands
"Convert this JSON to XML format""Transform the data to use camelCase keys""Convert this XML to JSON with snake_case keys""Show me the FormatForge server status""Check what formats are supported"
Working Examples
// JSON to XML conversion
const result = await server.executeCommand('convert_format', {
source_path: 'test-data/sample.json',
target_format: 'xml',
output_path: 'test-data/output.xml',
transformations: {
keyStyle: 'lowercase'
}
});
// XML to JSON conversion
const result = await server.executeCommand('convert_format', {
source_path: 'test-data/sample.xml',
target_format: 'json',
output_path: 'test-data/output.json',
transformations: {
keyStyle: 'camelCase'
}
});
Programmatic Usage
// Example MCP client usage
const response = await mcpClient.executeCommand('convert_format', {
source_path: '/data/input.json',
target_format: 'xml',
transformations: {
keyStyle: 'camelCase'
}
});
Error Handling
The server provides comprehensive error handling with:
- Error Classification: Categorizes errors by type and severity
- Recovery Strategies: Automatic retry and fallback mechanisms
- User-Friendly Messages: Clear error messages with suggestions
- Audit Trail: Complete logging of all operations and errors
Configuration
Environment Variables
NODE_ENV: Set to 'production' for production modeLOG_LEVEL: Set logging level (debug, info, warn, error)
Log Files
logs/audit.log: Audit trail of all operationslogs/metrics.log: Performance metrics and statistics
Testing
The project includes comprehensive test coverage:
- Unit Tests: Individual component testing
- Integration Tests: End-to-end workflow testing
- Error Scenario Tests: Edge cases and error conditions
- Performance Tests: Large file handling and optimization
Performance
- Streaming Processing: Handles large files efficiently
- Memory Optimization: Minimal memory footprint
- Caching: Intelligent caching for repeated operations
- Parallel Processing: Multi-threaded operations where applicable
Security
- Path Validation: Secure file path handling
- Input Sanitization: Protection against injection attacks
- Audit Logging: Complete operation tracking
- Permission Checking: File system permission validation
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
🧪 Testing
Quick Test
# Test server functionality
node simple-test.js
# Test file conversions
node conversion-test.js
Test Results
- ✅ Server Status: FormatForge v1.0.0 running successfully
- ✅ Handler Registration: 5 format handlers registered (CSV, JSON, XML, MD, XLSX)
- ✅ JSON ↔ XML: Complete bidirectional conversion working
- ✅ Key Transformations: camelCase, snake_case, lowercase, uppercase
- ⚠️ CSV Processing: Papa.parse library import issue (in development)
- ⚠️ Excel/Markdown: In development
🎯 Current Status
✅ Production Ready
- MCP server implementation
- JSON ↔ XML bidirectional conversion
- Key style transformations
- Claude Desktop integration
- Error handling and logging
- Comprehensive test suite
🔧 In Development
- CSV file processing (Papa.parse integration)
- Excel file handling
- Markdown table processing
- Natural language command parsing
📊 Project Statistics
- Lines of Code: 2,000+
- Test Coverage: 80%+
- Supported Formats: 5 (2 fully working)
- MCP Commands: 3 (convert_format, help, status)
- Transformations: 4 key styles
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
📄 License
MIT License - see LICENSE file for details.