hydromel-project/reaper-apidocs-mcp
If you are the rightful owner of reaper-apidocs-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server providing access to the REAPER ReaScript API documentation, enabling AI assistants to interact with the API in real-time.
REAPER API Documentation MCP Server
A Model Context Protocol (MCP) server that provides access to the REAPER ReaScript API documentation. This server allows AI assistants like Claude to search, browse, and retrieve REAPER API function documentation in real-time.
Features
- Search Functions: Find REAPER API functions by keyword across names, descriptions, and signatures
- Get Function Details: Retrieve complete documentation for specific functions with signatures in all languages (C, EEL, Lua, Python)
- Browse by Prefix: List functions by category (e.g., all "Get" functions, all "Track" functions)
- API Statistics: Get overview statistics about the REAPER API
- MCP Resources: Access documentation via URI templates (e.g.,
reaper://function/GetTrack) - Smart Prompts: Pre-built prompts for script writing assistance and API exploration
Installation
# Clone or navigate to this repository
cd reaper-apidocs-mcp
# Install dependencies
npm install
# Build the server
npm run build
Usage
Running the Server
stdio Mode (for local use with Claude Desktop/Cursor):
npm start
HTTP/SSE Mode (for network access):
npm run start:http
# Server will run on http://localhost:3001
Connecting to Claude Desktop
Add to your Claude Desktop MCP configuration (~/Library/Application Support/Claude/claude_desktop_config.json on Mac or %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"reaper-api": {
"command": "node",
"args": [
"/path/to/reaper-apidocs-mcp/build/index.js"
]
}
}
}
Connecting to Cursor
Create or edit .cursor/mcp.json in your project:
{
"mcpServers": {
"reaper-api": {
"command": "node",
"args": [
"/path/to/reaper-apidocs-mcp/build/index.js"
]
}
}
}
Or use the SSE endpoint:
{
"mcpServers": {
"reaper-api": {
"url": "http://localhost:3001/sse"
}
}
}
Available Tools
reaper_get_function
Get detailed documentation for a specific REAPER API function.
Parameters:
function_name(string): Name of the function (e.g., "AddProjectMarker", "reaper.GetTrack")
Example:
reaper_get_function({ function_name: "GetTrack" })
reaper_search_functions
Search REAPER API functions by keyword.
Parameters:
query(string): Search query (e.g., "track", "marker", "midi")limit(number, optional): Max results (default: 20, max: 100)
Example:
reaper_search_functions({ query: "track", limit: 10 })
reaper_list_by_prefix
List all functions starting with a specific prefix.
Parameters:
prefix(string): Function name prefix (e.g., "Get", "Set", "Track")
Example:
reaper_list_by_prefix({ prefix: "Get" })
reaper_api_stats
Get statistics about the REAPER API documentation.
Parameters: None
Example:
reaper_api_stats({})
reaper_list_all_functions
Get a complete list of all REAPER API function names.
Parameters:
limit(number, optional): Max functions to return (default: 100)
Example:
reaper_list_all_functions({ limit: 50 })
Available Resources
reaper://function/{name}
Get function documentation as markdown.
Example: reaper://function/GetTrack
reaper://category/{prefix}
Browse functions by prefix.
Example: reaper://category/Get
reaper://overview
Get an overview of the REAPER API and this MCP server.
Example: reaper://overview
Available Prompts
reaper_script_helper
Get help writing a REAPER ReaScript.
Arguments:
task(required): Description of what you want the script to dolanguage(optional): Scripting language (lua, python, eel)
explore_reaper_api
Explore REAPER API functions for a specific domain.
Arguments:
domain(required): API domain (e.g., "tracks", "items", "midi", "fx")
Example Conversations
Example 1: Finding Track Functions
You: "What functions are available for working with tracks in REAPER?"
Claude (using MCP):
Let me search for track-related functions...
[Uses reaper_search_functions with query "track"]
Here are the main functions for working with tracks:
1. GetTrack - Get a track by index
2. GetSelectedTrack - Get a selected track
3. InsertTrackAtIndex - Insert a new track
4. DeleteTrack - Delete a track
5. SetTrackColor - Set track color
... [continues with more results]
Example 2: Writing a Script
You: "Help me write a Lua script to create a marker at the current cursor position"
Claude (using MCP):
Let me find the relevant functions...
[Uses reaper_search_functions with query "marker"]
[Uses reaper_get_function with "AddProjectMarker"]
Here's how to create a marker at the cursor position:
```lua
local proj = reaper.EnumProjects(-1, "")
local cursor_pos = reaper.GetCursorPosition()
local marker_idx = reaper.AddProjectMarker(proj, false, cursor_pos, 0, "My Marker", -1)
if marker_idx >= 0 then
reaper.ShowConsoleMsg("Marker created at index " .. marker_idx .. "\n")
else
reaper.ShowConsoleMsg("Failed to create marker\n")
end
... [explains the parameters]
## API Documentation Source
The server parses `docs/reaper_api.html` which contains the official REAPER ReaScript API documentation (v7.54 as of last update).
## Technical Details
- **Framework**: FastMCP
- **Language**: TypeScript
- **Transport**: stdio or SSE (HTTP)
- **Parsing**: Custom HTML parser for REAPER API documentation
- **Caching**: Functions are parsed once and cached in memory
## Development
```bash
# Install dependencies
npm install
# Run in development mode with auto-reload
npm run dev # stdio mode
npm run dev:http # HTTP mode
# Build for production
npm run build
npm run build:http
# Test with MCP Inspector
npx fastmcp inspect src/index.ts
Project Structure
src/
├── core/
│ ├── services/
│ │ ├── reaper-api-parser.ts # HTML parsing and API data
│ │ └── index.ts
│ ├── tools.ts # MCP tool definitions
│ ├── resources.ts # MCP resource definitions
│ └── prompts.ts # MCP prompt definitions
├── server/
│ ├── server.ts # FastMCP server setup
│ ├── http-server.ts # SSE/HTTP entry point
│ └── index.ts # stdio entry point (not used)
├── index.ts # Main stdio entry point
docs/
└── reaper_api.html # REAPER API documentation source
Troubleshooting
"Failed to load REAPER API documentation"
Ensure docs/reaper_api.html exists in the project directory. The server expects this file at {cwd}/docs/reaper_api.html.
Server not connecting
- For stdio mode: Check that the path in your MCP configuration points to the correct
build/index.jsfile - For SSE mode: Ensure port 3001 is not in use, or change with
PORT=8080 npm run start:http
No functions found
The parser expects the HTML structure from the official REAPER API documentation. If you've updated the HTML file, ensure it maintains the expected structure with <div class="function_definition"> blocks.
License
MIT