Enhanced QR Code MCP Server

Enhanced QR Code MCP Server

Generates QR codes and automatically saves them as PNG files with metadata tracking, batch processing capabilities, and organized file management for production workflows.

Category
Visit Server

README

Enhanced QR Code MCP Server

License: MIT Python 3.8+ MCP Compatible

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 ROADMAP) โœ… Full styling engine
QR Analysis โŒ None ๐Ÿ”„ Planned (see ROADMAP) โœ… Decode & quality analysis
Templates โŒ None ๐Ÿ”„ Planned (see ROADMAP) โœ… Pre-defined templates

๐Ÿ› ๏ธ Installation

Prerequisites

  • Python 3.8+
  • MCP client (Claude Desktop, VS Code extension, etc.)

Quick Setup

git clone https://github.com/myownipgit/enhanced-qrcode-mcp.git
cd enhanced-qrcode-mcp
chmod +x setup.sh
./setup.sh

Manual Setup

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Make server executable
chmod +x src/enhanced_qrcode_server.py

๐Ÿ”ง MCP Client Configuration

Add to your MCP client configuration:

{
  "mcpServers": {
    "enhanced-qrcode": {
      "command": "python3",
      "args": ["/path/to/enhanced-qrcode-mcp/src/enhanced_qrcode_server.py"],
      "env": {},
      "description": "Enhanced QR code generator with automatic PNG file saving"
    }
  }
}

๐Ÿ“š Available Tools

1. generate_and_save_qrcode

Generate a single QR code and automatically save as PNG file.

Parameters:

  • content (required): Text content to encode
  • output_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:

{
  "content": "https://github.com/myownipgit/enhanced-qrcode-mcp",
  "output_directory": "./qr_codes/",
  "filename": "github_repo",
  "errorCorrectionLevel": "H",
  "size": 6
}

Output:

  • PNG file: github_repo.png
  • Metadata: github_repo_metadata.json
  • Chat display (optional)

2. batch_generate_qrcodes

Generate multiple QR codes from array input.

Example:

{
  "qr_codes": [
    {
      "id": "contact",
      "content": "BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nORG:Acme Corp\nTEL:555-0123\nEMAIL:john@acme.com\nEND:VCARD",
      "type": "vcard"
    },
    {
      "id": "website", 
      "content": "https://example.com",
      "type": "url"
    }
  ],
  "output_directory": "./batch_output/",
  "size": 5
}

Output:

  • PNG files: qr_contact.png, qr_website.png
  • Individual metadata files
  • Batch manifest: batch_manifest_YYYYMMDD_HHMMSS.json

3. list_generated_qrcodes

List all QR code files in a directory with metadata.

{
  "directory": "./qr_output/"
}

๐Ÿ“ File Structure

Generated Files

output_directory/
โ”œโ”€โ”€ qr_20250616_143022_hello_world.png
โ”œโ”€โ”€ qr_20250616_143022_hello_world_metadata.json
โ”œโ”€โ”€ github_repo.png
โ”œโ”€โ”€ github_repo_metadata.json
โ””โ”€โ”€ batch_manifest_20250616_143500.json

Metadata Format

{
  "generated_date": "2025-06-16T14:30:22.123456",
  "content": "Hello World!",
  "parameters": {
    "error_correction": "M",
    "size": 5,
    "border": 4,
    "box_size": 10
  },
  "png_file": "/path/to/qr_file.png",
  "file_size_bytes": 1117
}

๐ŸŽฏ 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:

# Activate virtual environment
source venv/bin/activate

# Run tests
python3 tests/test_server.py

Expected Output:

๐Ÿš€ Running Enhanced QR Code MCP Server Tests
โœ… QR code generation successful
โœ… Filename generation tests passed  
โœ… File operations tests passed
โœ… Integration test passed - 3 files generated
๐Ÿ“Š Test Results: 4/4 passed
๐ŸŽ‰ All tests passed! Enhanced MCP server is ready to use.

๐Ÿ“ˆ 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'

pip install mcp

Permission denied on setup.sh

chmod +x setup.sh

QR code not saving

  • Check directory permissions
  • Verify output path exists
  • Check disk space

Testing the Server

# Test dependencies
python3 -c "import qrcode, mcp; print('โœ… Dependencies OK')"

# Test server startup
python3 src/enhanced_qrcode_server.py

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Development Setup

git clone https://github.com/myownipgit/enhanced-qrcode-mcp.git
cd enhanced-qrcode-mcp
./setup.sh
source venv/bin/activate
python3 tests/test_server.py

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ”— Related Projects

๐Ÿ“Š 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured