MCP server for MusicGPT AI audio API - music generation, voice conversion, audio processing
npm install mcp-server-musicgptA Model Context Protocol (MCP) server for the MusicGPT API, providing AI-powered audio generation and processing capabilities.
``bash`
npm install mcp-server-musicgpt
Or install from source:
`bash`
git clone https://github.com/pasie15/mcp-server-musicgpt.git
cd mcp-server-musicgpt
npm install
npm run build
1. Visit MusicGPT API Dashboard
2. Sign up for an account
3. Generate your API key
Set the following environment variable:
`bash`
export MUSICGPT_API_KEY="your_api_key_here"
Optional configuration:
`bash`
export MUSICGPT_BASE_URL="https://api.musicgpt.com/api/public/v1" # Default
export MUSICGPT_TIMEOUT="60000" # Timeout in milliseconds (default: 60000)
Add to your claude_desktop_config.json:
`json`
{
"mcpServers": {
"musicgpt": {
"command": "npx",
"args": ["-y", "mcp-server-musicgpt"],
"env": {
"MUSICGPT_API_KEY": "your_api_key_here"
}
}
}
}
Alternative: Install from source
#### MacOS/Linux
`json`
{
"mcpServers": {
"musicgpt": {
"command": "node",
"args": ["/path/to/mcp-server-musicgpt/dist/index.js"],
"env": {
"MUSICGPT_API_KEY": "your_api_key_here"
}
}
}
}
#### Windows
`json`
{
"mcpServers": {
"musicgpt": {
"command": "node",
"args": ["C:\\path\\to\\mcp-server-musicgpt\\dist\\index.js"],
"env": {
"MUSICGPT_API_KEY": "your_api_key_here"
}
}
}
}
Add to your MCP settings:
`json`
{
"musicgpt": {
"command": "npx",
"args": ["-y", "mcp-server-musicgpt"],
"env": {
"MUSICGPT_API_KEY": "your_api_key_here"
}
}
}
#### get_conversion_by_id
Get the status and results of a conversion task.
`typescript`
{
"conversionType": "MUSIC_AI",
"task_id": "uuid-here" // or use conversion_id
}
#### get_all_voices
List all available voices with pagination.
`typescript`
{
"limit": 20, // optional, default: 20
"page": 0 // optional, default: 0
}
#### search_voices
Search for voices by name.
`typescript`
{
"voice_name": "Taylor Swift"
}
#### generate_music
Generate custom music from a text prompt.
`typescript`
{
"prompt": "An upbeat electronic dance track with energetic synths",
"music_style": "EDM", // optional
"lyrics": "Verse 1: ...", // optional
"make_instrumental": false, // optional
"vocal_only": false, // optional
"voice_id": "voice-uuid", // optional
"webhook_url": "https://example.com/webhook" // optional
}
#### create_cover_song
Create a cover version with a different voice.
`typescript`
{
"audio_url": "https://example.com/song.mp3",
"voice_id": "voice-uuid",
"webhook_url": "https://example.com/webhook" // optional
}
#### generate_sound_effect
Generate sound effects from text descriptions.
`typescript`
{
"prompt": "Thunder and rain in a forest",
"duration": 5 // optional, in seconds
}
#### generate_lyrics
Generate song lyrics from a theme or prompt.
`typescript`
{
"prompt": "A song about summer adventures",
"genre": "Pop" // optional
}
#### voice_changer
Convert audio to a different voice.
`typescript`
{
"audio_url": "https://example.com/audio.mp3",
"voice_id": "voice-uuid"
}
#### text_to_speech
Convert text to speech.
`typescript`
{
"text": "Hello, this is a text-to-speech conversion",
"voice_id": "voice-uuid"
}
#### extract_audio
Extract vocals, instruments, or stems.
`typescript`
{
"audio_url": "https://example.com/song.mp3",
"extraction_type": "vocals" // vocals, instrumental, drums, bass, piano, other
}
#### denoise_audio
Remove background noise from audio.
`typescript`
{
"audio_url": "https://example.com/noisy-audio.mp3"
}
#### deecho_audio
Remove echo from audio.
`typescript`
{
"audio_url": "https://example.com/audio-with-echo.mp3"
}
#### dereverb_audio
Remove reverb from audio.
`typescript`
{
"audio_url": "https://example.com/audio-with-reverb.mp3"
}
#### convert_audio_format
Convert audio to different formats.
`typescript`
{
"audio_url": "https://example.com/audio.wav",
"output_format": "mp3" // mp3, wav, flac, ogg, m4a
}
#### cut_audio
Trim audio to specific time range.
`typescript`
{
"audio_url": "https://example.com/audio.mp3",
"start_time": 10, // seconds
"end_time": 60 // seconds
}
#### change_audio_speed
Change playback speed.
`typescript`
{
"audio_url": "https://example.com/audio.mp3",
"speed_factor": 1.5 // 1.5x speed
}
#### master_audio
Apply professional audio mastering.
`typescript`
{
"audio_url": "https://example.com/unmastered.mp3"
}
#### remix_audio
Create a remix of audio.
`typescript`
{
"audio_url": "https://example.com/song.mp3",
"remix_style": "House" // optional
}
#### extend_audio
Extend audio using AI continuation.
`typescript`
{
"audio_url": "https://example.com/song.mp3",
"extension_duration": 30 // seconds, optional
}
#### inpaint_audio
Fill gaps or corrupted sections in audio.
`typescript`
{
"audio_url": "https://example.com/audio-with-gap.mp3",
"start_time": 10, // gap start in seconds
"end_time": 15 // gap end in seconds
}
#### sing_over_instrumental
Add AI vocals to an instrumental track.
`typescript`
{
"instrumental_url": "https://example.com/instrumental.mp3",
"lyrics": "Verse 1: ...",
"voice_id": "voice-uuid"
}
#### transcribe_audio
Transcribe speech to text.
`typescript`
{
"audio_url": "https://example.com/speech.mp3",
"language": "en" // optional, e.g., en, es, fr
}
#### extract_key_bpm
Extract musical key and BPM.
`typescript`
{
"audio_url": "https://example.com/song.mp3"
}
#### audio_to_midi
Convert audio to MIDI format.
`typescript`
{
"audio_url": "https://example.com/melody.mp3"
}
Most audio processing operations are asynchronous. Here's a typical workflow:
1. Start a conversion (e.g., generate_music)task_id
- Returns: and conversion_id
2. Check status using get_conversion_by_idtask_id
- Pass the or conversion_idPENDING
- Status values: , PROCESSING, COMPLETED, FAILED
3. Get results when status is COMPLETEDaudio_url
- The response includes with the processed audio
Example:
`typescript
// Step 1: Generate music
{
"tool": "generate_music",
"arguments": {
"prompt": "A relaxing piano melody"
}
}
// Returns: { task_id: "abc-123", conversion_id: "def-456", eta: 120 }
// Step 2: Check status (wait for ETA or use webhook)
{
"tool": "get_conversion_by_id",
"arguments": {
"conversionType": "MUSIC_AI",
"task_id": "abc-123"
}
}
// Returns: { status: "COMPLETED", audio_url: "https://..." }
`
Most conversion tools support webhooks for async notifications. Set the webhook_url parameter to receive a callback when processing completes:
`typescript`
{
"prompt": "Epic orchestral music",
"webhook_url": "https://your-server.com/musicgpt-webhook"
}
The webhook will receive a POST request with the conversion results.
For detailed API documentation, visit:
- MusicGPT API Documentation
- API Dashboard
When using get_conversion_by_id, use these conversion types:
- MUSIC_AI - Music generationTEXT_TO_SPEECH
- - Text to speechVOICE_CONVERSION
- - Voice changerEXTRACTION
- - Audio extractionCOVER
- - Cover songsSTEMS_SEPARATION
- - Stems separationVOCAL_EXTRACTION
- - Vocal extractionDENOISING
- - DenoiseDEECHO
- - DeechoDEREVERB
- - DereverbSOUND_GENERATOR
- - Sound effectsAUDIO_TRANSCRIPTION
- - TranscriptionAUDIO_SPEED_CHANGER
- - Speed changerAUDIO_MASTERING
- - MasteringAUDIO_CUTTER
- - Audio cutterREMIX
- - RemixFILE_CONVERT
- - Format conversionKEY_BPM_EXTRACTION
- - Key & BPM extractionAUDIO_TO_MIDI
- - Audio to MIDIEXTEND
- - Audio extensionINPAINT
- - Audio inpaintingSING_OVER_INSTRUMENTAL
- - Sing over instrumentalLYRICS_GENERATOR
- - Lyrics generation
MusicGPT API has rate limits based on your subscription tier. Check your API dashboard for your limits.
is correct
- Check your API key is active in the dashboard
- Ensure you have sufficient credits$3
- Wait before making more requests
- Check your API usage in the dashboard
- Upgrade your plan if needed$3
- Increase MUSICGPT_TIMEOUT for large audio files
- Default is 60 seconds, increase if needed$3
- Ensure the server is running
- Rebuild the project: npm run build
- Check your MCP client configurationDevelopment
Build the server:
`bash
npm run build
`Development mode (watch for changes):
`bash
npm run dev
``Most operations consume API credits. Check the pricing page for details.
MIT
For issues with this MCP server:
- Create an issue
For MusicGPT API issues:
- MusicGPT Support
- API Documentation
- MusicGPT Website
- API Documentation
- API Dashboard
- Model Context Protocol