music21-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
music21 MCP Server
Servidor MCP de análise musical usando music21 + FastMCP + Pydantic.
Complementa o seu MIDI-compostion-tools-MCP focado em construção: enquanto o toolkit constrói composições, este servidor analisa arquivos existentes.
🛠 Tools disponíveis (8)
Tool | O que faz |
| Visão geral: título, compositor, partes, assinaturas, duração |
| Detecta tonalidade (algoritmo Krumhansl-Schmuckler) com confiança |
| Extrai acordes, numerais romanos, cadências, progressão resumida |
| Contorno, âmbito, intervalos, clímax, lista de notas |
| Fórmula de compasso, tempo, densidade, síncope, padrões rítmicos |
| Detecta seções (A, B, A'…), repetições, forma geral (ABA, Rondó…) |
| Erros de voice-leading: quintas paralelas, cruzamentos, saltos |
| Motivos recorrentes e suas transformações (inversão, retrogrado…) |
Related MCP server: musescore-mcp
📦 Instalação
# 1. Clonar / copiar a pasta music21-mcp
cd music21-mcp
# 2. Criar ambiente virtual (recomendado)
python -m venv .venv
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
# 3. Instalar dependências
pip install -r requirements.txt▶️ Executar
python server.pyO servidor roda via stdio — padrão para integração local com Claude Desktop, Cursor, etc.
⚙️ Configuração no Claude Desktop
Adicione ao seu claude_desktop_config.json:
{
"mcpServers": {
"music21": {
"command": "python",
"args": ["/caminho/absoluto/para/music21-mcp/server.py"],
"env": {}
}
}
}Dica: se usar virtualenv, use o Python do venv:
"/caminho/para/music21-mcp/.venv/bin/python"
🔗 Integração com seu MCP Music Toolkit
Pipeline típico:
music21 MCP (analyze_harmony)
→ detecta progressão do arquivo
→ passa para seu toolkit (comp_set_progression)
→ gera variação ou arranjo
music21 MCP (check_counterpoint)
→ aponta erros no MIDI gerado
→ seu toolkit (theory_voice_lead_sequence)
→ corrige o voice leading📁 Estrutura
music21-mcp/
├── server.py # FastMCP — 8 tools registradas
├── models.py # Pydantic schemas input/output
├── requirements.txt
├── analyzers/
│ ├── harmony.py # Acordes + numerais romanos + cadências
│ ├── melody.py # Contorno, âmbito, intervalos
│ ├── rhythm.py # Tempo, densidade, síncope
│ ├── form.py # Seções e forma musical
│ ├── counterpoint.py # Erros de contraponto/voice-leading
│ ├── score_info.py # Metadados e visão geral
│ └── motifs.py # Padrões motívicos recorrentes
└── utils/
└── loader.py # Carregar arquivos + helpers music21💡 Exemplo de uso
# analyze_key
{
"file_path": "/home/user/bach_prelude.mid",
"response_format": "json"
}
# analyze_harmony com recorte de compasses
{
"file_path": "/home/user/sonata.xml",
"measures": [1, 16],
"response_format": "markdown"
}
# analyze_motifs customizado
{
"file_path": "/home/user/symphony.mid",
"motif_length": 5,
"min_occurrences": 3
}This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic music theory for agents: analyze, voice, reharmonize, conduct — computed, not guessed
Audio features + harmonic set-building for tracks by name/ISRC. Spotify audio-features replacement.
Autonomous music production for AI agents with MIDI generation, QC and provenance.
ScoreStarling is an all-in-one AI sheet music assistant. Ask for anything to do with sheet music: transcribe a song from audio, video or a link, read a PDF or photo, add chords, change the key, make it easier, turn it into guitar TAB or jianpu, or arrange it for another instrument. Every change lands on a real score you can hear, fix and download (PDF, MIDI, MusicXML, guitar TAB, jianpu, audio). Hosted remote server with OAuth sign-in. Free accounts get monthly credits and free previews; prices are at scorestarling.com/pricing. Setup: https://scorestarling.com/mcp
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI models to analyze audio files through numerical fingerprints, pitch tracking, and visual spectrograms without requiring direct audio playback. It provides tools for comparing audio iterations and detecting patterns using token-efficient analysis operations.14-
- FlicenseAqualityDmaintenanceEnables Claude AI to convert, edit, and analyze MuseScore files (.mscz, .musicxml, MIDI) through natural language commands, supporting format conversion, transposition, harmony analysis, and more.201-
- AlicenseAqualityBmaintenanceProvides atomic music-theory and MIDI tools for composing, enabling LLMs to chain deterministic steps like scale/chord lookups, degree resolution, rhythm generation, and MIDI rendering.131MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-assisted MIDI music generation and composition through natural language, supporting style, tempo, key, and instrument selection.MIT