qr-mcp-standalone
v1.0.0
Published
Self-contained Model Context Protocol (MCP) service for QR code generation
Maintainers
Readme
QR Service
A Model Context Protocol (MCP) service implementation that can be used by AI models to generate QR codes.
Features
- QR code generation tool for AI models
- MCP protocol compliant server
- RESTful API endpoint
- Easy deployment
Getting Started
Prerequisites
- Node.js (version 14 or higher)
- npm
Installation
npm installRunning Locally
npm startThe service will be available at http://localhost:7997
Development Mode
npm run devRunning with npx (if installed globally or linked locally)
npx qr-serviceOr if linked locally:
qr-serviceMCP Endpoint
POST /mcp- Main MCP endpoint for AI model communication
API Endpoints
GET /- Service informationGET /health- Health check endpoint
MCP Tools
generate_qr_code
Generates a QR code for a given URL.
Parameters:
url(string, required): The URL to encode in the QR codesize(integer, optional): Size of the QR code image (default: 200)
Example usage:
{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/call",
"params": {
"name": "generate_qr_code",
"arguments": {
"url": "https://www.baidu.com",
"size": 300
}
}
}Deployment
To deploy this service publicly:
- Choose a hosting platform (cloud server, Heroku, etc.)
- Install Node.js on the server
- Copy the project files to the server
- Run
npm installto install dependencies - Configure firewall to allow traffic on port 7997 (or your chosen port)
- Start the service with
npm start - (Optional) Set up a reverse proxy like Nginx for production use
- (Optional) Configure a domain name pointing to your server
