Music21CAUTION
🎵 Production-ready MCP server for music analysis & generation | FastMCP • music21 • OAuth2 • Docker | First music21 MCP integration with enterprise features
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://github.com/brightlikethelight/music21-mcp-server/actions/workflows/ci.yml) [](https://github.com/brightlikethelight/music21-mcp-server/actions/workflows/ci.yml) [](https://github.com/brightlikethelight/music21-mcp-server/actions) [](https://www.python.org/downloads/) [](https://opensource.org/licenses/MIT) [](https://github.com/astral-sh/ruff) [](https://modelcontextprotocol.io)
Professional music analysis with 4 different interfaces - MCP server, HTTP API, CLI tools, and Python library. Built on the powerful music21 library with protocol-independent architecture for maximum reliability.
🎯 Why Multiple Interfaces?
Based on 2025 research showing MCP has 40-50% production success rate, this project provides multiple pathways to the same powerful music21 analysis functionality:
- 📡 MCP Server - For Claude Desktop integration (when it works)
- 🌐 HTTP API - For web applications (reliable backup)
- 💻 CLI Tools - For automation (always works)
- 🐍 Python Library - For direct programming access
🎵 Core Music Analysis Features
Analysis Tools (13 Available)
- Import & Export: MusicXML, MIDI, ABC, Lilypond, music21 corpus
- Key Analysis: Multiple algorithms (Krumhansl, Aarden, Bellman-Budge)
- Harmony Analysis: Roman numerals, chord progressions, cadence detection
b28e6ea4c616OBSERVED · 2026-10-09Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add music21-mcp-server -- uvx music21-mcp-server
{
"mcpServers": {
"music21-mcp-server": {
"command": "uvx",
"args": [
"music21-mcp-server"
]
}
}
}Exposed tools (14)
12 read · 1 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
chord_analysis | read | Analyze chord progressions in a score |
delete_score | destructive | Delete a score from storage |
export_score | read | Export a score to various formats |
generate_counterpoint | read | Generate species counterpoint (1=note-against-note, 2=2:1, 3=3:1, 4=syncopated, 5=florid) |
harmonize_melody | read | Generate harmonization for a melody in various styles (classical, jazz, pop, modal) |
harmony_analysis | read | Perform harmony analysis (roman numeral or functional) |
health_check | read | Check server and adapter health |
imitate_style | read | Generate music imitating a specific composer style (bach, mozart, chopin, debussy) or analyze score for style |
import_score | write | Import a score from various sources |
key_analysis | read | Analyze the key signature of a score |
list_scores | read | List all available scores |
pattern_recognition | read | Recognize patterns in music |
score_info | read | Get detailed information about a score |
voice_leading_analysis | read | Analyze voice leading patterns in a score |
Trust audit
CAUTIONgrade B · trust 83/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | WARN |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (5 observation(s))
- Network
- none-observed
- Shell
- declared (2 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (18)
module = __import__(dep_name)
delete_score
.pre-commit-config.yaml
return hashlib.md5(cache_key_data.encode(), usedforsecurity=False).hexdigest()
score_hash = hashlib.md5(
score_hash = hashlib.md5(
return hashlib.md5(str(pitches).encode(), usedforsecurity=False).hexdigest()[
score_hash = hashlib.md5(
"../../../etc/passwd", # Path traversal attempt
tool._validate_safe_path("../../etc/passwd")tool._validate_safe_path("/var/log/../../../etc/shadow")"../../../etc/passwd",
"../../../etc/passwd",
music21, numpy, pydantic, cachetools, psutil, mcp, fastmcp, fastapi
**⚠️ Security Note**: Keep this URL secret! Anyone with this URL can send messages to your Discord channel.
- Never run with elevated privileges unless absolutely necessary
curl -LsSf https://astral.sh/uv/install.sh | sh
curl -LsSf https://astral.sh/uv/install.sh | sh
Gates applied: no_behavioural_pass.
b28e6ea4c616full audit observations/trust-audit/mcp-server/brightlikethelight__music21-1.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-09 | b28e6ea4c616 | CAUTION | B | 83 | first audit |
Questions
What is the Music21 MCP server?
🎵 Production-ready MCP server for music analysis & generation | FastMCP • music21 • OAuth2 • Docker | First music21 MCP integration with enterprise features
What tools does Music21 expose?
14 in total: 12 read-only, 1 that write, and 1 that can delete or overwrite (delete_score). Every one is listed on this page with its risk.
Is Music21 safe to connect to an agent?
With care. The audit graded it B (83/100) and found 18 things worth knowing before you trust this server, listed below with the exact line each was found on. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Music21 need?
No credential environment variables were found in its source, so it appears to need none.
How current is this page?
The grade is for one exact copy of the source (b28e6ea4c616), read on 2026-10-09. The repository is watched and re-audited when it changes.