WaveSpeed MCP Server
Project description
WavespeedMCP
English | 中文文档
WavespeedMCP is a Model Control Protocol (MCP) server implementation for WaveSpeed AI services. It provides a standardized interface for accessing WaveSpeed's image and video generation capabilities through the MCP protocol.
Features
- Advanced Image Generation: Create high-quality images from text prompts with support for image-to-image generation, inpainting, and LoRA models
- Dynamic Video Generation: Transform static images into videos with customizable motion parameters
- Optimized Performance: Enhanced API polling with intelligent retry logic and detailed progress tracking
- Flexible Resource Handling: Support for URL, Base64, and local file output modes
- Comprehensive Error Handling: Specialized exception hierarchy for precise error identification and recovery
- Robust Logging: Detailed logging system for monitoring and debugging
- Multiple Configuration Options: Support for environment variables, command-line arguments, and configuration files
Installation
Prerequisites
- Python 3.11+
- WaveSpeed API key (obtain from WaveSpeed AI)
Setup
Install directly from PyPI:
pip install wavespeed-mcp
MCP Configuration
To use WavespeedMCP with your IDE or application, add the following configuration:
{
"mcpServers": {
"Wavespeed": {
"command": "wavespeed-mcp",
"env": {
"WAVESPEED_API_KEY": "wavespeedkey"
}
}
}
}
Usage
Running the Server
Start the WavespeedMCP server:
wavespeed-mcp --api-key your_api_key_here
Claude Desktop Integration
WavespeedMCP can be integrated with Claude Desktop. To generate the necessary configuration file:
python -m wavespeed_mcp --api-key your_api_key_here --config-path /path/to/claude/config
This command generates a claude_desktop_config.json file that configures Claude Desktop to use WavespeedMCP tools. After generating the configuration:
- Start the WavespeedMCP server using the
wavespeed-mcpcommand - Launch Claude Desktop, which will use the configured WavespeedMCP tools
Configuration Options
WavespeedMCP can be configured through:
-
Environment Variables:
WAVESPEED_API_KEY: Your WaveSpeed API key (required)WAVESPEED_API_HOST: API host URL (default: https://api.wavespeed.ai)WAVESPEED_MCP_BASE_PATH: Base path for output files (default: ~/Desktop)WAVESPEED_API_RESOURCE_MODE: Resource output mode (options: url, base64, local; default: url)WAVESPEED_LOG_LEVEL: Logging level (options: DEBUG, INFO, WARNING, ERROR; default: INFO)WAVESPEED_API_TEXT_TO_IMAGE_ENDPOINT: Custom endpoint for text-to-image generation (default: /wavespeed-ai/flux-dev)WAVESPEED_API_IMAGE_TO_IMAGE_ENDPOINT: Custom endpoint for image-to-image generation (default: /wavespeed-ai/flux-kontext-pro)WAVESPEED_API_VIDEO_ENDPOINT: Custom endpoint for video generation (default: /wavespeed-ai/wan-2.1/i2v-480p-lora)
-
Command-line Arguments:
--api-key: Your WaveSpeed API key--api-host: API host URL--config: Path to configuration file
-
Configuration File (JSON format): See
wavespeed_mcp_config_demo.jsonfor an example.
Architecture
WavespeedMCP follows a clean, modular architecture:
server.py: Core MCP server implementation with tool definitionsclient.py: Optimized API client with intelligent pollingutils.py: Comprehensive utility functions for resource handlingexceptions.py: Specialized exception hierarchy for error handlingconst.py: Constants and default configuration values
Development
Requirements
- Python 3.11+
- Development dependencies:
pip install -e ".[dev]"
Testing
Run the test suite:
pytest
Or with coverage reporting:
pytest --cov=wavespeed_mcp
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support or feature requests, please contact the WaveSpeed AI team at support@wavespeed.ai.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wavespeed_mcp-0.1.21.tar.gz.
File metadata
- Download URL: wavespeed_mcp-0.1.21.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd5cc75e4d648ac89790eb3db385f4e8efa09608c16cb0178119410d1eab5062
|
|
| MD5 |
1c97b05babdfa8689772e4640f2db272
|
|
| BLAKE2b-256 |
c22e943e5ec5bbfe987d44bbdd698aa06be1b688c7fe45295bfbe96df874f193
|
File details
Details for the file wavespeed_mcp-0.1.21-py3-none-any.whl.
File metadata
- Download URL: wavespeed_mcp-0.1.21-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1096a41b2df50c0a5942c681d714ab143b63ece3b8b85ca4b997dd3aa3e0e795
|
|
| MD5 |
8acf074bf07db1a44307cc613257afca
|
|
| BLAKE2b-256 |
34b70296ce50c4ec6dd4d8e47282f271a62691d8afa08cf9dbf90bb1c575b508
|