guitar-pro-mcp
A Message Control Protocol (MCP) server for manipulating Guitar Pro files. It provides tools for opening, modifying, and saving Guitar Pro files through a standardized interface.
README
Guitar Pro MCP Server
A Message Control Protocol (MCP) server for manipulating Guitar Pro files. This server provides a set of tools for opening, modifying, and saving Guitar Pro files through a standardized interface.
Note: Currently, only Guitar Pro 5 (.gp5) format has been tested. Support for other formats (.gp3, .gp4) may be limited or untested.
Features
- Load and save Guitar Pro files
- Get song information (title, artist, tracks, etc.)
- Extract notes from tracks
- Create new songs and add tracks
- Manipulate track properties
- Export to MIDI format
- Export/Import to/from JSON format
Requirements
- Python 3.10 or higher
- PyGuitarPro library
- MCP server framework
- MIDI support (mido library)
- uv (recommended for package management)
Installation
Using uv (Recommended)
- Install uv if you haven't already:
pip install uv
- Create and activate a virtual environment:
# Create virtual environment
uv venv
# Activate virtual environment
# On Unix/macOS:
source .venv/bin/activate
# On Windows(cmd):
call .venv\Scripts\activate.bat
- Install the package:
uv pip install .
Running the Server
You can run the server using uv directly:
uv --directory <project_path> run -m src.run_mcp_server
For example, on Windows:
uv --directory C:\path\to\guitar_pro_mcp2 run -m src.run_mcp_server
Or using the Python module directly after installation:
python -m src.run_mcp_server
Using pip
pip install guitar-pro-mcp
From source
- Clone the repository:
git clone https://github.com/yourusername/guitar-pro-mcp.git
cd guitar-pro-mcp
- Install the package:
# Install in development mode with all dependencies
pip install -e ".[dev]"
# Or install without development dependencies
pip install -e .
- Connect to the server using an MCP client.
Usage(Direct)
- Start the MCP server:
python src/run_mcp_server.py
- Connect to the server using an MCP client.
Available MCP Tools
File Operations
-
load_guitar_pro: Load a Guitar Pro file- Parameters:
file_path(path to the .gp5 file) - Returns: Success/error message
- Parameters:
-
save_guitar_pro: Save the current song to a Guitar Pro file- Parameters:
file_path(path to save the file) - Returns: Success/error message
- Parameters:
Song Information
-
get_song_info: Get basic information about the currently loaded song- Returns: Dictionary containing title, artist, album, copyright, subtitle, notice, and track count
-
get_song_statistics: Get detailed statistics about the current song- Returns: Dictionary containing track counts, measure counts, note counts, and detailed track information
Track Operations
-
get_gp_tracks: Get a list of tracks in the current Guitar Pro song- Returns: List of tracks with their name, index, strings, and instrument
-
get_track_notes: Get all notes from a specific track- Parameters:
track_index(index of the track) - Returns: List of notes with their properties (measure, beat, string, value, etc.)
- Parameters:
-
add_gp_track: Add a new track to the Guitar Pro song- Parameters:
name(name of the track) - Returns: Success message and track index
- Parameters:
-
set_track_properties: Set properties of a track- Parameters:
track_index: Index of the trackname: New track name (optional)instrument: Instrument ID (optional)volume: Volume level (optional)pan: Pan position (optional)
- Returns: Success/error message
- Parameters:
Measure Operations
-
add_gp_measure: Add a new measure to the Guitar Pro song- Returns: Success message and measure index
-
set_gp_time_signature: Set the time signature for a measure- Parameters:
measure_index,numerator,denominator - Returns: Success/error message
- Parameters:
-
set_gp_key_signature: Set the key signature for a measure- Parameters:
measure_index,key - Returns: Success/error message
- Parameters:
-
set_gp_tempo: Set the tempo for a measure- Parameters:
measure_index,tempo - Returns: Success/error message
- Parameters:
Note Operations
add_gp_note: Add a note to a specific track and measure- Parameters:
track_index: Index of the trackmeasure_index: Index of the measurestring: String numberfret: Fret numberduration: Note duration (default: 4)voice_index: Voice index (default: 0)beat_index: Beat index (default: 0)
- Returns: Success/error message
- Parameters:
Export/Import Operations
-
export_to_midi: Export the current song to MIDI format- Parameters:
file_path - Returns: Success/error message
- Parameters:
-
export_to_json: Export the current song to JSON format- Parameters:
file_path - Returns: Success/error message
- Parameters:
-
import_from_json: Import a song from JSON format- Parameters:
file_path - Returns: Success/error message
- Parameters:
Tab Operations
get_track_tab: Generate ASCII tab representation of a track- Parameters:
track_index - Returns: ASCII tab representation as string
- Parameters:
Song Structure Management
-
add_repeat_group: Add a repeat group to the song- Parameters:
start_measure: Starting measure indexend_measure: Ending measure indexrepeat_type: Type of repeat ("normal", "alternate", "repeat_1st", "repeat_2nd")repeat_count: Number of times to repeat (default: 2)endings: List of ending numbers (optional)
- Returns: Success/error message
- Parameters:
-
get_repeat_groups: Get all repeat groups in the song- Returns: List of repeat group objects with their properties
-
add_section: Add a section to the song- Parameters:
start_measure: Starting measure indexend_measure: Ending measure indexname: Section nametext: Optional section textcolor: Optional section color as RGB tuple
- Returns: Success/error message
- Parameters:
-
get_sections: Get all sections in the song- Returns: List of section objects with their properties
-
add_coda: Add a coda marker to a measure- Parameters:
measure_index - Returns: Success/error message
- Parameters:
-
add_double_bar: Add a double bar line to a measure- Parameters:
measure_index - Returns: Success/error message
- Parameters:
-
get_song_structure: Get the complete song structure- Returns: Dictionary containing:
sections: List of all sectionsrepeat_groups: List of all repeat groupsmarkers: List of all markers (codas, double bars, etc.)
- Returns: Dictionary containing:
Metadata and Lyrics
-
set_lyrics: Set the lyrics for the current song- Parameters:
lyrics(string containing the lyrics) - Returns: Success/error message
- Parameters:
-
get_lyrics: Get the lyrics of the current song- Returns: The lyrics as a string
-
set_page_setup: Set the page setup for the current song- Parameters:
page_setup(dictionary containing page setup properties) - Properties include: pageSize, pageMargin, scoreSizeProportion, headerAndFooter, title, subtitle, artist, album, words, music, wordsAndMusic, copyright, pageNumber
- Returns: Success/error message
- Parameters:
-
get_page_setup: Get the page setup of the current song- Returns: Dictionary containing page setup properties
-
set_advanced_metadata: Set advanced metadata for the current song- Parameters:
metadata(dictionary containing metadata properties) - Properties include: subtitle, words, music, tab, instructions, notice
- Returns: Success/error message
- Parameters:
-
get_advanced_metadata: Get advanced metadata of the current song- Returns: Dictionary containing metadata properties
Chord Operations
-
add_chord: Add a chord to a specific beat- Parameters:
track_index: Index of the trackmeasure_index: Index of the measurebeat_index: Index of the beatchord_data: Dictionary containing chord properties
- Chord properties include: name, root, type, extension, bass, tonality, fifth, ninth, eleventh, firstFret, strings, barres, fingerings
- Returns: Success/error message
- Parameters:
-
get_chord: Get the chord from a specific beat- Parameters:
track_index: Index of the trackmeasure_index: Index of the measurebeat_index: Index of the beat
- Returns: Dictionary containing chord properties
- Parameters:
Claude configuration (with uv run):
{
"mcpServers": {
"guitar-pro-mcp": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"<path to folder>",
"run",
"-m",
"src.run_mcp_server"
]
}
}
}
Claude configuration (direct usage):
{
"mcpServers": {
"guitar-pro-mcp": {
"type": "stdio",
"command": "python",
"args": [
"<path to folder>\\src\\run_mcp_server.py"
]
}
}
}
Claude configuration (with uv run):
{
"mcpServers": {
"guitar-pro-mcp": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"<path to folder>",
"run",
"-m",
"src.run_mcp_server"
]
}
}
}
Implementation Details
The implementation uses the PyGuitarPro library to parse and manipulate Guitar Pro files. The MCP server provides a simple API to access the functionality of the PyGuitarPro library.
License
This project is licensed under the MIT License.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。