A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
🎵 Production-ready MCP server for music analysis & generation | FastMCP • music21 • OAuth2 • Docker | First music21 MCP
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.
Based on 2025 research showing MCP has 40-50% production success rate, this project provides multiple pathways to the same powerful music21 analysis functionality:
# Install the package
pip install music21-mcp-server
# Start the server
music21-mcp # MCP server for Claude Desktop
music21-http # REST API at localhost:8000
music21-cli # Interactive CLI
music21-analysis mcp # Unified launcher (positional arg)
# Clone repository
git clone https://github.com/brightlikethelight/music21-mcp-server.git
cd music21-mcp-server
# Install with UV (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
# Or with pip
pip install .
# Configure music21 corpus
python -m music21.configure
python -m music21_mcp.launcher
# Start MCP server
python -m music21_mcp.launcher mcp
# Configure Claude Desktop with:
# ~/.config/claude-desktop/config.json
{
"mcpServers": {
"music21-analysis": {
"command": "python",
"args": ["-m", "music21_mcp.server_minimal"],
"env": {
"PYTHONPATH": "/path/to/music21-mcp-server/src"
}
}
}
}
# Start HTTP API server
python -m music21_mcp.launcher http
# Opens: http://localhost:8000
# API docs: http://localhost:8000/docs
# Example usage:
curl -X POST "http://localhost:8000/scores/import" \
-H "Content-Type: application/json" \
-d '{"score_id": "chorale", "source": "bach/bwv66.6", "source_type": "corpus"}'
curl -X POST "http://localhost:8000/analysis/key" \
-H "Content-Type: application/json" \
-d '{"score_id": "chorale"}'
# Show CLI status
python -m music21_mcp.launcher cli status
# Import and analyze a Bach chorale
python -m music21_mcp.launcher cli import chorale bach/bwv66.6 corpus
python -m music21_mcp.launcher cli key-analysis chorale
python -m music21_mcp.launcher cli harmony chorale roman
# List all tools
python -m music21_mcp.launcher cli tools
from music21_mcp import create_sync_analyzer
# Create analyzer
analyzer = create_sync_analyzer()
# Import and analyze
analyzer.import_score("chorale", "bach/bwv66.6", "corpus")
key_result = analyzer.analyze_key("chorale")
harmony_result = analyzer.analyze_harmony("chorale", "roman")
print(f"Key: {key_result}")
print(f"Harmony: {harmony_result}")
# Quick comprehensive analysis
analysis = analyzer.quick_analysis("chorale")
# Run all tests
python -m pytest tests/ -v
# Run with coverage threshold
python -m pytest tests/ --cov=src/music21_mcp --cov-fail-under=82
# Install development dependencies
uv sync --dev
# Set up pre-commit hooks
pre-commit install
# Run linting
ruff check src/
ruff format src/
# Type checking
mypy src/
Core Value Layer:
├── services.py # Music21 analysis service (protocol-independent)
└── tools/ # 13 music analysis tools
Protocol Adapter Layer:
├── adapters/mcp_adapter.py # MCP protocol isolation
├── adapters/http_adapter.py # HTTP/REST API
├── adapters/cli_adapter.py # Command-line interface
└── adapters/python_adapter.py # Direct Python access
Unified Entry Point:
└── launcher.py # Single entry point for all interfaces
| Interface | Success Rate | Best For |
|---|---|---|
| MCP | 40-50% | AI assistant integration |
| HTTP | 95%+ | Web applications |
| CLI | 99%+ | Automation & scripting |
| Python | 99%+ | Direct programming |
# Server host and port (used by HTTP adapter and launcher)
export MUSIC21_MCP_HOST=127.0.0.1
export MUSIC21_MCP_PORT=8000
# Operation timeouts (seconds)
export MUSIC21_MCP_TIMEOUT=30 # General async operation timeout
export MUSIC21_TOOL_TIMEOUT=30 # Per-tool execution timeout
export MUSIC21_CHORD_ANALYSIS_TIMEOUT=60 # Chord analysis timeout
export MUSIC21_BATCH_TIMEOUT=30 # Batch processing timeout
# CORS origins for HTTP adapter (comma-separated)
export MUSIC21_CORS_ORIGINS="http://localhost:*"
# Configure corpus path (one-time setup)
python -m music21.configure
# CLI approach
python -m music21_mcp.launcher cli import chorale bach/bwv66.6 corpus
python -m music21_mcp.launcher cli key-analysis chorale
# Python approach
analyzer = create_sync_analyzer()
analyzer.import_score("chorale", "bach/bwv66.6", "corpus")
print(analyzer.analyze_key("chorale"))
# For Claude Desktop
python -m music21_mcp.launcher mcp
# For web development
python -m music21_mcp.launcher http
# For command-line work
python -m music21_mcp.launcher cli status
The previous enterprise version has been simplified for reliability:
Get real-time notifications for CI/CD pipeline status, pull requests, and releases:
We welcome contributions! Please see our Contributing Guide for details on:
Quick start:
git checkout -b feature/amazing-featurepytest tests/ --cov=src/music21_mcp --cov-fail-under=82git commit -m 'feat: Add amazing feature'git push origin feature/amazing-featureMIT License - see LICENSE file for details.
Choose the interface that works for you. All provide the same powerful music21 analysis capabilities! 🎵
MCP server integration for DaVinci Resolve Studio
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnos
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots