PrintQueueApp MCP Server

PrintQueueApp MCP Server

Enables managing a print queue for office documents via a WinUI GUI, supporting file drag-and-drop, queue status, and printing through MCP tools.

Category
Visit Server

README

PrintQueueApp (プリントキューアプリ)

社用ドキュメント印刷キュー管理アプリ — WinUI MCP サーバー連携

License: MIT Python 3.11+ .NET 8

📋 概要

PrintQueueApp は、XLSX/XLS/PDF ファイルをドラッグ&ドロップでキューに追加し、WinUI 3 の GUI でステータスを管理しながら社内プリンターへ印刷するためのアプリケーションです。

  • クロスプラットフォーム: Python 部分は Windows/Mac/Linux で動作
  • WinUI 3 GUI: Windows ネイティブのモダンなインターフェース
  • MCP プロトコル: Model Context Protocol による柔軟なサーバー/クライアント分離
  • 多形式対応: Excel (XLSX/XLS) と PDF ファイルをサポート

🏗 アーキテクチャ

┌─────────────────────────────────────────────────────────┐
│  Python PrintQueueApp (クロスプラットフォーム)           │
│  ├── キュー管理                                         │
│  ├── ファイル処理 (openpyxl, xlrd, PyMuPDF)             │
│  └── 印刷実行 (Windows API / lp)                        │
│         │                                               │
│         │ MCP (HTTP または stdio)                       │
│         ▼                                               │
│  WinUI MCP サーバー (C# / WinUI 3)                      │
│  ├── MCP ツール → WinUI ウィジェット実装                │
│  └── GUI ウィンドウホスティング                         │
└─────────────────────────────────────────────────────────┘

✨ 主な機能

キュー管理

  • ファイルのドラッグ&ドロップ追加
  • キュー内のファイル一覧表示
  • 個別/全体の印刷操作
  • 印刷状況のリアルタイム表示

サポートファイル形式

形式 ライブラリ 備考
XLSX openpyxl Excel 2007+
XLS xlrd + xlwt Excel 97-2003 (レガシー)
PDF PyMuPDF そのまま印刷または画像化

印刷パイプライン

PENDING → PROCESSING → PRINTING → DONE / ERROR

🚀 クイックスタート

前提条件

  • Python 3.11+
  • .NET 8 SDK (WinUI GUI を使用する場合)
  • Windows 10/11 (WinUI GUI の場合、または Windows 印刷 API の場合)

インストール

# リポジトリのクローン
git clone https://github.com/nsh1l/print-queue-app.git
cd print-queue-app

# 仮想環境の作成とアクティベート
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# 依存関係のインストール
pip install -r requirements.txt

実行方法

GUI モード (推奨 - Windows)

# ランチャーを使用 (WinUI サーバー + Python クライアントを自動起動)
python run_app.py

# または直接
python -m src --gui

モック GUI モード (Mac/Linux/開発用)

# Windows 不要のモックサーバーを使用
python run_app.py --mock

CLI モード

# コマンドラインからファイルを指定
python run_app.py --cli report.xlsx invoice.pdf

環境変数

変数 説明 デフォルト
PRINT_QUEUE_MCP_URL MCP サーバー URL http://localhost:8765
DOTNET_PATH dotnet CLI のパス dotnet

🔧 MCP ツールインターフェース

WinUI サーバーは以下の MCP ツールを公開します:

ツール 説明
winui_create_window メインウィンドウ作成
winui_add_drop_zone ファイルドロップゾーン追加
winui_update_file_list キュー一覧更新
winui_add_button ツールバーボタン追加
winui_add_label テキストラベル追加
winui_set_status_text ステータスバー更新
winui_set_progress 進捗バー更新
winui_poll_events UI イベントポーリング

転送プロトコル

  • 開発/テスト: stdio (JSON-RPC over stdin/stdout)
  • 本番: HTTP POST http://localhost:8765/mcp

📁 プロジェクト構成

print-queue-app/
├── run_app.py              # アプリランチャー
├── winui_mcp_server.py     # WinUI MCP サーバー (Python)
├── winui_bridge.py         # WinUI ブリッジ (Windows ネイティブ)
├── requirements.txt        # Python 依存関係
├── src/
│   ├── __main__.py        # エントリーポイント
│   ├── main.py            # メインアプリケーション
│   ├── queue_item.py      # キューアイテム定義
│   ├── file_processor.py  # ファイル処理
│   ├── print_engine.py    # 印刷エンジン
│   ├── winui_client.py    # WinUI クライアント
│   └── mock_mcp_server.py # モック MCP サーバー
└── WinUIMCPServer/
    ├── Program.cs         # C# エントリーポイント
    ├── MCPServer.cs       # MCP サーバー実装
    ├── MainWindow.xaml.cs # メインウィンドウ
    └── PrintQueueApp.WinUI.csproj

🧪 開発

テスト

# サーバー単体テスト
python test_server.py

リモート接続

リモートサーバーへの接続設定は CONNECTION.md を参照してください。

# リモートサーバーに接続
python -m src --mock --url http://print.soichi.ro/ --token <token>

⚠️ 注意事項

  • WinUI GUI を使用する場合は Windows 環境が必要です
  • Mac/Linux では --mock または --cli モードを使用してください
  • 印刷機能は Windows プリンタードライバーに依存します
  • Unix/Linux では lp コマンドを使用した印刷が可能です

📄 ライセンス

MIT License

🤝 貢献

Issue や Pull Request を歓迎します!

📞 サポート

ご質問や問題がありましたら、GitHub Issues までお知らせください。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured