Logo von MuseScore MCP Server

MuseScore MCP Server

Community
ghchen99

A Model Context Protocol (MCP) server that provides programmatic control over MuseScore!

Herausgeberghchen99
Repositorymcp-musescore
SpracheQML
Forks
28
Sterne
95
Verfügbare Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Links
  • Tools mit KI-Workflows verbinden

    MuseScore MCP Server stellt MCP-Funktionen bereit, die kompatible KI-Clients und Agenten nutzen können.

  • 0 verfügbare Tools

    Sehen Sie sich unten die aufrufbaren Aktionen an, einschließlich Namen und Beschreibungen, sofern der Server diese bereitstellt.

  • Konfiguration zum Kopieren

    Nutzen Sie die Installationsbeispiele, um diesen Server in Ihrem bevorzugten MCP-Client zu konfigurieren.

  • Open-Source-Kennzahlen

    95 Sterne und 28 Forks im verlinkten Repository.

MuseScore MCP Server

A Model Context Protocol (MCP) server that provides programmatic control over MuseScore, via a WebSocket-based plugin system. This allows AI assistants like Claude to compose music, add lyrics, navigate scores, and control MuseScore directly.

Demo GIF

Prerequisites

  • MuseScore 3.x or 4.x
  • Python 3.8+
  • Claude Desktop or compatible MCP client

Setup

1. Install the MuseScore Plugin

First, save the QML plugin code to your MuseScore plugins directory:

macOS: ~/Documents/MuseScore4/Plugins/musescore-mcp-websocket.qml Windows: %USERPROFILE%\Documents\MuseScore4\Plugins\musescore-mcp-websocket.qml Linux: ~/Documents/MuseScore4/Plugins/musescore-mcp-websocket.qml

2. Enable the Plugin in MuseScore

  1. Open MuseScore
  2. Go to Plugins → Plugin Manager
  3. Find "MuseScore API Server" and check the box to enable it
  4. Click OK

3. Setup Python Environment

bash
git clone <your-repo>
cd mcp-agents-demo
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install fastmcp websockets

4. Configure Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{
  "mcpServers": {
    "musescore": {
      "command": "/path/to/your/project/.venv/bin/python",
      "args": [
        "/path/to/your/project/server.py"
      ]
    }
  }
}

Note: Update the paths to match your actual project location.

Running the System

Order of Operations

  1. Start MuseScore first with a score open
  2. Run the MuseScore plugin: Go to Plugins → MuseScore API Server
    • You should see console output: "Starting MuseScore API Server on port 8765"
  3. Then start the Python MCP server or restart Claude Desktop

[insert screenshot of different functionality, harmonisation, melodywriting, as zoomed in GIFs]

Development and Testing

For development, use the MCP development tools:

bash
# Install MCP dev tools
pip install mcp

# Test your server
mcp dev server.py

# Check connection status
mcp dev server.py --inspect

Viewing Console Output

To see MuseScore plugin console output, run MuseScore from terminal:

macOS:

bash
/Applications/MuseScore\ 4.app/Contents/MacOS/mscore

Windows:

cmd
cd "C:\Program Files\MuseScore 4\bin"
MuseScore.exe

Linux:

bash
musescore4

Features

This MCP server provides comprehensive MuseScore control.

🌟 NEW in this fork: Built-in automatic, flawless multi-voice Polyphony & Temporal layout mapping to LilyPond!

Navigation & Cursor Control

  • get_cursor_info() - Get current cursor position and selection info
  • go_to_measure(measure) - Navigate to specific measure
  • go_to_beginning_of_score() / go_to_final_measure() - Navigate to start/end
  • next_element() / prev_element() - Move cursor element by element
  • next_staff() / prev_staff() - Move between staves
  • select_current_measure() - Select entire current measure
  • select_custom_range(start_tick, end_tick, start_staff, end_staff) - Slicing tool to extract cross-measure, multi-staff phrasing

Polyphony & LilyPond Integration

  • Temporal Rhythm Padding: Voices with gaps or rests automatically receive LilyPond spacer sequences (s4.) to hold their mathematical place accurately.
  • Concurrent Voice Rendering: Full 4-voice (\voiceOne, \voiceTwo, etc.) arrays correctly structured and sharded per staff for advanced Agent processing.

