Content
# view-image-mcp
An MCP server that displays images inline in the terminal from Claude Code.
It uses the Kitty graphics protocol to display images directly on terminals that support it, such as Ghostty and Kitty.
## Supported Environment
- **OS:** macOS
- **Terminal:** Ghostty, Kitty (terminals that support the Kitty graphics protocol)
- **Runtime:** Node.js v18+
## Supported Formats
| Format | Support Method |
|---|---|
| PNG | Display as is |
| JPEG | Convert to PNG with `sips` and display |
| GIF | Convert to PNG with `sips` and display |
| WebP | Convert to PNG with `sips` and display |
## Installation
```bash
git clone <repository-url>
cd view-image-mcp
npm install
```
## Registration with Claude Code
```bash
claude mcp add view-image node /path/to/view-image-mcp/index.js
```
Or add directly to `~/.claude.json`:
```json
{
"mcpServers": {
"view-image": {
"command": "node",
"args": ["/path/to/view-image-mcp/index.js"]
}
}
}
```
## Usage
When you request to display an image file on Claude Code, the `view_image` tool is called and the image is displayed inline in the terminal.
```
> Display this image: /path/to/screenshot.png
```
### Tool: `view_image`
| Parameter | Type | Description |
|---|---|---|
| `path` | string | Path to the image file (absolute or relative) |
## Mechanism
```
Claude Code ←(stdio JSON-RPC)→ MCP Server
│
├─ Read image file
├─ Convert to PNG if necessary (sips)
├─ Base64 encode and chunk
└─ Write to /dev/tty with Kitty graphics protocol
│
▼
Display inline in terminal
```
The MCP server's `stdout` is used for JSON-RPC communication with Claude Code, so the image data is displayed in the terminal by writing directly to `/dev/tty`.
## License
MIT