vweiss960/youtube_music_mcp_server
If you are the rightful owner of youtube_music_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
MCP Server used to play music on YouTube.
youtube_music_mcp_server
MCP Server for interacting with YouTube Music. This server provides tools to search, play, and get information about songs on YouTube Music.
Features
- Search YouTube Music for songs, artists, albums, and playlists
- Get detailed song information
- Play songs directly in your browser
- Web search using Brave Search API
- Get current date and time
Setup Instructions
Prerequisites
- Python 3.8 or higher
- Git
Installation
-
Clone the repository:
git clone https://github.com/yourusername/youtube_music_mcp_server.git cd youtube_music_mcp_server -
Create a virtual environment:
Windows:
python -m venv venv venv\Scripts\activatemacOS/Linux:
python -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
(Optional) Set up environment variables:
If you want to use the Brave Search API, create a
.envfile in the root directory:BRAVE_API_KEY=your_api_key_here
Running the MCP Server
You can run the server in two ways:
Option 1: Direct execution
python main.py
Option 2: Configure with Claude Desktop
-
Open your Claude Desktop configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- Windows:
-
Add the following configuration (adjust paths as needed):
Windows:
{ "mcpServers": { "youtube-music": { "command": "C:\\path\\to\\youtube_music_mcp_server\\venv\\Scripts\\python.exe", "args": ["C:\\path\\to\\youtube_music_mcp_server\\main.py"] } } }macOS/Linux:
{ "mcpServers": { "youtube-music": { "command": "/path/to/youtube_music_mcp_server/venv/bin/python", "args": ["/path/to/youtube_music_mcp_server/main.py"] } } } -
Restart Claude Desktop to load the MCP server.
Available Tools
- search_youtube_music - Search for songs, artists, albums, or playlists
- get_song_details - Get information about a specific song
- play_in_browser - Open a song in YouTube Music in your default browser
- brave_web_search - Perform web searches (requires BRAVE_API_KEY)
- get_current_date - Get the current date and time
Troubleshooting
- Module not found errors: Make sure you've activated the virtual environment and installed dependencies with
pip install -r requirements.txt - YouTube Music API errors: The ytmusicapi may require authentication. Check the ytmusicapi documentation for more details.
- Brave Search not working: Ensure your
BRAVE_API_KEYis set correctly in the.envfile.