Note & Rest Creation

  • add_note(pitch, duration, advance_cursor_after_action, add_to_chord) - Add notes with MIDI pitch. Sequential notes write a melody; set add_to_chord=True to stack a pitch on the current chord.
  • add_rest(duration, advance_cursor_after_action) - Add rests
  • add_tuplet(duration, ratio, advance_cursor_after_action) - Add tuplets (triplets, etc.)

Measure Management

  • insert_measure() - Insert measure at current position
  • append_measure(count) - Add measures to end of score
  • delete_selection(measure) - Delete current selection or specific measure

Lyrics & Text

  • add_lyrics_to_current_note(text) - Add lyrics to current note
  • add_lyrics(lyrics_list) - Batch add lyrics to multiple notes
  • set_title(title) - Set score title

Score Information

  • get_score() - Get complete score analysis and structure
  • ping_musescore() - Test connection to MuseScore
  • connect_to_musescore() - Establish WebSocket connection

Utilities

  • undo() - Undo last action
  • set_time_signature(numerator, denominator) - Change time signature
  • processSequence(sequence) - Execute multiple commands in batch

Sample Music

Check out the /examples folder for sample MuseScore files demonstrating various musical styles:

  • Asian Instrumental - Traditional Asian-inspired instrumental piece
  • String Quartet - Classical string quartet arrangement

Each example includes:

  • .mscz - MuseScore file (editable)
  • .pdf - Sheet music
  • .mp3 - Audio preview

Usage Examples

Creating a Simple Melody

python
# Set up the score
await set_title("My First Song")
await go_to_beginning_of_score()

# Add notes (MIDI pitch: 60=C, 62=D, 64=E, etc.)
await add_note(60, {"numerator": 1, "denominator": 4}, True)  # Quarter note C
await add_note(64, {"numerator": 1, "denominator": 4}, True)  # Quarter note E
await add_note(67, {"numerator": 1, "denominator": 4}, True)  # Quarter note G
await add_note(72, {"numerator": 1, "denominator": 2}, True)  # Half note C

# Add lyrics
await go_to_beginning_of_score()
await add_lyrics_to_current_note("Do")
await next_element()
await add_lyrics_to_current_note("Mi")
await next_element()
await add_lyrics_to_current_note("Sol")
await next_element()
await add_lyrics_to_current_note("Do")

Batch Operations

python
# Add multiple lyrics at once
await add_lyrics(["Twin-", "kle", "twin-", "kle", "lit-", "tle", "star"])

# Use sequence processing for complex operations
sequence = [
    {"action": "goToBeginningOfScore", "params": {}},
    {"action": "addNote", "params": {"pitch": 60, "duration": {"numerator": 1, "denominator": 4}, "advanceCursorAfterAction": True}},
    {"action": "addNote", "params": {"pitch": 64, "duration": {"numerator": 1, "denominator": 4}, "advanceCursorAfterAction": True}},
    {"action": "addRest", "params": {"duration": {"numerator": 1, "denominator": 4}, "advanceCursorAfterAction": True}}
]
await processSequence(sequence)

Star History

Troubleshooting

Connection Issues

  • "Not connected to MuseScore":
    • Ensure MuseScore is running with a score open
    • Run the MuseScore plugin (Plugins → MuseScore API Server)
    • Check that port 8765 isn't blocked by firewall

Plugin Issues

  • Plugin not appearing: Check the .qml file is in the correct plugins directory
  • Plugin won't enable: Restart MuseScore after placing the plugin file
  • No console output: Run MuseScore from terminal to see debug messages

Python Server Issues

  • "No server object found": The server object must be named mcp, server, or app at module level
  • WebSocket errors: Make sure MuseScore plugin is running before starting Python server
  • Connection timeout: The MuseScore plugin must be actively running, not just enabled

API Limitations

  • Lyrics: Only first verse supported in MuseScore 3.x plugin API
  • Title setting: Uses multiple fallback methods due to frame access limitations
  • Selection persistence: Some operations may affect current selection

File Structure

