npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

music-theory-mcp

v1.0.0

Published

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.

Readme

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)

| Tool | Description | |------|-------------| | get_scale | Notes & intervals for 20+ scale types (major, minor, pentatonic, blues, dorian, etc.) | | get_chord | Notes for 22+ chord types (triads, 7ths, 9ths, sus, aug, dim, etc.) | | transpose_note | Shift a note by semitones | | get_interval | Interval between two notes |

Pro (requires CODEDSWITCH_API_KEY)

| Tool | Description | |------|-------------| | identify_chord | Name a chord from its notes | | detect_key | Detect the key from observed notes with confidence scores | | resolve_progression | Roman numerals → actual chords in any key | | suggest_next_chord | "What chord comes next?" with voice leading intelligence | | get_diatonic_chords | All 7 chords in any key | | get_genre_profile | Full genre intel: progressions, instruments, BPM, mood, swing | | suggest_genre | Match genre from BPM / key / mood / scale | | get_genre_rhythms | Drum patterns (kick/snare/hat step arrays) per genre | | transpose_progression | Shift 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

| | WebEar | Music Theory MCP | |---|--------|-----------------| | What | Captures & analyzes live audio | Reasons about music theory | | Analogy | Ears | Brain | | API keys | Required (CodedSwitch) | Free tier: none / Pro: CodedSwitch key | | Together | Hear 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