Puter MCP Server
Provides AI-powered media generation tools including image, speech, video, OCR, and voice conversion via the Model Context Protocol.
README
Puter MCP Server
MCP (Model Context Protocol) server for Puter AI media generation. Provides 6 AI-powered tools for image generation, text-to-speech, video generation, OCR, speech-to-text, and voice conversion.
Features
- txt2img: Text-to-image generation with multiple providers (OpenAI, Gemini, Together, xAI, Replicate)
- txt2speech: Text-to-speech conversion with multiple voices and engines
- txt2vid: Text-to-video generation (Sora, Veo, TogetherAI)
- img2txt: Image-to-text (OCR) with AWS Textract or Mistral
- speech2txt: Speech-to-text transcription
- speech2speech: Voice conversion using ElevenLabs
Key Features
- Intelligent Default Models: Automatically selects the best model based on task type
- Text-to-image:
gpt-image-2(OpenAI) - Image-to-image:
gemini-2.5-flash-image-preview(Gemini)
- Text-to-image:
- Multiple Providers: Support for OpenAI, Google Gemini, xAI (Grok), Replicate, Together AI, ElevenLabs
- Flexible Output: Supports base64 and URL output formats
- Test Mode: Built-in test mode for development without consuming credits
Quick Start
Prerequisites
- Node.js 18+
- Puter API Key (get from puter.com)
Installation
# Clone the repository
git clone https://github.com/your-username/puter-mcp.git
cd puter-mcp
# Install dependencies
npm install
# Build the project
npm run build
Configuration
- Copy the environment file:
cp .env.example .env
- Edit
.envand add your Puter API key:
PUTER_API_KEY=your_puter_api_key_here
Usage
Claude Desktop / Trae
Add the following to your Claude Desktop or Trae configuration file:
Windows:
%APPDATA%\Trae\mcp_settings.json
macOS:
~/Library/Application Support/Trae/mcp_settings.json
Linux:
~/.config/Trae/mcp_settings.json
Configuration content:
{
"mcpServers": {
"puter-mcp": {
"command": "node",
"args": ["path/to/puter-mcp/dist/index.js"],
"env": {
"PUTER_API_KEY": "your_api_key"
}
}
}
}
Command Line
# Stdio mode (default)
npm start
# SSE mode
TRANSPORT=sse PORT=3000 npm start
Tools Reference
txt2img
Generate images from text prompts. Supports both text-to-image and image-to-image.
| Parameter | Type | Description |
|---|---|---|
prompt |
string | Text description for the image |
model |
string | Model to use (default: gpt-image-2 for text-to-image, gemini-2.5-flash-image-preview for image-to-image) |
provider |
string | AI provider (openai-image-generation, gemini, together, xai, replicate-image-generation) |
quality |
string | Image quality (high, medium, low, hd, standard) |
ratio |
object | Aspect ratio {w, h} |
input_image |
string | Input image for image-to-image (Base64 or URL) |
test_mode |
boolean | Test mode without credits |
output_format |
string | Output format (base64, url) |
Example:
Generate a picture of a cat
txt2speech
Convert text to speech.
| Parameter | Type | Description |
|---|---|---|
text |
string | Text to convert |
provider |
string | TTS provider (aws-polly, openai, elevenlabs, gemini, xai) |
model |
string | TTS model |
voice |
string | Voice ID |
engine |
string | Synthesis engine (standard, neural, long-form, generative) |
language |
string | Language code |
test_mode |
boolean | Test mode |
Example:
Convert "Hello world" to speech
txt2vid
Generate videos from text prompts.
| Parameter | Type | Description |
|---|---|---|
prompt |
string | Video description |
model |
string | Video model (sora-2, veo-3.1-generate-preview, etc.) |
seconds |
number | Video duration (4, 8, 12) |
size |
string | Resolution (e.g., 1280x720) |
test_mode |
boolean | Test mode |
Example:
Generate a video of a drone flying over mountains
img2txt
Extract text from images (OCR).
| Parameter | Type | Description |
|---|---|---|
source |
string | Image URL, Base64, or Puter path |
provider |
string | OCR provider (aws-textract, mistral) |
test_mode |
boolean | Test mode |
Example:
Extract text from this image: https://example.com/document.png
speech2txt
Convert speech to text.
| Parameter | Type | Description |
|---|---|---|
audio |
string | Audio URL, Base64, or Puter path |
provider |
string | STT provider (openai, xai) |
model |
string | Model name |
language |
string | Language code |
translate |
boolean | Translate to English |
test_mode |
boolean | Test mode |
Example:
Transcribe this audio: https://example.com/speech.mp3
speech2speech
Convert voice to another voice using ElevenLabs.
| Parameter | Type | Description |
|---|---|---|
audio |
string | Input audio URL, Base64, or Puter path |
voice |
string | Target ElevenLabs voice ID |
model |
string | Voice model (default: eleven_multilingual_sts_v2) |
output_format |
string | Output format |
test_mode |
boolean | Test mode |
Example:
Convert this voice to a different voice: https://example.com/speech.mp3
Development
Project Structure
puter-mcp/
├── src/
│ ├── index.ts # Server entry point
│ ├── client.ts # Puter SDK initialization
│ ├── utils.ts # Response formatting utilities
│ ├── puter.d.ts # TypeScript declarations
│ └── tools/
│ ├── index.ts # Tool registration
│ ├── txt2img.ts
│ ├── txt2speech.ts
│ ├── txt2vid.ts
│ ├── img2txt.ts
│ ├── speech2txt.ts
│ └── speech2speech.ts
├── scripts/
│ └── verify-responses.ts # SDK response verification
├── dist/ # Compiled output
├── package.json
└── tsconfig.json
Build
npm run build
Type Check
npm run typecheck
Development Mode
npm run dev
License
MIT License - see LICENSE for details.
Acknowledgments
Support
- Issue Tracker: https://github.com/your-username/puter-mcp/issues
- Documentation: https://docs.puter.com/AI/
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。