Ai Music Mcp
About
The World's First AI Music MCP Beyond images and video, your agent can now generate music.
Details
- Author
- amCharlie
- Downloads
- 286
- Categories
- Productivity, Other, Media
Jump to
- AI music generation from text prompts
- Dual modes: inspiration (auto lyrics) and custom (user-provided lyrics)
- Direct download URLs for generated songs
- Instrumental-only or full song with vocals
- Credit balance and API health checks
- Each generation produces 2 song variations
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Ai Music McpCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Obtain an API key from MusicMCP.AI, install uv, then configure the claude_desktop_config.json with the uvx aimusic-mcp command and required environment variables (MUSICMCP_API_KEY). After restarting Claude, four MCP tools become available for generating songs, checking credits, and monitoring API health.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"ai music mcp": {
"MusicMCP.AI": {
"command": "uvx",
"args": [
"aimusic-mcp"
],
"env": {
"MUSICMCP_API_KEY": "<your-api-key>",
"MUSICMCP_API_URL": "https://www.musicmcp.ai/api",
"TIME_OUT_SECONDS": "600"
}
}
}
}
}
McpServers
{
"MusicMCP.AI": {
"command": "uvx",
"args": [
"aimusic-mcp"
],
"env": {
"MUSICMCP_API_KEY": "<your-api-key>",
"MUSICMCP_API_URL": "https://www.musicmcp.ai/api",
"TIME_OUT_SECONDS": "600"
}
}
}
AI-Powered Music Generation with Model Context Protocol
Official MusicMCP.AI Model Context Protocol (MCP) server that enables seamless interaction with our advanced AI music generation platform. This server allows MCP clients like Claude Desktop, OpenAI Agents and others to generate AI music through natural language commands. ---β¨ Features
- πΌ AI Music Generation: Generate songs based on text prompts using MusicMCP.AI's state-of-the-art AI models - π΅ Dual Generation Modes: Support for both inspiration mode and custom mode - π Direct Download Links: Get direct download URLs for generated music - πΉ Instrumental Options: Generate instrumental-only music or full songs with vocals - β Credit Balance Check: Check your API key validity and remaining credits - π₯ Health Monitoring: Check API service health status ---π Quickstart with Claude Desktop
1. Get Your API Key
Obtain your API key from MusicMCP.AI Platform.2. Install uv
``bash
curl -LsSf https://astral.sh/uv/install.sh | sh
`
3. Configure Claude
Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json and add:
`json
{
"mcpServers": {
"MusicMCP.AI": {
"command": "uvx",
"args": [
"aimusic-mcp"
],
"env": {
"MUSICMCP_API_KEY": "<insert-your-api-key-here>",
"MUSICMCP_API_URL": "https://www.musicmcp.ai/api",
"TIME_OUT_SECONDS": "600"
}
}
}
}
`
4. Restart Claude
Restart the Claude app and you'll see 4 MCP tools available, indicating successful loading.
---
βοΈ Environment Variables
| Variable | Description | Default | Required |
|--------------------|------------------------------------------|-----------------------------|----------|
| MUSICMCP_API_KEY | Your MusicMCP.AI API key | β | β
Yes |
| MUSICMCP_API_URL | MusicMCP.AI API base URL | https://www.musicmcp.ai/api | β No |
| TIME_OUT_SECONDS | Timeout for music generation in seconds | 600 (10 min) | β No |
---
π οΈ Available Tools
1. πΌ Generate Prompt Song (Inspiration Mode)
Generate AI music based on simple text descriptions. AI automatically creates title, lyrics, and style.
- Cost: 5 credits per generation (creates 2 songs)
Parameters:
- prompt (str): Simple description of the music theme (1β1200 characters)
- instrumental (bool): Whether to generate instrumental music only
- style (str, optional): Music style (e.g., "ambient", "pop", "rock")
Example prompts:
- Help me generate a song about a peaceful morning
- Want a song that expresses longing
- Create music about friendship
Output example:
`text
β
Song 1 generated successfully!
π Title: Peaceful Morning
π ID: c7630638-b8ba-4984-876b-6dd7e6eeb796
π Download URL: https://cdn.musicmcp.ai/songs/abc123.mp3
πΌοΈ Cover Image: https://cdn.musicmcp.ai/images/abc123.jpg
β±οΈ Duration: 180s
π΅ Style Tags: ambient, meditation, peaceful
πΉ Instrumental: No
π
Created: 2025-01-15T10:30:45.123Z
π Lyrics:
[Verse]
Gentle sunlight fills the room
Morning dew and sweet perfume
Birds are singing their refrain
Another peaceful day again
You can download or play the audio from the URL above.
β
Song 2 generated successfully!
π Title: Morning Peace
π ID: d8741749-c9cb-5095-987c-7ee8f7ffb907
π Download URL: https://cdn.musicmcp.ai/songs/def456.mp3
πΌοΈ Cover Image: https://cdn.musicmcp.ai/images/def456.jpg
β±οΈ Duration: 213s
π΅ Style Tags: ambient, meditation, peaceful
πΉ Instrumental: No
π
Created: 2025-01-15T10:30:45.126Z
π Lyrics:
[Verse]
Calm and quiet, soft and still
Peaceful thoughts upon the hill
Nature's beauty all around
Gentle whispers, soothing sound
You can download or play the audio from the URL above.
`
---
2. π΅ Generate Custom Song (Custom Mode)
Generate AI music with specific lyrics, title, and style parameters that you provide.
- Cost: 5 credits per generation (creates 2 songs)
Parameters:
- title (str): Song title (required)
- instrumental (bool): Whether to generate instrumental music only (required)
- lyric (str, optional): Complete lyrics content (not required when instrumental is true)
- tags (str, optional): Music style tags (e.g., "pop", "rock", "folk")
Example usage:
`text
Please help me generate a song:
Title: Summer Dreams
Lyrics: [complete lyrics content]
Style: folk
`
Or for instrumental:
`text
Title: Summer Breeze
Instrumental: yes
Style: ambient
`
Output example:
`text
β
Custom song 'Summer Dreams' (version 1) generated successfully!
π Title: Summer Dreams
π ID: d1ed75a7-3e0b-42c6-b2be-7631204074fe
π Download URL: https://cdn.musicmcp.ai/songs/xyz789.mp3
πΌοΈ Cover Image: https://cdn.musicmcp.ai/images/xyz789.jpg
β±οΈ Duration: 195s
π΅ Style Tags: folk, acoustic, summer
πΉ Instrumental: No
π
Created: 2025-01-15T11:45:30.456Z
π Lyrics:
[Verse]
Walking through the summer fields
Golden wheat and nature's yields
Sunshine dancing on my face
Summer's warm and sweet embrace
You can download or play the audio from the URL above.
β
Custom song 'Summer Dreams' (version 2) generated successfully!
π Title: Summer Dreams
π ID: e2fe86b8-4f1c-53d7-c3cf-8742305185gf
π Download URL: https://cdn.musicmcp.ai/songs/uvw012.mp3
πΌοΈ Cover Image: https://cdn.musicmcp.ai/images/uvw012.jpg
β±οΈ Duration: 203s
π΅ Style Tags: folk, acoustic, summer
πΉ Instrumental: No
π
Created: 2025-01-15T11:45:30.459Z
π Lyrics:
[Verse]
Walking through the summer fields
Golden wheat and nature's yields
Sunshine dancing on my face
Summer's warm and sweet embrace
You can download or play the audio from the URL above.
`
---
3. β
Check Credit Balance
Check if your API key is valid and see your remaining credits.
- Cost: Free
Example usage:
- Check my credit balance
- How many credits do I have left?
---
4. π₯ Check API Health
Monitor the health status of the MusicMCP.AI API service.
- Cost: Free
Example usage:
- Check API service status
---
π° Credits & Pricing
| Operation | Credits Cost | Output |
|----------------------------|--------------|-----------|
| Generate Inspiration Music | 5 credits | 2 songs |
| Generate Custom Music | 5 credits | 2 songs |
| Query Music Status | 0 credits | β |
| Check Credit Balance | 0 credits | β |
| API Health Check | 0 credits | β |
---
π‘ Example Usage
> β οΈ Note: MusicMCP.AI credits are required to use the music generation tools.
Inspiration Mode
- Please help me generate a song about a peaceful morning
- Want a song that expresses longing
- Create music about friendship
- Generate an ambient music track
Custom Mode
- Please help me generate a song, Title: Summer Dreams, Lyrics: [complete lyrics], Style: folk
- Create a song, Title: Spring Promise, Lyrics: [complete lyrics], Pop style
- Generate an instrumental song, Title: Ocean Breeze, Style: ambient
Management Functions
- Check my credit balance
- How many credits do I have left?
- Check API service status
---
π¦ Installation
Using
uv (Recommended)
`bash
uvx aimusic-mcp
`
Using
pip
`bash
pip install aimusic-mcp
`
---
π API Integration
This MCP server integrates with MusicMCP.AI's RESTful API:
- POST /music/generate/inspiration: Create music generation task (inspiration mode)
- POST /music/generate/custom: Create custom music generation task
- POST /music/generate/query: Query music status (batch query supported)
- GET /credit: Check credit balance
- GET /health: Check API service health
---
π Async API Workflow
Music generation is asynchronous. The MCP server handles this automatically:
Step 1: Submit Generation Request
Call:
- POST /music/generate/inspiration
- or POST /music/generate/custom
Response example:
`json
{
"code": 200,
"data": {
"ids": ["id1", "id2"]
}
}
`
Step 2: Automatic Polling (handled internally by MCP)
MCP calls:
`http
POST /music/generate/query
Body: { "ids": ["id1", "id2"] }
`
- Polls every 2 seconds until status = 1 (completed)
- Song status:
- 0 = Failed
- 1 = Completed
- 2 = In Progress
Step 3: Return Complete Song Information
When all songs complete, the MCP server returns full details:
- songName, songUrl, imgUrl, duration, tags, etc.
Behind the scenes:
1. User calls generate_prompt_song() or generate_custom_song()
2. MCP sends generation request β receives 2 song IDs
3. MCP automatically polls /music/generate/query every 2 seconds
4. When all songs complete (status = 1), MCP returns download URLs and metadata
Defaults & behavior:
- β±οΈ Generation typically takes 2β5 minutes per song
- π MCP handles polling automatically
- π΅ Each generation always creates 2 song variations
- π° Credits (5) are deducted when generation request succeeds
- β οΈ If generation fails, credits are NOT consumed
---
π Troubleshooting
Common Issues
1. API Key Error
Ensure MUSICMCP_API_KEY is set correctly.
- Use the check_credit_balance tool to verify.
2. Insufficient Credits (402 Error)
You don't have enough credits.
- Check your balance at <https://www.musicmcp.ai>
- Recharge your account
3. Timeout Errors
Increase TIME_OUT_SECONDS if music generation takes longer.
---
Logs
When running with Claude Desktop, logs can be found at:
- Windows: %APPDATA%\Claude\logs\mcp-server-MusicMCP.AI.log
- macOS: ~/Library/Logs/Claude/mcp-server-MusicMCP.AI.log
---
π§ͺ Development
Running Tests
`bash
pytest tests/
`
Local Development
`bash
python -m musicmcp_ai_mcp.api
`
Code Structure
`text
musicmcp_ai_mcp/
βββ __init__.py # Package initialization
βββ __main__.py # CLI entry point
βββ api.py # Core MCP server implementation (430 lines)
`
---
π Links
- Platform: <https://www.musicmcp.ai>
- Documentation: <https://www.musicmcp.ai/docs>
- Support: <mailto:support@musicmcp.ai>
---
π License
This project is licensed under the MIT License β see the LICENSE` file for details.
---
Made with β€οΈ by the MusicMCP.AI Team
Transform your ideas into music with AI.Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





