QR Code Generation MCP Server

QR Code Generation MCP Server

Generate customizable QR codes from text via an MCP-compliant server.

11
Stars
4
Forks
11
Watchers
0
Issues
Provides a server for generating QR codes from text input using the Model Context Protocol (MCP), supporting multiple transport modes such as STDIO, HTTP, and SSE. Allows customization of QR code appearance with options for color, style, and encoding settings. Outputs QR codes as base64 strings for easy integration or direct use in applications. Designed for compatibility with platforms like Claude Desktop and deployments using Docker or direct Python API usage.

Key Features

Text-to-QR code conversion
Base64 encoding output
Customizable QR code color and style
Supports STDIO, HTTP, and SSE transport modes
Docker deployment support
Direct Python API accessibility
Integration with Claude Desktop
Environment variable-based configuration
Supports Chinese and other Unicode characters
Flexible server port and host configuration

Use Cases

Automated QR code generation pipelines
Integration with chatbots or AI assistants requiring dynamic QR code outputs
Embedding QR code generation in desktop or web applications
Providing QR code generation as a network service
Generating QR codes for event tickets or digital passes
Dynamic content sharing via QR codes in messaging platforms
Batch generating QR codes for marketing campaigns
Deploying QR code generation services in containerized environments
Custom styling of QR codes for branding purposes
Offering self-hosted QR code services for privacy-focused scenarios

README

QR Code Generation MCP Server

A QR code generation MCP server implemented using FastMCP, supporting text-to-QR code conversion with base64 encoding output.

Features

  • Support for any text to QR code conversion (including Chinese characters)
  • Customizable colors and styles
  • Base64 encoding
  • Support for STDIO, HTTP, and SSE transport modes

Installation

bash
uv sync
# or
pip install qrcode Pillow mcp

Usage

0. Docker Usage

Build Image

bash
docker build -t qrcode-mcp .

Run Container

bash
# Default SSE mode
docker run -p 8008:8008 qrcode-mcp

# HTTP mode
docker run -p 8008:8008 -e TRANSPORT_MODE=http qrcode-mcp

# STDIO mode (for testing)
docker run -e TRANSPORT_MODE=stdio qrcode-mcp

# Custom host and port
docker run -p 9000:9000 -e TRANSPORT_MODE=http -e HOST=0.0.0.0 -e PORT=9000 qrcode-mcp

Environment Variables

  • TRANSPORT_MODE: Transport mode (sse, http, stdio), default: sse
  • HOST: Host address to bind, default: 0.0.0.0
  • PORT: Port to bind, default: 8008

Docker Compose

yaml
version: '3.8'
services:
  qrcode-mcp:
    build: .
    ports:
      - "8008:8008"
    environment:
      - TRANSPORT_MODE=sse
      - HOST=0.0.0.0
      - PORT=8008

1. MCP Server Mode

Start Server

bash
# STDIO mode (for Claude Desktop)
python qrcode_mcp_server.py

# HTTP mode
python qrcode_mcp_server.py --http --host 127.0.0.1 --port 8008

# SSE mode (Server-Sent Events) Deprecated
python qrcode_mcp_server.py --sse --host 127.0.0.1 --port 8008

Configure Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

STDIO Mode (Local Use):

json
{
  "mcpServers": {
    "qrcode-mcp": {
      "command": "python",
      "args": ["/ABSOLUTE/PATH/TO/qrcode_mcp/qrcode_mcp_server.py"],
      "cwd": "/ABSOLUTE/PATH/TO/qrcode_mcp"
    }
  }
}

HTTP Mode (Network Deployment):

json
{
  "mcpServers": {
    "qrcode-mcp": {
      "transport": "http",
      "url": "http://127.0.0.1:8008/mcp/"
    }
  }
}

SSE Mode (Server-Sent Events):

json
{
  "mcpServers": {
    "qrcode-mcp": {
      "serverUrl": "http://127.0.0.1:8008/sse"
    }
  }
}

2. Direct Python API Usage

python
from qrcode_utils import text_to_qr_base64

# Basic usage
base64_result = text_to_qr_base64("Hello, World!")

# Custom styling
base64_result = text_to_qr_base64(
    "Custom QR Code",
    box_size=15,
    fill_color="darkblue",
    back_color="lightgray"
)

