Printer-AI-MCP

NullYing/Printer-AI-MCP

3.3

If you are the rightful owner of Printer-AI-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Printer AI MCP is a cross-platform server designed for managing printers, querying their status, and printing files across Windows, macOS, and Linux systems.

Tools
4
Resources
0
Prompts
0

Printer AI MCP

A cross-platform printer AI MCP server that supports Windows, macOS, and Linux systems, providing printer management, status queries, and file printing capabilities.

Features

  • ๐ŸŒ Cross-platform Support: Windows, macOS, Linux
  • ๐Ÿ–จ๏ธ Printer Management: Get printer list, status queries
  • ๐Ÿ“„ File Printing: Support multiple file format printing
  • ๐Ÿ”ง Printer Attributes: Get detailed printer configuration information
  • ๐Ÿ“Š Task Management: Print job status queries and cancellation
  • ๐Ÿš€ MCP Protocol: Built on FastMCP, supports AI assistant integration

System Requirements

  • Python 3.10+
  • Windows: Recommended Windows 10 or above
  • macOS/Linux: CUPS support

Installation

Using uv Installation

# Clone the project
git clone https://github.com/NullYing/printer-ai-mcp.git
cd printer-ai-mcp

# Install dependencies
uv sync

Usage

Start MCP Server

python main.py

Available MCP Tools

1. Get Printer List
get_printer_list() -> dict

Returns a list of all available printers in the system.

2. Get Printer Status
printer_status(index: int = None) -> dict

Gets the status information of the specified printer. If no index is specified, returns the default printer status.

3. Get Printer Attributes
printer_attrs(index: int = None) -> dict

Gets detailed configuration attributes of the printer (macOS/Linux only).

4. Print File
print_file(index: int = None, file_path: str = None, options: dict = None) -> dict

Prints files using the specified printer. Supports custom print options.

API Response Format

All APIs return responses in a unified format:

{
  "code": 200,
  "msg": "success",
  "data": {
    // Specific data content
  }
}

Configuration

MCP Configuration Example

Add to your MCP configuration file:

{
  "mcpServers": {
    "printerAIMcp": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {}
    }
  }
}

Development

Project Structure

printer-ai-mcp/
โ”œโ”€โ”€ main.py                 # MCP server main file
โ”œโ”€โ”€ local_printer/          # Local printer module
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cups.py            # macOS/Linux CUPS support
โ”‚   โ””โ”€โ”€ windows.py         # Windows printer support
โ”œโ”€โ”€ network_printer/       # Network printer module (to be developed)
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ pyproject.toml         # Project configuration
โ””โ”€โ”€ README.md              # Project documentation

Contributing

We welcome contributions from the community! Here are several ways you can help:

  • โญ Star this repository to show your support and help others discover this project
  • ๐Ÿ› Report bugs by opening an issue with detailed information about the problem
  • ๐Ÿ’ก Suggest new features or improvements through GitHub issues
  • ๐Ÿ”ง Submit pull requests to fix bugs or add new functionality
  • ๐Ÿ“– Improve documentation to help other users understand the project better
  • ๐Ÿงช Test on different platforms and report compatibility issues

Your contributions help make this project better for everyone. Thank you for your support!

License

MIT License

Related Links