A comprehensive Model Context Protocol (MCP) server for querying the MusicBrainz database, built with FastMCP framework. This server provides seamless access to music metadata including artists, releases, recordings, and more through a standardized MCP interface.
🎵 Features
🎵 A comprehensive Model Context Protocol (MCP) server for querying the MusicBrainz database. Built with FastMCP framework, featuring 10 MCP tools, async architecture, comprehensive testing, and production-ready deployment.
星數
4
工具
—
可用率
—
10 Comprehensive MCP Tools for music database queries
Real-time MusicBrainz API Integration with rate limiting and error handling
Async/Await Support for high-performance operations
Comprehensive Caching System with configurable TTL
Robust Error Handling with detailed error messages
Flexible Configuration via environment variables or config files
Production Ready with comprehensive testing (101 tests, 99% passing)
🚀 Quick Start
Prerequisites
Python 3.8+
Internet connection for MusicBrainz API access
Installation
Clone the repository:
git clone <repository-url>
cd MusicBrainzMcp
Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -e .
Run the server:
python -m musicbrainz_mcp.main
The server will start and be available for MCP client connections.
🚀 Quick Start with Smithery.ai
The easiest way to use the MusicBrainz MCP Server is through smithery.ai:
# Using MCP client to search for artists
result = await client.call_tool("search_artist", {
"params": {
"query": "The Beatles",
"limit": 10
}
})
Get Artist Details
# Get detailed information about an artist
result = await client.call_tool("get_artist_details", {
"params": {
"mbid": "b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d",
"inc": ["releases", "recordings"]
}
})
Browse Artist Releases
# Browse all releases by an artist
result = await client.call_tool("browse_artist_releases", {
"params": {
"artist_mbid": "b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d",
"limit": 20,
"release_type": ["album"],
"release_status": ["official"]
}
})
The server can be deployed on any cloud platform that supports Python applications:
Heroku: Use the included Procfile
AWS Lambda: Package as a serverless function
Google Cloud Run: Use the Docker container
Azure Container Instances: Deploy the Docker image
🧪 Testing
Run the comprehensive test suite:
# Run all tests
pytest
# Run with coverage
pytest --cov=musicbrainz_mcp
# Run only unit tests
pytest -m unit
# Run only integration tests
pytest -m integration
# Run with verbose output
pytest -v
Made with ❤️ for the music community This server provides comprehensive access to music metadata including artists, albums, recordings, releases, and related information through a standardized MCP interface.
Features
🎵 Comprehensive Music Data: Access artists, albums, recordings, releases, and more
🚀 FastMCP Framework: Built on the robust FastMCP framework for reliable MCP protocol handling
🔍 Powerful Search: Search across all MusicBrainz entity types with flexible query options
📊 Rich Metadata: Get detailed information including relationships, tags, and ratings
⚡ Async Performance: Non-blocking async operations for optimal performance
🛡️ Rate Limiting: Built-in compliance with MusicBrainz API guidelines
🧪 Well Tested: Comprehensive test suite with high code coverage
📚 Great Documentation: Detailed docs with examples and API reference
Quick Start
Installation
# Clone the repository
git clone https://github.com/yourusername/musicbrainz-mcp.git
cd musicbrainz-mcp
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -e ".[dev]"
Running the Server
# Start the MCP server
musicbrainz-mcp
# Or run directly with Python
python -m musicbrainz_mcp.server
Basic Usage
The server provides several MCP tools for querying MusicBrainz:
search_artist - Search for artists by name
search_release - Search for releases/albums
search_recording - Search for recordings/tracks
get_artist_details - Get detailed artist information
get_release_details - Get detailed release information
lookup_by_mbid - Direct lookup using MusicBrainz IDs
MCP Tools
search_artist
Search for artists by name or query string.
Parameters:
query (string): Search query for artist name
limit (integer, optional): Maximum number of results (default: 25)
offset (integer, optional): Offset for pagination (default: 0)
Example:
{
"query": "The Beatles",
"limit": 10
}
search_release
Search for releases (albums, singles, etc.) by title or artist.
Parameters:
query (string): Search query for release title
artist (string, optional): Filter by artist name
limit (integer, optional): Maximum number of results (default: 25)
offset (integer, optional): Offset for pagination (default: 0)
search_recording
Search for recordings (individual tracks) by title or artist.
Parameters:
query (string): Search query for recording title
artist (string, optional): Filter by artist name
limit (integer, optional): Maximum number of results (default: 25)
offset (integer, optional): Offset for pagination (default: 0)
get_artist_details
Get detailed information about a specific artist.
Parameters:
mbid (string): MusicBrainz ID of the artist
include (array, optional): Additional data to include (releases, recordings, etc.)
get_release_details
Get detailed information about a specific release.
Parameters:
mbid (string): MusicBrainz ID of the release
include (array, optional): Additional data to include (tracks, artist-credits, etc.)
lookup_by_mbid
Direct lookup of any entity by its MusicBrainz ID.
Parameters:
mbid (string): MusicBrainz ID
entity_type (string): Type of entity (artist, release, recording, etc.)
include (array, optional): Additional data to include
Configuration
The server can be configured through environment variables:
MUSICBRAINZ_USER_AGENT: Custom User-Agent for API requests
MUSICBRAINZ_RATE_LIMIT: Rate limit in requests per second (default: 1.0)
MUSICBRAINZ_TIMEOUT: Request timeout in seconds (default: 30)
🎵 A comprehensive Model Context Protocol (MCP) server for querying the MusicBrainz database. Built with FastMCP framework, featuring 10 MCP tools, async architecture, comprehensive testing, and produ
🎵 A comprehensive Model Context Protocol (MCP) server for querying the MusicBrainz database. Built with FastMCP framework, featuring 10 MCP tools, async architecture, comprehensive testing, and production-ready deployment.
上次檢查時間:2026-10-28。 🎵 A comprehensive Model Context Protocol (MCP) server for querying the MusicBrainz database. Built with FastMCP framework, featuring 10 MCP tools, async architecture, comprehensive testing, and production-ready deployment.