mcp-agents-demo/
├── .venv/
├── server.py                           # Python MCP server entry point
├── musescore-mcp-websocket.qml         # MuseScore plugin
├── requirements.txt
├── README.md
└── src/                                # Source code modules
    ├── __init__.py
    ├── client/                         # WebSocket client functionality
    │   ├── __init__.py
    │   └── websocket_client.py
    ├── tools/                          # MCP tool implementations
    │   ├── __init__.py
    │   ├── connection.py               # Connection management tools
    │   ├── navigation.py               # Score navigation tools
    │   ├── notes_measures.py           # Note and measure manipulation
    │   ├── sequences.py                # Batch operation tools
    │   ├── staff_instruments.py        # Staff and instrument tools
    │   └── time_tempo.py               # Timing and tempo tools
    └── types/                          # Type definitions
        ├── __init__.py
        └── action_types.py             # WebSocket action type definitions

MIDI Pitch Reference

Common MIDI pitch values for reference:

  • Middle C: 60
  • C Major Scale: 60, 62, 64, 65, 67, 69, 71, 72
  • Chromatic: C=60, C#=61, D=62, D#=63, E=64, F=65, F#=66, G=67, G#=68, A=69, A#=70, B=71

Duration Reference

Duration format: {"numerator": int, "denominator": int}

  • Whole note: {"numerator": 1, "denominator": 1}
  • Half note: {"numerator": 1, "denominator": 2}
  • Quarter note: {"numerator": 1, "denominator": 4}
  • Eighth note: {"numerator": 1, "denominator": 8}
  • Dotted quarter: {"numerator": 3, "denominator": 8}

Installation

TypingMind
Voraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "ghchen99-mcp-musescore": {
      "command": "",
      "args": []
    }
  }
}

MuseScore MCP Server MCP mit mehreren KI-Modellen nutzen

TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. Sobald MuseScore MCP Server verbunden ist, können Sie die Integration mit verschiedenen KI-Modellen in TypingMind verwenden, statt sie für jedes Modell separat einzurichten. Diese MCP-Integration läuft lokal über den TypingMind-MCP-Konnektor auf Ihrem Gerät.

Einrichtungsanleitung für den lokalen Konnektor

Nutzen Sie diese Option, wenn der MCP-Server Zugriff auf lokale Dateien, Apps oder private Ressourcen auf Ihrem Computer benötigt.

1

MCP-Einstellungen öffnen

Gehen Sie in TypingMind zu „Einstellungen“, „Erweiterte Einstellungen“ und dann „Model Context Protocol“ und wählen Sie „Konnektor-Setup“.

  1. Öffnen Sie TypingMind in Ihrem Browser.
  2. Klicken Sie auf das Symbol „Optionen“.
  3. Gehen Sie zu „Erweiterte Einstellungen“.
  4. Öffnen Sie den Abschnitt „Model Context Protocol“.
  5. Klicken Sie auf „Konnektor-Setup“ und wählen Sie „Dieses Gerät“.
Einrichtungsbildschirm des TypingMind-MCP-Konnektors mit ausgewählter Option „Dieses Gerät“
2

Konnektor-Befehl ausführen

Wählen Sie „Dieses Gerät“, kopieren Sie den Befehl aus TypingMind und führen Sie ihn im Terminal aus. Lassen Sie den Prozess laufen, solange Sie MCP verwenden.

  1. Kopieren Sie den in TypingMind angezeigten Einrichtungsbefehl.
  2. Öffnen Sie unter macOS Terminal bzw. unter Windows Windows Terminal.
  3. Fügen Sie den Befehl ein und führen Sie ihn aus.
  4. Bestätigen Sie die Paketinstallation, wenn Sie im Terminal zum Fortfahren aufgefordert werden.
  5. Lassen Sie das Terminalfenster geöffnet und den Prozess darin laufen, solange Sie MCP-Tools verwenden.
3

MuseScore MCP Server als Server hinzufügen

Wenn der Konnektorstatus „Bereit“ anzeigt, klicken Sie auf „Server ändern“ und fügen Sie die MCP-Server-Konfiguration ein.

  1. Warten Sie, bis der Konnektorstatus „Bereit“ anzeigt.
  2. Klicken Sie auf „Server ändern“.
  3. Fügen Sie die MCP-Server-Konfiguration für MuseScore MCP Server ein.
  4. Speichern Sie die Serverliste.
  5. Aktualisieren Sie die Ansicht, um bei Bedarf zu prüfen, ob der Konnektor weiterhin bereit ist.
