Skip to content

tyrm/receipt-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

receipt-mcp

receipt-mcp is a server application that exposes a tool for printing text to a receipt printer via the Model Context Protocol (MCP). It is designed to be used as an MCP server, allowing other systems (such as Claude or other MCP clients) to send print commands to a networked receipt printer.

Features

  • Receives print commands over MCP.
  • Prints word-wrapped text to a receipt printer (48 characters wide).
  • Automatically cuts the receipt after printing.
  • Supports printing text with QR codes.

Usage

Direct Installation

Configure your MCP client (such as Claude) to connect to the receipt-mcp server. Below is an example MCP configuration for Claude:

{
  "mcpServers": {
    "print": {
      "command": "/path/to/receipt-mcp",
      "env": {
        "PRINTER_ADDR": "10.0.0.1:9100"
      }
    }
  }
}
  • Replace /path/to/receipt-mcp with the path to the receipt-mcp executable.
  • Set PRINTER_ADDR to the address of your networked receipt printer.

Docker Installation

You can also run receipt-mcp using Docker. Here's an example configuration:

{
  "mcpServers": {
    "print": {
      "command": "docker",
      "args": ["run", "--rm", "receipt-mcp"],
      "env": {
        "PRINTER_ADDR": "10.0.0.1:9100"
      }
    }
  }
}

Once configured, you can use the following tools from your MCP client:

  • print: Print text to the receipt printer
  • print_with_header: Print text with a bolded header
  • print_with_qr: Print text with a QR code

Example usage of print_with_qr:

{
  "text": "Scan this QR code to visit our website",
  "qr": "https://example.com"
}

The QR code will be printed below the text, and the receipt will be automatically cut after printing.

About

Tool for printing text to a receipt printer via the Model Context Protocol (MCP)

Resources

License

Stars

Watchers

Forks

Packages

No packages published