screen-mcp
screen-mcp
Omarchy / Hyprland Wayland デスクトップに AI エージェントの目を与える MCP (Model Context Protocol) サーバーです。grim 経由でスクリーンショットを取得し、Gemini API によるオプションの画像分析を提供します。呼び出し元のモデルにネイティブのビジョンエンコーダーがない場合に便利です。
機能
ツール | 機能 | 戻り値 |
|
| アドレス、タイトル、ワークスペース、サイズを含むテキスト一覧 |
| ピクセル矩形 | インライン PNG 画像 (base64) |
| タイトル、クラス、アドレス、または | インライン PNG 画像 (base64) |
| 画面全体をキャプチャ | インライン PNG 画像 (base64) |
| 画像 (base64 またはファイルパス) を Gemini に送信して推論 | テキスト応答 |
| 領域をキャプチャして 1 回の呼び出しで分析 | テキスト (Gemini 応答) |
スクリーンショットは grim (wlroots screencopy プロトコル) を使用します。X11 は不要です。
前提条件
Omarchy、Hyprland、または wlroots ベースの Wayland コンポジタ
grim— Wayland スクリーンショットツールslurp— (オプション) 対話的な領域選択ヘルパーhyprctl— Hyprland ウィンドウ/クエリ CLIjq— (オプション) 一部のヘルパースクリプトで使用
確認方法:
grim --help && hyprctl clients -j | head -c 20画像分析用 (オプション)
Gemini API キー — https://aistudio.google.com で取得
環境変数にエクスポート:
export GEMINI_API_KEY="your-api-key-here"キーがない場合、スクリーンショットツールは引き続き動作します。analyze_image と screenshot_and_analyze のみエラーを返します。
インストール
Claude Desktop 経由
Claude Desktop の claude_desktop_config.json に次を追加:
{
"mcpServers": {
"screen-mcp": {
"command": "npx",
"args": ["-y", "screen-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}npx 経由
npx -y screen-mcp
# Or install globally:
npm install -g screen-mcp使用例
画面領域をキャプチャ
screenshot_region(x=100, y=200, width=800, height=600, include_cursor=true)特定のウィンドウをキャプチャ
まず利用可能なウィンドウを一覧表示してアドレスまたはタイトルを取得:
list_windows()次にタイトル (部分一致)、アドレス、または "focused" でキャプチャ:
screenshot_window(window="Spotify")
screenshot_window(window="focused")
screenshot_window(window="0x557ba79b4900")Gemini で画像を分析
analyze_image(
image_path="/tmp/my-screenshot.png",
prompt="What applications are visible in this screenshot?",
model="gemini-2.5-flash"
)または base64 エンコードされた画像データを直接渡す:
analyze_image(
image="<base64-encoded-image>",
prompt="Describe what you see in this image.",
mime_type="image/png"
)キャプチャと分析を 1 回で実行
screenshot_and_analyze(
x=0, y=0, width=1920, height=1080,
prompt="Count the number of windows open and list their titles.",
scale=0.5,
model="gemini-2.5-flash"
)開発
# Install deps
npm install
# Build
npm run build
# Run
npm start
# Development (recompile on change)
npm run dev仕組み
キャプチャ:
src/capture.tsはgrim(スクリーンショット) とhyprctl(ウィンドウ列挙) をラップします。ウィンドウキャプチャはまずgrim -T <stableId>(foreign-toplevel ハンドル) を試し、失敗した場合はgrim -g "<x>,<y> <w>x<h>"(hyprctl からのジオメトリ) にフォールバックします。分析:
src/gemini.tsは公式の@google/genaiSDK を使用します。画像は base64 としてインラインで Gemini API のinteractions.createエンドポイントに渡されます。サーバー:
src/index.tsは@modelcontextprotocol/serverを使用して、stdio トランスポートの MCP サーバーとしてすべてを配線します。
ライセンス
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate images, GIFs, and PDFs from HTML, URLs, or templates — from your AI agent.
Screenshots, PDFs and Markdown from any URL or HTML for AI agents, via the SnapForge API
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ferre-z/screen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server