music21-mcp-server

Bright-L01/music21-mcp-server

3.3

If you are the rightful owner of music21-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 henry@mcphub.com.

The Music21 MCP Server is a robust and production-ready server that leverages the Music21 library to provide advanced music analysis capabilities through a simple API.

The Music21 MCP Server is designed to offer comprehensive music analysis tools by utilizing the powerful Music21 library. It allows users to import music from various sources, analyze musical keys and chord progressions, extract metadata, and export scores in multiple formats. The server is built on the Model Context Protocol (MCP) framework, ensuring reliable and efficient communication between clients and the server. With a focus on stability and production-readiness, the server includes comprehensive error handling and is thoroughly tested to ensure high reliability. It is suitable for both individual musicians and larger organizations looking to integrate music analysis into their workflows. The server supports integration with various platforms, making it a versatile tool for music analysis and processing.

Features

  • Import music from multiple sources including files, corpus, and text notation.
  • Analyze musical keys with confidence scoring using advanced algorithms.
  • Detect chords and progressions with Roman numeral analysis.
  • Extract metadata such as tempo, time signatures, and instrumentation.
  • Export scores to formats like MIDI, MusicXML, and ABC notation.

Usages

usage with local integration stdio

python
mcp.run(transport='stdio')  # Tools defined via @mcp.tool() decorator

usage with local integration subprocess

python
command='uv', args=['run', 'server.py']  # Launch using virtual environment

usage with remote integration sse

python
mcp.run(transport='sse', host="0.0.0.0", port=8000)  # Specify SSE endpoint

usage with remote integration streamable http

yaml
paths:
  /mcp:
    post:
      x-ms-agentic-protocol: mcp-streamable-1.0  # Copilot Studio integration

usage with platform integration github

{"command": "docker", "args": ["run", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"]}

usage with platform integration fastmcp

python
from mcp.server import FastMCP
app = FastMCP('demo')
@app.tool()
async def query(): ...

Tools

  1. import_score

    Import music from various sources.

  2. list_scores

    List all loaded scores.

  3. analyze_key

    Detect the musical key.

  4. analyze_chords

    Extract chord progressions.

  5. get_score_info

    Get comprehensive metadata.

  6. export_score

    Export to various formats.

  7. delete_score

    Remove scores from memory.