capture_code
Create syntax-highlighted code screenshots with line numbers and theme-aware colors for documentation, tutorials, and sharing code snippets.
Instructions
Generate a syntax-highlighted code screenshot using Shiki (50+ languages, 27 themes). Renders code with line numbers, theme-aware colors, and optional window chrome. Ideal for code documentation, tutorials, and sharing snippets with authentic IDE-like appearance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Source code to render. Maximum 200KB. | |
| title | No | Window title shown in the title bar (e.g., 'src/main.ts', 'example.py') | code |
| output | No | Output filename (default: auto-generated as 'code-<timestamp>.png' or '.jpeg' based on SNAPMCP_FORMAT). Include extension to override format. | |
| endLine | No | Last line number to show in the gutter (1-indexed, inclusive). Must be >= startLine if both provided. | |
| language | No | Programming language for highlighting. Supports 50+ languages: typescript, javascript, python, rust, go, java, c, cpp, csharp, ruby, php, swift, kotlin, sql, json, yaml, markdown, html, css, bash, dockerfile, toml, xml, graphql, and many more. Use 'text' for plain text. | text |
| startLine | No | First line number to show in the gutter (1-indexed). Use with endLine to show a code range. |