Stable Fast 3D MCP Server
Enables generating 3D models (GLB files) from 2D images using Stability AI's Stable Fast 3D API, with customizable parameters and credit balance checking.
README
Stable Fast 3D MCP Server
An MCP (Model Context Protocol) server that provides tools to generate 3D models from images using Stability AI's Stable Fast 3D API.
Features
- Generate 3D models from images: Convert any 2D image into a high-quality 3D GLB file
- Customizable parameters: Control texture resolution, mesh complexity, and more
- Base64 support: Generate from base64-encoded images for programmatic use
- Credit balance check: Monitor your Stability AI account balance
Prerequisites
- Python 3.10 or higher
- A Stability AI API key (get one at https://platform.stability.ai/account/keys)
Installation
- Clone or download this repository:
cd mcp-stable-fast-3d
- Install dependencies:
pip install -e .
- Set your Stability AI API key as an environment variable:
Windows (PowerShell):
$env:STABILITY_API_KEY = "sk-your-api-key-here"
Windows (Command Prompt):
set STABILITY_API_KEY=sk-your-api-key-here
Linux/macOS:
export STABILITY_API_KEY="sk-your-api-key-here"
Usage
Running the Server
python server.py
Or using the installed command:
mcp-stable-fast-3d
Configuring with Claude Desktop
Add this to your Claude Desktop configuration file (claude_desktop_config.json):
Using uvx from GitHub (recommended - no installation required):
{
"mcpServers": {
"stable-fast-3d": {
"command": "uvx",
"args": ["--from", "git+https://github.com/rikturnbull/mcp-stable-fast-3d", "mcp-stable-fast-3d"],
"env": {
"STABILITY_API_KEY": "sk-your-api-key-here"
}
}
}
}
Using local installation with Python:
Windows:
{
"mcpServers": {
"stable-fast-3d": {
"command": "python",
"args": ["C:\\path\\to\\mcp-stable-fast-3d\\server.py"],
"env": {
"STABILITY_API_KEY": "sk-your-api-key-here"
}
}
}
}
macOS/Linux:
{
"mcpServers": {
"stable-fast-3d": {
"command": "python",
"args": ["/path/to/mcp-stable-fast-3d/server.py"],
"env": {
"STABILITY_API_KEY": "sk-your-api-key-here"
}
}
}
}
Configuring with VS Code (GitHub Copilot)
Add to your VS Code settings.json or create .vscode/mcp.json in your project:
Using uvx from GitHub (recommended):
{
"servers": {
"stable-fast-3d": {
"command": "uvx",
"args": ["--from", "git+https://github.com/rikturnbull/mcp-stable-fast-3d", "mcp-stable-fast-3d"],
"env": {
"STABILITY_API_KEY": "sk-your-api-key-here"
}
}
}
}
Using local virtual environment:
{
"servers": {
"stable-fast-3d": {
"command": "c:\\path\\to\\mcp-stable-fast-3d\\.venv\\Scripts\\python.exe",
"args": ["c:\\path\\to\\mcp-stable-fast-3d\\server.py"],
"env": {
"STABILITY_API_KEY": "sk-your-api-key-here"
}
}
}
}
Available Tools
generate_3d_model
Generate a 3D model (GLB file) from a 2D image file.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image_path |
string | Yes | - | Path to input image (JPEG, PNG, or WebP) |
output_path |
string | No | Same as input with .glb extension | Path for output GLB file |
texture_resolution |
string | No | "1024" | Texture resolution: "512", "1024", or "2048" |
foreground_ratio |
float | No | 0.85 | Padding ratio (0.1 to 1.0) |
remesh |
string | No | "none" | Remeshing: "none", "quad", or "triangle" |
vertex_count |
int | No | -1 | Target vertex count (-1 for no limit) |
Example:
Generate a 3D model from the image at C:\images\cat-statue.png with high resolution textures
generate_3d_model_from_base64
Generate a 3D model from a base64-encoded image.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image_base64 |
string | Yes | - | Base64-encoded image data |
image_format |
string | Yes | - | Image format: "jpeg", "png", or "webp" |
output_path |
string | Yes | - | Path for output GLB file |
texture_resolution |
string | No | "1024" | Texture resolution |
foreground_ratio |
float | No | 0.85 | Padding ratio |
remesh |
string | No | "none" | Remeshing algorithm |
vertex_count |
int | No | -1 | Target vertex count |
check_api_balance
Check your Stability AI account credit balance.
API Costs
- Stable Fast 3D: 10 credits per successful generation
- Failed generations are not charged
Input Image Guidelines
For best results:
- Use images with a clear, well-lit subject
- The object should be centered in the frame
- Clean backgrounds work better
- Image dimensions should be between 64×64 and 2048×2048 pixels
- Total pixel count must be between 4,096 and 4,194,304 pixels
Output Format
The generated 3D model is saved as a GLB file (glTF Binary), which includes:
- 3D mesh geometry
- Albedo (color) texture map
- Normal texture map
GLB files can be viewed in:
- Windows 3D Viewer
- Blender
- Unity/Unreal Engine
- Most modern web browsers (with appropriate viewers)
Error Handling
The server handles common errors:
- Missing API key
- Invalid image formats
- API rate limiting (150 requests per 10 seconds)
- File not found errors
- Network timeouts
License
MIT License
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。