mcp\_3d\_relief
中文 · Introduction to MCP · Wiki
This project provides a MCP server that converts 2D images into 3D relief models in STL format, suitable for 3D printing or rendering.
git clone https://github.com/bigchx/mcp_3d_relief.git cd mcp_3d_relief
uv pip sync requirements.txt
mcp run server.py mcp dev server.py
{ "mcpServers": { "mcp_3d_relief": { "command": "uv", "args": ["--directory", "{fill_in_your_path_here}", "run", "server.py"] } } }
image_path
: Local path or web URL to the input image filemodel_width
: Width of the 3D model in mm (default: 50.0)model_thickness
: Maximum thickness/height of the 3D model in mm (default: 5.0)base_thickness
: Thickness of the base in mm (default: 2.0)skip_depth
: Whether to use the image directly or generate a depth map (default: true)invert_depth
: Invert the relief (bright areas become low instead of high) (default: false)detail_level
: Controls the resolution of the processed image (default: 1.0). At detail_level = 1.0, the image is processed at 320px resolution, producing an STL file typically under 100MB. Higher values improve detail quality but significantly increase both processing time and STL file size. For example, doubling the detail_level can increase file size by 4x or more. Use with caution.The MCP Tool returns a JSON response with:
{ "status": "success", "depth_map_path": "path/to/yourimage_depth_map.png", "stl_path": "path/to/yourimage.stl" }
Where LLMs can access the generated files from this MCP server, using the provided URLs.
You can also use the script directly from the command line to generate a relief model from an image:
python3 relief.py path/to/your/image.jpg
For higher quality depth maps, you can use external depth map generation services like Depth-Anything-V2. This service can generate more accurate depth maps that you can then use with this project:
skip_depth=false
This approach can provide better 3D relief models, especially for complex images.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!