🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

music-theory-mcp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

music-theory-mcp

Give your AI coding assistant musical knowledge — scales, chords, progressions, key detection, genre-aware composition intelligence, and rhythm patterns. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible IDE.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Music Theory MCP 🎵

Give your AI coding assistant musical knowledge.

Scales, chords, progressions, key detection, genre-aware composition intelligence, and rhythm patterns.

4 free tools work instantly. 9 pro tools unlock with a free CODEDSWITCH_API_KEY (50 calls/day). Unlimited plans at codedswitch.com/pricing.

Works with Claude Code, Cursor, Windsurf, and any MCP-compatible IDE.

Companion to WebEar — WebEar gives your AI ears, Music Theory MCP gives it a brain for music.

13 Tools

Free (no key needed)

ToolDescription
get_scaleNotes & intervals for 20+ scale types (major, minor, pentatonic, blues, dorian, etc.)
get_chordNotes for 22+ chord types (triads, 7ths, 9ths, sus, aug, dim, etc.)
transpose_noteShift a note by semitones
get_intervalInterval between two notes

Pro (requires CODEDSWITCH_API_KEY)

ToolDescription
identify_chordName a chord from its notes
detect_keyDetect the key from observed notes with confidence scores
resolve_progressionRoman numerals → actual chords in any key
suggest_next_chord"What chord comes next?" with voice leading intelligence
get_diatonic_chordsAll 7 chords in any key
get_genre_profileFull genre intel: progressions, instruments, BPM, mood, swing
suggest_genreMatch genre from BPM / key / mood / scale
get_genre_rhythmsDrum patterns (kick/snare/hat step arrays) per genre
transpose_progressionShift an entire chord progression

Get a free key at codedswitch.com/developer — 50 pro calls/day included.

11 Genres

Trap · Boom Bap · Drill · Lo-Fi Hip Hop · R&B · Pop · Afrobeats · Reggaeton · Jazz · EDM · Gospel

Each genre includes: chord progressions, recommended scales, BPM range, instruments, rhythmic feel, swing amount, common keys, and mood descriptors.

Quick Start

Option 1: npx (no install)

npx music-theory-mcp

Option 2: Global install

npm install -g music-theory-mcp

IDE Configuration

Claude Code

Add to .mcp.json:

{
  "mcpServers": {
    "music-theory": {
      "command": "npx",
      "args": ["music-theory-mcp"],
      "env": { "CODEDSWITCH_API_KEY": "csk_your_key_here" }
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "music-theory": {
      "command": "npx",
      "args": ["music-theory-mcp"],
      "env": { "CODEDSWITCH_API_KEY": "csk_your_key_here" }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "music-theory": {
      "command": "npx",
      "args": ["music-theory-mcp"],
      "env": { "CODEDSWITCH_API_KEY": "csk_your_key_here" }
    }
  }
}

Omit the env block to use free tools only.

Example Usage

Once configured, your AI assistant can use the tools naturally:

"What chords are in the key of F minor?"

→ get_diatonic_chords({ key: "F", mode: "minor" })
→ Fm, Gdim, Ab, Bbm, Cm, Db, Eb

"Give me a trap beat in C minor"

→ get_genre_profile({ genre: "trap" })
→ Progressions: i-iv-VI-v, scales: minor/phrygian, BPM: 130-170
→ get_genre_rhythms({ genre: "trap" })
→ Kick/snare/hat patterns ready for a sequencer

"What key is this melody in? C, D, E, F#, G, A, B"

→ detect_key({ notes: ["C", "D", "E", "F#", "G", "A", "B"] })
→ G major (100% confidence)

"I'm on a V chord in Bb major, what should come next?"

→ suggest_next_chord({ current_numeral: "V", key: "Bb", mode: "major" })
→ I (Bb), vi (Gm), IV (Eb) — ranked by voice leading tendency

Use Cases

  • AI music apps — give your AI composer harmonic intelligence
  • Beat makers & DAWs — auto-suggest progressions, detect keys, genre-match rhythms
  • Music education — interactive scale/chord/theory lookup
  • Songwriting tools — intelligent chord suggestions and key detection
  • MIDI processors — transpose, identify, and analyze musical content
  • Any AI agent — add musical reasoning to any MCP-compatible agent

Pairs With WebEar

WebEarMusic Theory MCP
WhatCaptures & analyzes live audioReasons about music theory
AnalogyEarsBrain
API keysRequired (CodedSwitch)Free tier: none / Pro: CodedSwitch key
TogetherHear what's playing → analyze if it's harmonically correct → suggest fixes

Built by CodedSwitch

Part of the CodedSwitch Studio ecosystem — AI-powered music creation.

License

MIT

Keywords

mcp

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts