Let Agents call the code image tools
Codia provides a stateless Streamable HTTP MCP server. After OAuth login, an Agent can call the render tools directly without manually composing API requests.
1. Add the MCP server
Add Codia's /mcp URL in an MCP-capable Agent. With Codex CLI, start the configuration with these commands:
{
"mcpServers": {
"codia": {
"url": "https://codia.i5lin.top/mcp"
}
}
}codex mcp add codia --url https://your-domain.com/mcp
codex mcp login codia2. Sign in with OAuth
After the login command, your browser opens Codia's consent page. Sign in with Google, choose an existing API credential, or generate a new one. The MCP Client stores the credential and sends it automatically on later requests.
Legacy Bearer configuration
Clients without MCP OAuth can provide an Authorization header directly in their configuration. Treat the credential like a password and never commit it to a public repository.
{
"mcpServers": {
"codia": {
"url": "https://your-domain.com/mcp",
"headers": {
"Authorization": "Bearer ${CODIA_API_KEY}"
}
}
}
}Available tools
render_code_image: the compact tool for common cases. It supports code, language, preset, output, and save. Presets are github, twitter, docs, blog, glass, macos, and minimal.
render_code_image_advanced: exposes the complete renderer input, including theme, bgColor, borderSize, containerWidth, minLines, endSpaceLines, showLineNumbers, and quality.
Image responses
By default, both render tools return an MCP image content block and a JSON summary. Image content is only sent in the response; Codia does not save it to the database or disk.
The save field
save defaults to true. Set save: false when the response should contain only the JSON summary without image content. Whether to display or save the image locally is decided by the MCP Client and Agent.
Read the API usage docs ↗