MCP-Einstellungen in TypingMind mit aktivem Server und der Schaltfläche „Server ändern“
{
  "mcpServers": {
    "ghchen99-mcp-musescore": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-musescore"
      ]
    }
  }
}
4

Verbindung modellübergreifend nutzen

Speichern Sie die Serverliste, öffnen Sie „Plugins“ und aktivieren Sie die MCP-Tools von MuseScore MCP Server. Wählen Sie dann ein beliebiges unterstütztes KI-Modell in TypingMind und verwenden Sie die Tools im Chat oder weisen Sie sie einem KI-Agenten zu.

  1. Öffnen Sie die Seite „Plugins“ in TypingMind.
  2. Aktivieren Sie die MCP-Tools von MuseScore MCP Server.
  3. Starten Sie einen Chat und wählen Sie das KI-Modell, das Sie verwenden möchten.
  4. Nutzen Sie die MCP-Tools im Chat oder weisen Sie sie einem KI-Agenten zu.
  5. Wechseln Sie bei Bedarf zu einem anderen KI-Modell, ohne die MCP-Verbindung erneut herzustellen.
TypingMind-Chat mit aktivierten MCP-Tools und einem ausgewählten KI-Modell
Können Sie mir mit MuseScore MCP Server bei dieser Aufgabe helfen?
MuseScore MCP Server
Gerne. Ich habe es gelesen.
Das habe ich mit MuseScore MCP Server gefunden.

Häufig gestellte Fragen

Wofür wird der MCP-Server MuseScore MCP Server verwendet?

MuseScore MCP Server ist ein MCP-Server, über den kompatible KI-Clients auf externe Tools und Kontext zugreifen können. In TypingMind können Sie diesen MCP-Server einmal hinzufügen und seine Tools in Ihrem KI-Arbeitsbereich verfügbar machen.

Kann ich MuseScore MCP Server MCP mit mehreren KI-Modellen in TypingMind verwenden?

Ja. TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. So können Sie MuseScore MCP Server mit verschiedenen KI-Modellen wie Claude, ChatGPT, Gemini oder anderen in TypingMind konfigurierten Modellen verwenden, ohne den MCP-Server für jedes Modell separat einzurichten.

Warum MuseScore MCP Server MCP mit TypingMind nutzen?

TypingMind ist eine der besten Oberflächen für LLM-Chats, da es mehrere KI-Modelle, Prompts, Plugins, KI-Agenten, API-Schlüssel und MCP-Tools in einem Arbeitsbereich vereint. Sobald MuseScore MCP Server verbunden ist, können Sie die zugehörigen MCP-Tools mit Ihren bevorzugten Modellen nutzen und Ihre Chat-Abläufe in TypingMind übersichtlich organisieren.

Wie verbinde ich MuseScore MCP Server MCP mit TypingMind?

MuseScore MCP Server wird über den lokalen MCP-Konnektor von TypingMind angebunden. Das ist die beste Wahl, wenn der MCP-Server auf lokale Dateien, Desktop-Apps, Befehlszeilentools oder private Ressourcen auf Ihrem Computer zugreifen muss.

Welche Tools stellt MuseScore MCP Server MCP in TypingMind bereit?

MuseScore MCP Server stellt MCP-Funktionen bereit, die Sie auf der Plugins-Seite in TypingMind aktivieren und im Chat verwenden oder KI-Agenten zuweisen können.

Muss ich meine API-Schlüssel mit TypingMind teilen, um MuseScore MCP Server MCP zu verwenden?

Nein. TypingMind arbeitet vorrangig lokal, sodass Sie die Kontrolle über Ihre Modellanbieter, API-Schlüssel, Prompts und MCP-Konfiguration behalten. Falls MuseScore MCP Server eine Authentifizierung erfordert, fügen Sie beim Erstellen der Verbindung die erforderlichen Header, OAuth-Einstellungen oder die lokale Konfiguration für diesen MCP-Server hinzu.

Ähnliche MCP-Server

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