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 parameters
open-score
: Open an existing score file
save-score
: Save the current score
export-midi
: Export the current score as a MIDI file
export-pdf
: Export the current score as a PDF file
MIDI Integration
send-midi-message
: Send a MIDI message to MuseScore
set-channel-volume
: Set the volume for a specific MIDI channel
set-channel-expression
: Set the expression for a specific MIDI channel
set-channel-program
: Set the program (instrument) for a specific MIDI channel
Score Editing
add-note
: Add a note to the score
add-rest
: Add a rest to the score
add-time-signature
: Add or change a time signature
add-key-signature
: Add or change a key signature
add-clef
: Add or change a clef
Playback Control
play-score
: Start playback
pause-score
: Pause playback
stop-score
: Stop playback
go-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