A Model Context Protocol (MCP) server for controlling [IGV]](https://github.com/igvteam/igv) programmatically through its port interface. This is an experimental project for demonstrating control of IGV-Webapp using MCP from a desktop client, specifically Claude Desktop.
- Node.js 18 or higher
- IGV running with port command listener enabled (default port: 60151)
To install the MCP server as a Claude Desktop extension select "Settings" -> "Extensions" -> "Advanced Settings" ->
"Install Extension" and select the igvweb.mcpb file from this repository root. Note that currently Claude Desktop
runs extensions in a non-sandboxed mode, so it will have full access to your system. Claude will warn you about this.
Clone this repository and install dependencies:
npm installTo run in development mode with the MCP inspector:
npx @modelcontextprotocol/inspector node src/main.jsTo build a production version:
npm run buildThis will build a bundled igv-mcp.js file in the dist folder, as well as a Claude 'mcpb' package in the root folder.
The easiest way to configure the client is to add the 'igvweb.mcpb' as an extension to Claude or your client of
choice. To manually configure a client add the following to the client configuration json. See the client documentation
for more details. The --port must match the port setting in IGV. IGV must be running with port listener enabled. To
enable the port listener in IGV, go to View -> Preferences -> Advanced -> and ensure the port option is checked.
{
"mcpServers": {
"igv": {
"command": "node",
"args": [
"<oath to>dist/igv-mcp.js",
"port",
"60151"
]
}
}
}For development, the dist/igv-mcp.js bundle can be replaced withsrc/main.js,
but dependencies must be installed.
Normally the server will be started by an MCP client, but you can also start it manually for testing or other purposes
# Default (connects to IGV at 127.0.0.1:60151)
npm start
# Specify custom IGV host/port
node src/main.js --host 127.0.0.1:60151
# Or with a different host
node src/main.js --host 192.168.1.100:60151The server provides 23 tools for controlling IGV.
new- Reset IGV to a clean state by unloading all data trackssaveSession- Save the current IGV session
genome- Load a reference genome by ID (e.g., hg38, mm10) or file pathload- Load data files (BAM, SAM, VCF, etc.)
goto- Navigate to a genomic locuszoomin- Zoom in the viewzoomout- Zoom out the view
collapse- Collapse track to compact representationsquish- Squish track by reducing row heightexpand- Expand track by increasing row heightsetColor- Set the primary display color for tracks
region- Define a region of interest
group- Group alignment reads by propertiessort- Sort reads by various criteriaviewAsPairs- Toggle paired-end read visualization mode
setSequenceStrand- Set which DNA strand to displaysetSequenceShowTranslation- Toggle translation display
overlay- Combine multiple wig tracks into a single overlaid trackseparate- Separate an overlaid wig track into component tracks
snapshot- Capture a snapshot image of the current IGV viewsnapshotDirectory- Set the directory where snapshots will be savedmaxPanelHeight- Set maximum height for track panels in snapshots