Skip to main content
Glama

screen-mcp

Omarchy / Hyprland Wayland デスクトップに AI エージェントのを与える MCP (Model Context Protocol) サーバーです。grim 経由でスクリーンショットを取得し、Gemini API によるオプションの画像分析を提供します。呼び出し元のモデルにネイティブのビジョンエンコーダーがない場合に便利です。

機能

ツール

機能

戻り値

list_windows

hyprctl 経由で Hyprland ウィンドウを列挙

アドレス、タイトル、ワークスペース、サイズを含むテキスト一覧

screenshot_region

ピクセル矩形 (x, y, width, height) をキャプチャ

インライン PNG 画像 (base64)

screenshot_window

タイトル、クラス、アドレス、または "focused" でウィンドウをキャプチャ

インライン PNG 画像 (base64)

screenshot_fullscreen

画面全体をキャプチャ

インライン PNG 画像 (base64)

analyze_image

画像 (base64 またはファイルパス) を Gemini に送信して推論

テキスト応答

screenshot_and_analyze

領域をキャプチャして 1 回の呼び出しで分析

テキスト (Gemini 応答)

スクリーンショットは grim (wlroots screencopy プロトコル) を使用します。X11 は不要です。

前提条件

  • Omarchy、Hyprland、または wlroots ベースの Wayland コンポジタ

  • grim — Wayland スクリーンショットツール

  • slurp — (オプション) 対話的な領域選択ヘルパー

  • hyprctl — Hyprland ウィンドウ/クエリ CLI

  • jq — (オプション) 一部のヘルパースクリプトで使用

確認方法:

grim --help && hyprctl clients -j | head -c 20

画像分析用 (オプション)

export GEMINI_API_KEY="your-api-key-here"

キーがない場合、スクリーンショットツールは引き続き動作します。analyze_imagescreenshot_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.tsgrim (スクリーンショット) と hyprctl (ウィンドウ列挙) をラップします。ウィンドウキャプチャはまず grim -T <stableId> (foreign-toplevel ハンドル) を試し、失敗した場合は grim -g "<x>,<y> <w>x<h>" (hyprctl からのジオメトリ) にフォールバックします。

  • 分析: src/gemini.ts は公式の @google/genai SDK を使用します。画像は base64 としてインラインで Gemini API の interactions.create エンドポイントに渡されます。

  • サーバー: src/index.ts@modelcontextprotocol/server を使用して、stdio トランスポートの MCP サーバーとしてすべてを配線します。

ライセンス

MIT

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all MCP Connectors

Latest Blog Posts

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