Skip to main content
Glama

vision-mcp

An MCP server that helps non-vision models extract and understand images and screenshots via OpenRouter multimodal models.

Features

  • analyze_image — Send an image (local file or URL) with a text prompt to any OpenRouter vision model and get a natural-language response.

  • screen — Capture a screenshot of an application window by PID or process name (Windows only, uses PrintWindow via PowerShell).

Related MCP server: Vision MCP Server

Prerequisites

Setup

# Clone and install
git clone <your-repo>
cd vision-mcp
npm install

# Configure environment
cp .env.example .env

Edit .env and set your OpenRouter key and preferred model:

OPENROUTER_API_KEY=sk-or-v1-...
OPENROUTER_MODEL=google/gemini-2.0-flash-lite-preview-02-05:free

Environment variables

Variable

Required

Default

Description

OPENROUTER_API_KEY

Yes

Your OpenRouter API key

OPENROUTER_MODEL

Yes

Model identifier (e.g. google/gemma-4-31b-it:free)

OPENROUTER_BASE_URL

No

https://openrouter.ai/api/v1

API base URL override

MAX_IMAGE_MB

No

20

Maximum allowed image size in MB

Build & Run

npm run build
npm start

The server uses stdio transport and is designed to be launched by an MCP-enabled host (e.g. Claude, OpenCode). Example configuration block for your MCP client:

{
  "mcpServers": {
    "vision-mcp": {
      "command": "npx",
      "args": ["-y", "@forloopcodes/visionmcp"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-...",
        "OPENROUTER_MODEL": "google/gemma-4-31b-it:free"
      }
    }
  }
}

Tools

analyze_image

Analyze an image using a vision model.

Arguments:

Name

Type

Required

Description

prompt

string

Yes

Instruction for the vision model

image

string

Yes

Local file path or http/https URL

Local images are loaded, validated (size, path scope), and sent as base64 data URIs. Remote URLs are passed through directly.

screen

Capture a screenshot of a running application window (Windows only).

Arguments:

Name

Type

Required

Description

action

"capture"

Yes

The capture action

target

string

No

Process name to find and capture (e.g. wezterm, notepad)

pid

number

No

Process ID to capture

Provide either target or pid. The server uses PrintWindow via a compiled C# snippet invoked through PowerShell. Supports PW_RENDERFULLCONTENT for DPI-aware captures.

NOTE

Screen capture requires theSystem.Drawing assembly and works on Windows only. The captured PNG is written to the system temp directory.

Architecture

src/
├── server.ts          # MCP server entry point, tool routing
├── image.ts           # Image loading, validation, base64 encoding
├── openrouter.ts      # OpenRouter API client (multimodal chat completions)
├── types.ts           # Shared TypeScript interfaces for API payloads
└── screen/
    ├── index.ts       # Platform abstraction for screen capture
    └── windows.ts     # PowerShell + Win32 implementation (PrintWindow)

The server runs on the Model Context Protocol SDK with stdio transport. Image analysis requests are forwarded to OpenRouter's /chat/completions endpoint with a 60-second timeout. Security boundaries are enforced at the image loader — only files within the working directory are accepted.

Security

  • Local image paths are checked against the project root to prevent directory traversal.

  • Screen captures are written to the OS temp directory ($TMPDIR).

  • The PowerShell execution uses -ExecutionPolicy Bypass for the embedded C# script; no external .ps1 files are written to disk.

License

MIT

Available Tools

2 tools
analyze_imageB

Send an image (URL or local path) with a prompt to a vision model via OpenRouter

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesInstruction for the vision model
imageYesLocal file path or http/https URL

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'via OpenRouter,' hinting at an external API call, but it does not disclose potential side effects (e.g., network dependency, costs, latency) or any required permissions. This lack of behavioral detail is a significant gap for a tool that sends data externally.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently conveys the tool's purpose. It is concise and front-loaded with the action. While it could be slightly more structured, it has no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 params, no output schema, no annotations), the description is adequate but not fully complete. It does not describe the return value or error behavior, which would be useful for an agent. However, for a straightforward tool, it meets minimum viability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds no new meaning beyond the schema for the two parameters: it merely restates that image can be a URL or local path and that prompt is an instruction. It does not explain format constraints or other nuances.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (send), the resource (image with prompt), and the target (vision model via OpenRouter). It uses specific verbs and nouns, distinguishing it from the sibling 'screen' tool, which likely performs a different function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when one needs to analyze an image with a prompt, but it provides no explicit guidance on when to use this tool versus alternatives, nor does it mention when not to use it. The sibling 'screen' is mentioned but not contrasted.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

screenA

Capture a screenshot of an application window by PID or process name (e.g. wezterm)

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYesCapture action (only capture for now)
targetNoProcess name (e.g. wezterm, notepad)
pidNoProcess ID to capture

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden. It states that a screenshot is captured, but does not disclose any side effects, permissions required, or behavior beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with an example, no redundant information. Every word serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the tool is simple, the description lacks information about what is returned (e.g., image data or path). The enum for action is limited but not explained. For a complete agent, return type would be useful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes each parameter (action, target, pid) with 100% coverage. The description adds value by explaining that target and pid are alternative ways to specify the window, and provides an example.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the purpose: capture a screenshot of an application window using PID or process name. It distinguishes from the sibling tool 'analyze_image', which implies analysis rather than capture.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides two methods (PID or process name) and gives an example (wezterm). However, it does not specify when to use this tool over alternatives or any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv1.0.0
    • First observedanalyze_image
    • First observedscreen

TDQS

A3.5/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: analyze_image sends an image to a vision model, while screen captures a screenshot. No overlap in functionality.

Naming Consistency4/5

Both tool names follow a simple pattern, but 'screen' is a single noun used as a verb, while 'analyze_image' is verb_noun. The inconsistency is minor given only two tools.

Tool Count2/5

For a vision-related server, two tools are very minimal. Typical vision servers have at least 5-10 tools for different operations (list models, describe, compare, etc.).

Completeness2/5

The server lacks essential operations like listing available models, configuring parameters, or handling multiple image inputs. The surface is too narrow for a comprehensive vision tool.

Maintenance

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

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/forloopcodes/vision-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server