A cross-platform printer AI MCP server that supports Windows, macOS, and Linux systems, providing printer management, status queries, and file printing capabilities.
- 🌍 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
- Python 3.10+
- Windows: Recommended Windows 10 or above
- macOS/Linux: CUPS support
# Clone the project
git clone https://github.com/NullYing/printer-ai-mcp.git
cd printer-ai-mcp
# Install dependencies
uv syncpython main.pyget_printer_list() -> dictReturns a list of all available printers in the system.
printer_status(index: int = None) -> dictGets the status information of the specified printer. If no index is specified, returns the default printer status.
printer_attrs(index: int = None) -> dictGets detailed configuration attributes of the printer (macOS/Linux only).
print_file(index: int = None, file_path: str = None, options: dict = None) -> dictPrints files using the specified printer. Supports custom print options.
All APIs return responses in a unified format:
{
"code": 200,
"msg": "success",
"data": {
// Specific data content
}
}Add to your MCP configuration file:
{
"mcpServers": {
"printerAIMcp": {
"url": "http://127.0.0.1:8000/mcp",
"headers": {}
}
}
}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
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!
MIT License