text-image-mcp

text-image-mcp

Enables AI agents to generate stylized images from text and code, with syntax highlighting and markdown formatting support.

Category
Visit Server

README

Text-Image MCP Server

A lightweight Model Context Protocol (MCP) server built with Python to allow agentic AI applications to quickly generate stylized imagery from text and code.

Features

  • Pygments Code Highlighting: Automatically formats programming languages (JSON, Python, HTML, bash, etc.) using intelligent token mapping and syntax-coloring right out of the box.
  • Agent-Driven Markdown (English Processor): Native lightweight parser detects unstructured text and allows agents to explicitly define importance by parsing **bold** strings and `inline code blocks` independently.
  • Embedded Typography: Includes bundled instances of Fira Sans and Fira Mono to produce stunning desktop-grade visual representation.

Usage

This project wraps into the default MCP communication streams gracefully. Agents interacting with the API via the generate_text_image tool can inject the following parameters:

{
  "text": "Your markdown or code here",
  "language": "markdown", 
  "bg_color": [20, 24, 30],
  "text_color": [220, 230, 240],
  "font_size": 24
}

Note: If language is omitted, the server will intelligently attempt to guess the incoming programming language.

Installation

# Clone the project and instantiate a virtual environment
python -m venv venv

# Windows
.\venv\Scripts\activate

# Linux/macOS
source venv/bin/activate

# Install the dependencies
pip install mcp Pillow Pygments

Running the Server

If you are using Claude Desktop, Cline, or Antigravity, you simply register the server utilizing the following configurations within your host's MCP environment:

{
  "mcpServers": {
    "text-image": {
      "command": "C:/path/to/project/venv/Scripts/python.exe", // Use /path/to/project/venv/bin/python on Linux/macOS
      "args": ["-m", "text_image_mcp"],
      "env": {
         "PYTHONPATH": "C:/path/to/project/src" // Use /path/to/project/src on Linux/macOS
      }
    }
  }
}

GitHub Copilot

For GitHub Copilot within VS Code, you can add the server by navigating to the command palette and typing MCP: Open User Configuration. This will open your user mcp.json file. Provide the identical configuration block shown above (ensuring you adjust paths for your specific OS). Alternatively, you can drop .vscode/mcp.json inside your project root directory.

Testing Protocol

100% of the image rendering boundary mapping logic is covered seamlessly through pytest suites mirroring actual Agentic constraints. Run tests using:

python -m pytest tests/

License

MIT License. See LICENSE for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured