GnistAI GnistAI
Log in

Getting Started with MusicBrainz

Music metadata — artist profiles, album discographies, song/recording search.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Media

Data source: MusicBrainz (open music encyclopedia)

Overview

MusicBrainz wraps MusicBrainz (open music encyclopedia), handling authentication, pagination, and rate limits for you. This tutorial covers all 5 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-musicbrainz": {
      "url": "https://context.gnist.ai/mcp/musicbrainz/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (5)

search_artists

Search for music artists by name. Returns artist names, countries, active years, and genre tags. Args: query: Artist name (e.g. "Radiohead", "Miles Davis", "a-ha"). limit: Maximum results (1-25, default 10).

ParameterTypeRequiredDescription
querystringrequired
limitintegeroptional (default: 10)
curl -X POST "https://context.gnist.ai/mcp/musicbrainz/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_artists", "arguments": {"query": "renewable energy"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/musicbrainz/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'renewable energy'},
            'name': 'search_artists'}},
)
print(resp.json())

get_artist_info

Get detailed information about an artist by MusicBrainz ID. Returns full artist profile including name, type, country, lifespan, and tags. Args: artist_id: MusicBrainz UUID (e.g. "a74b1b7f-71a5-4011-9441-d0b5e4122711" for Radiohead).

ParameterTypeRequiredDescription
artist_idstringrequired
curl -X POST "https://context.gnist.ai/mcp/musicbrainz/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_artist_info", "arguments": {"artist_id": "12345"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/musicbrainz/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'artist_id': '12345'}, 'name': 'get_artist_info'}},
)
print(resp.json())

get_artist_releases

Get albums and releases for an artist. Returns release titles, dates, countries, and track counts. Args: artist_id: MusicBrainz artist UUID. limit: Maximum results (1-100, default 25).

ParameterTypeRequiredDescription
artist_idstringrequired
limitintegeroptional (default: 25)
curl -X POST "https://context.gnist.ai/mcp/musicbrainz/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_artist_releases", "arguments": {"artist_id": "12345"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/musicbrainz/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'artist_id': '12345'}, 'name': 'get_artist_releases'}},
)
print(resp.json())

search_recordings

Search for songs/recordings by title. Returns recording titles, artists, duration, and first release dates. Args: query: Song or track title (e.g. "Bohemian Rhapsody", "Take On Me"). limit: Maximum results (1-25, default 10).

ParameterTypeRequiredDescription
querystringrequired
limitintegeroptional (default: 10)
curl -X POST "https://context.gnist.ai/mcp/musicbrainz/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_recordings", "arguments": {"query": "renewable energy"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/musicbrainz/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'renewable energy'},
            'name': 'search_recordings'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/musicbrainz/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/musicbrainz/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_artists to find items, then get_artist_info to get full details. This two-step pattern is common for exploring data before drilling down.
Pagination
Several tools support limit, offset, or page parameters. Start with small limits during development, then increase for production queries.

FAQ

What data does MusicBrainz provide?

Music metadata — artist profiles, album discographies, song/recording search. It exposes 5 tools: search_artists, get_artist_info, get_artist_releases, search_recordings, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the MusicBrainz API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials