Enhanced QR Code MCP Server
An advanced Model Context Protocol (MCP) server that generates QR codes and automatically saves them as PNG files with comprehensive metadata, batch processing capabilities, and file management tools.
๐ Dual Implementation Strategy
This Python implementation focuses on reliable file generation and batch processing.
For advanced styling, analysis, and templates, see our TypeScript implementation.
Built upon and enhanced from: @jwalsh/mcp-server-qrcode
This enhanced version adds automatic file generation, metadata tracking, batch processing, and production-ready features while maintaining full compatibility with the MCP protocol.
๐ Key Enhancements Over Original
Feature | Original MCP | Enhanced Python MCP | Enhanced TypeScript MCP |
PNG File Output | โ Chat display only | โ Automatic PNG file saving | โ Multiple formats (PNG, SVG, PDF) |
Directory Management | โ None | โ Custom output directories | โ Configurable paths |
Metadata Tracking | โ None | โ JSON metadata files | โ Comprehensive metadata |
Batch Processing | โ One at a time | โ Multiple QR codes per call | โ Advanced batch features |
File Organization | โ None | โ Structured file management | โ Template-based organization |
Custom Filenames | โ None | โ User-defined naming | โ Smart naming patterns |
Production Ready | โ Basic | โ Complete test suite & docs | โ Enterprise features |
Advanced Styling | โ None | ๐ Planned (see | โ Full styling engine |
QR Analysis | โ None | ๐ Planned (see | โ Decode & quality analysis |
Templates | โ None | ๐ Planned (see | โ Pre-defined templates |
๐ ๏ธ Installation
Prerequisites
Python 3.8+
MCP client (Claude Desktop, VS Code extension, etc.)
Quick Setup
Manual Setup
๐ง MCP Client Configuration
Add to your MCP client configuration:
๐ Available Tools
1. generate_and_save_qrcode
Generate a single QR code and automatically save as PNG file.
Parameters:
content(required): Text content to encodeoutput_directory: Target directory (default:./qr_output/)filename: Custom filename (auto-generated if empty)errorCorrectionLevel: L, M, Q, or H (default: M)size: Size multiplier 1-20 (default: 5)border: Border size 1-20 (default: 4)include_metadata: Generate JSON metadata (default: true)display_in_chat: Show in chat interface (default: true)
Example:
Output:
PNG file:
github_repo.pngMetadata:
github_repo_metadata.jsonChat display (optional)
2. batch_generate_qrcodes
Generate multiple QR codes from array input.
Example:
Output:
PNG files:
qr_contact.png,qr_website.pngIndividual metadata files
Batch manifest:
batch_manifest_YYYYMMDD_HHMMSS.json
3. list_generated_qrcodes
List all QR code files in a directory with metadata.
๐ File Structure
Generated Files
Metadata Format
๐ฏ Use Cases
Business Applications
Event Management: Generate ticket QR codes as ready-to-print PNG files
Marketing: Create campaign QR codes with tracking metadata
Inventory: Generate asset labels with automatic file organization
Contact Sharing: Batch create vCard QR codes for business cards
Technical Integration
Print Production: Direct PNG output for design workflows
API Workflows: Batch generate QR codes from database records
Asset Management: Organized file structure with metadata
Quality Control: Error correction levels for different environments
๐งช Testing
Run the comprehensive test suite:
Expected Output:
๐ Performance
Single QR code: ~50ms generation + file save
Batch processing: ~100ms per code + manifest
Metadata generation: ~5ms per file
File listing: ~10ms per 100 files
๐ Error Correction Levels
L (Low): ~7% damage recovery - basic indoor use
M (Medium): ~15% damage recovery - standard use (default)
Q (Quartile): ~25% damage recovery - industrial environments
H (High): ~30% damage recovery - outdoor/damaged surfaces
๐ Future Enhancements
See our comprehensive ROADMAP.md for detailed development plans including:
๐ Coming Soon (v2.1.0)
Structured content builders for vCard, WiFi, and events
SVG and PDF output formats
Enhanced validation and content optimization
๐จ Advanced Features (Available in TypeScript Version)
Our TypeScript implementation already includes:
Custom styling with colors, logos, and gradients
QR code analysis and decoding capabilities
Template system with pre-defined styles
Quality assessment tools with recommendations
๐ Choosing the Right Implementation
Use Case | Recommended Version |
File generation & batch processing | ๐ Python version (this repo) |
Advanced styling & customization | ๐จ TypeScript version |
QR code analysis & decoding | ๐จ TypeScript version |
Production file workflows | ๐ Python version (this repo) |
Template-based generation | ๐จ TypeScript version |
Metadata tracking & organization | ๐ Python version (this repo) |
๐ Troubleshooting
Common Issues
ModuleNotFoundError: No module named 'mcp'
Permission denied on setup.sh
QR code not saving
Check directory permissions
Verify output path exists
Check disk space
Testing the Server
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Development Setup
๐ License
MIT License - see LICENSE file for details.
๐ Acknowledgments
Original Work: @jwalsh/mcp-server-qrcode - Foundation QR code MCP server
MCP Protocol: Model Context Protocol - Enabling AI-tool integration
QR Code Library: qrcode - Core QR code generation
Pillow: PIL/Pillow - Image processing capabilities
๐ Related Projects
Enhanced TypeScript Version - Advanced styling and analysis features
Original MCP QR Code Server - The foundation this builds upon
Model Context Protocol - MCP specification and tools
Claude Desktop - AI assistant with MCP support
๐ Repository Stats
Language: Python 3.8+
Dependencies: MCP, qrcode, Pillow
Test Coverage: 100% (4/4 tests passing)
Documentation: Complete with examples
License: MIT
Enhanced QR Code MCP Server v2.0.0
Production-ready QR code generation with automatic PNG file output and comprehensive metadata
Built with โค๏ธ upon the excellent foundation of @jwalsh/mcp-server-qrcode