MCP Tools

generate_qr_code

Generate QR code and return base64 encoding.

Parameters:

  • text (required): Text content to convert
  • box_size (optional): Pixel size of each box, default 10
  • border (optional): Number of border boxes, default 4
  • fill_color (optional): Foreground color, default "black"
  • back_color (optional): Background color, default "white"
  • return_data_url (optional): Whether to return Data URL format, default false

Testing

bash
python test_mcp_client.py

License

MIT License

Star History

Star History Chart

Repository Owner

2niuhe
2niuhe

User

Repository Details

Language Python
Default Branch main
Size 65 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
88.44%
Shell
7.7%
Dockerfile
3.86%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Unichat MCP Server

    Unichat MCP Server

    Universal MCP server providing context-aware AI chat and code tools across major model vendors.

    Unichat MCP Server enables sending standardized requests to leading AI model vendors, including OpenAI, MistralAI, Anthropic, xAI, Google AI, DeepSeek, Alibaba, and Inception, utilizing the Model Context Protocol. It features unified endpoints for chat interactions and provides specialized tools for code review, documentation generation, code explanation, and programmatic code reworking. The server is designed for seamless integration with platforms like Claude Desktop and installation via Smithery. Vendor API keys are required for secure access to supported providers.

    • 37
    • MCP
    • amidabuddha/unichat-mcp-server
  • Yuque-MCP-Server

    Yuque-MCP-Server

    Seamless integration of Yuque knowledge base with Model-Context-Protocol for AI model context management.

    Yuque-MCP-Server provides an MCP-compatible server for interacting with the Yuque knowledge base platform. It enables AI models to retrieve, manage, and analyze Yuque documents and user information through a standardized Model-Context-Protocol interface. The server supports operations such as document creation, reading, updating, deletion, advanced search, and team statistics retrieval, making it ideal for AI-powered workflows. Inspired by Figma-Context-MCP, it facilitates contextual awareness and dynamic knowledge management for AI applications.

    • 31
    • MCP
    • HenryHaoson/Yuque-MCP-Server
  • PDF Tools MCP

    PDF Tools MCP

    Comprehensive PDF manipulation via MCP protocol.

    PDF Tools MCP provides an extensive suite of PDF manipulation operations using the Model Context Protocol framework. It supports both local and remote PDF tasks, such as rendering pages, merging, extracting metadata, retrieving text, and combining documents. The tool registers endpoints through the MCP protocol, enabling seamless server-based PDF processing for various clients. Built with Python, it emphasizes secure handling and compatibility with Claude Desktop via the Smithery ecosystem.

    • 31
    • MCP
    • danielkennedy1/pdf-tools-mcp
  • mcp-server-rabbitmq

    mcp-server-rabbitmq

    RabbitMQ Reference Implementation for the Model Context Protocol (MCP)

    Implements a server for the Model Context Protocol (MCP) using RabbitMQ as the messaging backend. Provides a standardized approach for handling model context, enabling scalable and efficient context management for AI applications. The project has been migrated to the official Amazon MQ repository.

    • 40
    • MCP
    • kenliao94/mcp-server-rabbitmq
  • OpenAI MCP Server

    OpenAI MCP Server

    Bridge between Claude and OpenAI models using the MCP protocol.

    OpenAI MCP Server enables direct querying of OpenAI language models from Claude via the Model Context Protocol (MCP). It provides a configurable Python server that exposes OpenAI APIs as MCP endpoints. The server is designed for seamless integration, requiring simple configuration updates and environment variable setup. Automated testing is supported to verify connectivity and response from the OpenAI API.

    • 77
    • MCP
    • pierrebrunelle/mcp-server-openai
  • piapi-mcp-server

    piapi-mcp-server

    TypeScript-based MCP server for PiAPI media content generation

    piapi-mcp-server is a TypeScript implementation of a Model Context Protocol (MCP) server that connects with PiAPI to enable media generation workflows from MCP-compatible applications. It handles image, video, music, TTS, 3D, and voice generation tasks using a wide range of supported models like Midjourney, Flux, Kling, LumaLabs, Udio, and more. Designed for easy integration with clients such as Claude Desktop, it includes an interactive MCP Inspector for development, testing, and debugging.

    • 62
    • MCP
    • apinetwork/piapi-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results