capture_file
Convert any code file into a syntax-highlighted screenshot with automatic language detection. Specify file path and optional line range to capture a specific section.
Instructions
Read a file and generate a syntax-highlighted screenshot with automatic language detection from file extension. Supports 50+ languages via Shiki. Requires SNAPMCP_ALLOWED_PATHS to be set for security (deny-all by default). Maximum file size 5MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | No | Output filename (default: auto-generated as 'file-<timestamp>.png' or '.jpeg' based on SNAPMCP_FORMAT). Include extension to override format. | |
| endLine | No | Last line number to capture (1-indexed, inclusive). Must be >= startLine if both provided. Defaults to end of file. | |
| filePath | Yes | Absolute path to the file to capture. Must be within SNAPMCP_ALLOWED_PATHS allowlist. Symlinks are resolved to prevent traversal. | |
| startLine | No | First line number to capture (1-indexed, inclusive). Use with endLine to capture a specific range. |