MuseScore MCP Server
by jonbrantingham
The MuseScore MCP server enables AI assistants to interact with the MuseScore notation software. It allows for control via MIDI and score manipulation capabilities allowing AI tools such as Claude to work with the software.
Last updated: N/A
MuseScore MCP Server
A Model Context Protocol (MCP) server for MuseScore integration, allowing AI assistants like Claude to interact with MuseScore through MIDI and score manipulation capabilities.
Overview
This MCP server enables AI assistants to:
- Control MuseScore via MIDI integration
- Import and export MIDI files
- Create and modify scores programmatically
- Adjust MIDI parameters (volume, expression, etc.)
- Apply articulations and dynamics
- Manage soundfonts and playback settings
Features
- Score Management: Create, open, edit, and export MuseScore files
- MIDI Integration: Send and receive MIDI messages to/from MuseScore
- Score Editing: Add/edit notes, rests, clefs, time signatures, key signatures
- Playback Control: Play, pause, stop, and navigate through scores
- MIDI Parameter Control: Adjust CC values, program changes, and other MIDI parameters
- Articulation and Dynamic Control: Apply various articulations and dynamics to notes
Prerequisites
- Node.js (v16+)
- MuseScore 4.x installed
- Knowledge of MIDI and music notation concepts
Installation
# Clone this repository
git clone https://github.com/jonbrantingham/musescore-mcp-server.git
cd musescore-mcp-server
# Install dependencies
npm install
# Configure the server (see Configuration section)
Configuration
Before running the server, you need to configure it by creating a config.json
file:
{
"musescorePath": "/path/to/musescore/executable",
"midiPortOutput": "MuseScore",
"midiPortInput": "MuseScore",
"defaultSoundFont": "/path/to/soundfont.sf2",
"tempDir": "/path/to/temp/directory"
}
musescorePath
: Path to MuseScore executable (required)midiPortOutput
: Name of the MIDI output port (default: "MuseScore")midiPortInput
: Name of the MIDI input port (default: "MuseScore")defaultSoundFont
: Path to default soundfont (optional)tempDir
: Path to temporary directory for file operations (optional)
Usage
Starting the Server
npm start
Connecting to Claude
To use this server with Claude:
- Install Claude Desktop
- Configure Claude to use this MCP server
- Enable the MCP tools in Claude's interface
API and Tools
This MCP server provides the following tools:
Score Management
create-score
: Create a new score with specified parametersopen-score
: Open an existing score filesave-score
: Save the current scoreexport-midi
: Export the current score as a MIDI fileexport-pdf
: Export the current score as a PDF file
MIDI Integration
send-midi-message
: Send a MIDI message to MuseScoreset-channel-volume
: Set the volume for a specific MIDI channelset-channel-expression
: Set the expression for a specific MIDI channelset-channel-program
: Set the program (instrument) for a specific MIDI channel
Score Editing
add-note
: Add a note to the scoreadd-rest
: Add a rest to the scoreadd-time-signature
: Add or change a time signatureadd-key-signature
: Add or change a key signatureadd-clef
: Add or change a clef
Playback Control
play-score
: Start playbackpause-score
: Pause playbackstop-score
: Stop playbackgo-to-position
: Navigate to a specific position in the score
Development
Project Structure
musescore-mcp-server/
├── src/
│ ├── index.ts # Entry point
│ ├── server.ts # MCP server implementation
│ ├── midi/ # MIDI-related functionality
│ ├── score/ # Score manipulation functionality
│ ├── utils/ # Utility functions
│ └── types/ # TypeScript type definitions
├── config.json # Server configuration
├── package.json # Project dependencies
└── tsconfig.json # TypeScript configuration
Building
npm run build
Limitations
- This server requires MuseScore to be installed on the same machine
- Some advanced score editing features may require additional setup
- Performance may vary depending on the complexity of scores
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- MuseScore team for their fantastic open-source notation software
- Anthropic for developing the Model Context Protocol
- Contributors to the MuseScore MIDI implementation