# Carbonara MCP

> Carbonara takes raw code snippets and turns them into polished PNG images ready for docs, blogs, or social media. It handles syntax highlighting, lets you pick custom themes like 'seti', adds macOS window controls, and even lets you spotlight specific lines of interest. Stop copy-pasting messy text; generate clean, professional visuals every time.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** code-screenshots, syntax-highlighting, carbonara, developer-productivity, image-generation

## Description

Writing technical documentation means dealing with code constantly. You need snippets that look good, not just blocks of text. This MCP connects your AI agent to a visual engine designed for exactly that. It lets you render any language—from Python to SQL—into beautiful, high-resolution images. You control the style: choose between sharp or rounded window aesthetics, add drop shadows, and even toggle line numbers on or off. Instead of manually styling code in an editor just to take a screenshot, your agent handles the heavy lifting. Whether you're writing tutorials or updating internal runbooks, this lets you generate consistent visuals with minimal effort. If you need one place to connect all your visual tools, Vinkius hosts and manages Carbonara right alongside hundreds of other specialized MCPs.

## Tools

### cook_code_image
This function generates a polished PNG image of a given code snippet with full styling control.

## Prompt Examples

**Prompt:** 
```
Cook a code image for this Python function using the 'seti' theme and include line numbers.
```

**Response:** 
```
I've generated the image for your Python function. It features the 'seti' theme with visible line numbers for better readability. [Image Attached]
```

**Prompt:** 
```
Create a high-resolution screenshot of this React component with a blue background and drop shadow.
```

**Response:** 
```
Processing your React component... I've rendered it with a custom blue background and a soft drop shadow for a professional look. [Image Attached]
```

**Prompt:** 
```
Generate a code snippet image for this SQL query, highlight lines 2 and 4, and add macOS window controls.
```

**Response:** 
```
The SQL query has been 'cooked'. I've highlighted the requested lines and added the window controls as specified. [Image Attached]
```

## Capabilities

### Generate code image
It takes a code snippet and outputs it as a base64 PNG image.

### Apply syntax highlighting
The tool automatically detects or accepts a specific language to color-code the code accurately.

### Style the container
You can choose custom themes, window styles (macOS look), and visual effects like drop shadows.

## Use Cases

### Writing an API reference guide
A technical writer needs to show five different Python functions in the documentation. Instead of manually capturing and editing each one, they ask their agent to `cook_code_image` for all five with a consistent theme and window style. They end up with five perfectly styled visuals ready for publishing.

### Sharing a complex React component
A developer needs to show their team how a new UI component works in a chat message. They prompt the agent, asking it to render the code using a blue background and drop shadow. The result is a visually rich image, not just plain text.

### Creating a teaching slide deck
An instructor needs clear visual aids for an SQL query tutorial. They ask their agent to generate the image using `cook_code_image`, specifically requesting that lines 2 and 4 be highlighted. The resulting image immediately draws attention to the key concepts.

## Benefits

- Consistency is guaranteed. You get the same look and feel—from window controls to syntax highlighting—every time you use `cook_code_image`.
- Stop dealing with messy screenshots. This MCP handles advanced formatting, letting you toggle line numbers or highlight specific lines of interest directly in the prompt.
- It supports multiple languages and themes (like 'seti'). You just tell your agent what language it is, and the tool does the rest.
- The resulting PNG image includes professional window styling (macOS-style controls), making documentation look polished and finished.
- You don't need to open a separate design program. Your AI client handles the entire rendering process through this MCP.

## How It Works

The bottom line is: your AI client handles all the styling parameters, executes the rendering through the MCP, and delivers the final polished image artifact.

1. Subscribe to this MCP and provide your Carbonara Base URL.
2. Tell your AI agent to 'cook' the code snippet, specifying any required themes or formatting (e.g., 'Use the seti theme and include line numbers').
3. Your agent invokes the tool and returns a base64 encoded PNG image you can use directly.

## Frequently Asked Questions

**Can I customize the syntax highlighting theme and font?**
Yes! You can use the `theme` parameter (e.g., 'seti') and `fontFamily` or `fontSize` to match your preferred style perfectly.

**Is it possible to highlight specific lines of code in the image?**
Absolutely. Use the `selectedLines` parameter to provide a comma-separated list of line numbers (e.g., '3,5,6') that you want to emphasize.

**Can I add window controls like the ones on macOS?**
Yes, by setting `windowControls` to true, the generated image will include the classic close, minimize, and maximize buttons.

**What languages can I use when calling cook_code_image?**
Yes, it supports a wide variety of popular programming languages. When you make your request to `cook_code_image`, simply specify the language in your prompt for accurate syntax highlighting.

**How does the cook_code_image tool deliver its output?**
The tool returns the result as a base64 encoded PNG string. Your AI client can then decode this data directly to display the image in your chat interface or application.

**What is the best way to set up Carbonara for cook_code_image?**
You must provide a valid, accessible Base URL for your Carbonara instance. You'll find instructions on setting up this endpoint in the Vinkius Marketplace configuration panel.

**Can I control custom background colors or shadows with cook_code_image?**
Yes. The tool allows you to pass parameters that define visual effects, such as customizing background colors and adding soft drop shadows for a polished look.

**Are there rate limits if I generate many images using cook_code_image?**
Since this is an external API service, you should check your hosting provider's documentation. If generating dozens of images, be sure to implement appropriate retry logic for rate limiting.