Sonauto Music Generation MCP Server
March 16, 2025 ยท View on GitHub
Music generation server for Claude Desktop using Sonauto's API.
Install
npm install
npm run build
export SONAUTO_API_KEY=your_key_here
Config
Add to Claude Desktop config:
Direct Node.js
{
"mcpServers": {
"music-generator": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/YOUR/sonauto-mcp/dist/index.js"],
"env": {
"SONAUTO_API_KEY": "your_key_here"
}
}
}
}
Tools
generate_music
Generates music based on text descriptions using the Sonauto API.
Parameters:
{
prompt: string, // Text description of music to generate
num_songs?: number // Number of songs to generate (default: 1)
}
The tool returns audio content that can be played directly in Claude Desktop.
Sample usage:
const result = await client.callTool({
name: "generate_music",
arguments: {
prompt: "An upbeat rock song about how awesome programming is",
num_songs: 1
}
});
Response format:
Music generated successfully!
Generation details:
- Prompt: "An upbeat rock song about how awesome programming is"
- Lyrics: [Generated lyrics appear here]
The audio file is attached and ready to play.
Development Setup
- Create a
.envfile in the project root with your Sonauto API key:
SONAUTO_API_KEY=your_sonauto_api_key_here
- Install dependencies and build:
npm install
npm run build
- Start the server:
npm start
Troubleshooting
If the music generation tool is not working:
- Ensure your Sonauto API key is correctly set in the environment or .env file
- Check that the API key is valid and has not expired
- Look for error messages in the server logs
License
This project is licensed under the MIT License.