Skip to main content
Glama
yunq

xiaozhidog-mcp-music

by yunq

Free Music MCP Server

This is a free music MCP (Model Context Protocol) server designed for the Xiaozhi AI speaker, providing features such as music search and playback control.

Features

  • 🎵 Music Search: Supports searching by song title or artist name

  • ▶️ Playback Control: Play, pause, stop, previous track, next track

  • 🔊 Volume Control: Adjust playback volume (0-100)

  • 📝 Playlist: Add, view, and clear the playlist

  • 🆓 Completely Free: Based on open-source protocols, no payment required

  • 🔌 Standard Interface: Follows the MCP protocol standard

Related MCP server: mcp-qobuz

Installation and Configuration

1. Environment Preparation

Ensure Python 3.8+ is installed:

python3 --version

2. Install Dependencies

cd /Users/a1234/Documents/music
pip3 install -r requirements.txt

3. Test the Server

python3 music_mcp_server.py

4. Xiaozhi AI Configuration

Step 1: Get the MCP Access Point

  1. Log in to the xiaozhi.me console

  2. Enter the configuration page for the agent's role

  3. Find the dedicated MCP access point for this agent in the bottom right corner

Step 2: Configure the MCP Server

Add the following configuration in the Xiaozhi AI console:

{
  "name": "免费音乐服务器",
  "command": "python3",
  "args": ["/Users/a1234/Documents/music/music_mcp_server.py"],
  "transport": "stdio"
}

Usage

Once configured, you can interact with the Xiaozhi AI via voice or text:

  • "Search for Jay Chou's songs"

  • "Find some pop music"

  • "Search for Qing Hua Ci"

Playback Control

  • "Play Qing Hua Ci"

  • "Pause music"

  • "Resume playback"

  • "Stop music"

  • "Next song"

  • "Previous song"

Volume Control

  • "Set volume to 80"

  • "Turn the volume down"

  • "Set volume to 50"

Playlist Management

  • "Show playlist"

  • "Add this song to the playlist"

  • "Clear playlist"

Available Tools

Tool Name

Description

Parameters

search_music

Search for music

query (search keyword), limit (number of results)

play_music

Play a specific song

song_id (song ID), song_name, artist

pause_music

Pause playback

None

resume_music

Resume playback

None

stop_music

Stop playback

None

next_song

Next song

None

previous_song

Previous song

None

set_volume

Set volume

volume (0-100)

add_to_playlist

Add to playlist

song_id, song_name, artist

get_playlist

Get playlist

None

clear_playlist

Clear playlist

None

Technical Architecture

  • Protocol: MCP (Model Context Protocol)

  • Transport: stdio (Standard Input/Output)

  • Language: Python 3.8+

  • Dependencies: mcp, httpx, pydantic

Extended Development

Integrate Real Music APIs

The current version uses mock data. You can modify the search_music_api function to integrate with real free music APIs:

async def search_music_api(query: str, limit: int = 10) -> List[Dict[str, Any]]:
    async with httpx.AsyncClient() as client:
        # 接入您选择的免费音乐API
        response = await client.get(
            "https://api.example.com/search",
            params={"q": query, "limit": limit}
        )
        data = response.json()
        return parse_search_results(data)

Add New Features

  1. Add new tool definitions in handle_list_tools()

  2. Implement tool logic in handle_call_tool()

  3. Update configuration files and documentation

Troubleshooting

Common Issues

Q: Server fails to start A: Check if the Python version and dependencies are installed correctly

Q: Xiaozhi AI cannot connect A: Confirm the file path is correct and check the MCP access point configuration

Q: No search results A: Currently using mock data; you can integrate a real music API

Debug Mode

Enable verbose logging:

PYTHON_LOG_LEVEL=DEBUG python3 music_mcp_server.py

License

This project is open-sourced under the MIT License. You are free to use, modify, and distribute it.

Contribution

Feel free to submit Issues and Pull Requests to improve this project!


Note: Please ensure compliance with relevant music copyright laws and regulations, and use only legal music resources.

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for Suno AI music generation, lyrics, and covers

  • MCP server for Producer/Riffusion AI music generation

  • MCP server for AI dialogue using various LLM models via AceDataCloud

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yunq/xiaozhidog-mcp-music'

If you have feedback or need assistance with the MCP directory API, please join our Discord server