Skip to main content
Glama
navigravity

navigravity

by miziodel

NaviGravity (Navidrome Agentic Curator) 🎧

License: MIT Python 3.10+ MCP Status: Preview

NaviGravity (NG) is an intelligent MCP (Model Context Protocol) server that empowers an AI agent to act as a sophisticated music curator for your self-hosted Navidrome library.

Unlike simple search tools, NG implements a specific curation philosophy focused on quality, discovery, and non-destructive library management.

🧠 Core Philosophy

  1. The "Bliss" Quality Gate: The AI acts as a critic. No playlist is created without passing a assess_playlist_quality check to ensure diversity and prevent artist repetition.

  2. Virtual Tags (Non-Invasive): We treat your audio files as sacred read-only artifacts. Moods and custom tags are stored as "System Playlists" (e.g., System:Mood:Focus), keeping your file metadata clean.

  3. Smart Discovery: Features "Magic List" algorithms to surface Forgotten Gems, Hidden Tracks, and divergent genres to break your filter bubble.

Related MCP server: Discogs MCP Server

🤖 For Agents & Curators

We provide a specialized guide for the Large Language Models interacting with this toolset. It defines the "Curator Persona", "Bliss Quality Gate" protocols, and strategic patterns (e.g., The Time Machine or Semantic Exploration).

👉 Read the LLM Tool Usage Manifesto

Setup & Installation

Prerequisites:

  • Python 3.10+

  • A running Navidrome server and user account

  1. Clone the repository:

    git clone <repository_url>
    cd navigravity
  2. Create and activate a Python virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
  3. Install dependencies:

    pip install .
  4. Configuration: Copy .env.example to .env (create one if needed) and set your Navidrome credentials:

    NAVIDROME_URL=http://your-navidrome-instance:4533
    NAVIDROME_USER=your_username
    NAVIDROME_PASS=your_password

    Logging Configuration (Optional): By default, logs are output to stderr (visible in MCP Client logs). To save logs to a file:

    NAVIDROME_LOG_FILE=./logs/navidrome_mcp.log

🚀 Usage

Important: This is an MCP server. It runs strictly as a backend process for an AI Client (like Antigravity, Claude Desktop or Zed). You do NOT need to "visit" it in a browser.

For a deep dive into how strict coordination works without a UI, see MCP Architecture & Workflow.

Add the following to your client's configuration (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "navidrome": {
      "command": "/path/to/navigravity/.venv/bin/python",
      "args": ["/path/to/navigravity/src/navidrome_mcp_server.py"]
    }
  }
}

🛠 Troubleshooting & Local Debugging

If you encounter ModuleNotFoundError or errors spawning the process, ensure you are pointing to the Python executable inside your virtual environment.

To test the server manually and explore tools with a UI, use the MCP Inspector:

# From the project root
npx @modelcontextprotocol/inspector .venv/bin/python src/navidrome_mcp_server.py

This will open a browser interface at http://localhost:6274 allowing you to interact with all tools.

🧰 Available Tools

The agent has access to the following tools:

  • Unified Analysis:

    • analyze_library(mode): One tool to rule them all.

      • mode='composition': Genre distribution & library stats (Cold Analysis).

      • mode='pillars': Identifies canonical artists by album count.

      • mode='taste_profile': Analyzes recent/frequent/starred for user habits.

    • batch_check_library_presence: Verification tool to find gaps (Missing Music) in bulk.

  • Discovery & Recommendation:

    • get_smart_candidates(mode): Statistical discovery engine.

      • Smart Selection: Automatically ranks candidates by smart_score (Neutral=3, Stars=+1, Heart=+5).

      • Modes: rediscover, hidden_gems, unheard_favorites, lowest_rated, divergent (breaks filter bubble).

    • get_similar_artists: Finds relational bridges. Automatically falls back to "Genre Peers" if canonical data is missing.

    • get_similar_songs: "Radio Mode" for finding sonically resonant tracks.

    • get_genres / explore_genre: Deep dive into specific genres.

    • get_genre_tracks: Fetches random tracks from a genre.

    • search_music_enriched(query, artist?, album?): Robust metadata-rich search with multi-strategy fallback. Resolves compound queries (e.g., "Daft Punk Discovery", "Miles Davis Bitches Brew") via album expansion, unicode normalization, and client-side post-filtering. Optional artist and album parameters for precise filtering.

  • Curation & Management:

    • manage_playlist(name, operation, track_ids):

      • Create/Replace customized playlists.

      • Mood Convention: Use NG:Mood:{MoodName} (e.g., NG:Mood:Focus) to create virtual mood tags.

    • assess_playlist_quality: The "Bliss" check logic. Includes automatic ID Sanitization (stripping quotes/backticks).


📜 License & Contributing

This project is open-source under the MIT License.

Want to help? Check out CONTRIBUTING.md for our Beta Testing Guide, Developer Instructions, and Social Contract.

NOTE

This project depends on libraries likepy-sonic which are licensed under GPLv3. While our code is MIT, bundling it with GPL dependencies may affect the licensing of distributed binaries.


Built with ❤️ for the self-hosted music community.

Available Tools

15 tools
analyze_libraryA

Analyzes the library inventory and user stats.

Args: mode: The type of analysis to perform. - 'composition': Returns genre distribution and total stats (Cold Analysis). - 'pillars': Identifies core artists (Album Count) (Canonical Analysis). - 'taste_profile': Analyzes recent/frequent/starred for top artists & eras (Warm Analysis).

Inputs: mode. Returns: result

assess_playlist_qualityC

(Bliss) Checks diversity and repetition.

Inputs: song_ids (required). Returns: result

batch_check_library_presenceB

Checks if artists/albums exist in the library. Input example: [{"artist": "Camel"}, {"artist": "Pink Floyd", "album": "Animals"}]

Inputs: query (required). Returns: result

check_connectionA

Verifies connection to the backend Navidrome instance.

Inputs: no named parameters. Returns: result

explore_genreC

Gets detailed metrics for a genre (Top Artists, Album counts).

Inputs: genre (required), limit. Returns: result

get_genresA

Lists all available genres with track and album counts.

Inputs: no named parameters. Returns: result

get_genre_tracksC

Fetches random tracks for specific genre(s). Accepts a single string or a list of strings.

Inputs: genre (required), limit. Returns: result

get_similar_artistsA

Gets similar artists. Provide artist_id OR artist_name (name will be resolved to ID first). Uses getArtistInfo2 as a reliable fallback for library similarity.

Inputs: limit, artist_id, artist_name. Returns: result

get_similar_songsC

Gets similar songs to the target song (Radio Mode).

Inputs: song_id (required), limit. Returns: result

get_smart_candidatesA

Generates lists based on stats with advanced filtering.

Args: mode: recently_added, most_played, top_rated, lowest_rated, rediscover, rediscover_deep, hidden_gems, unheard_favorites, divergent, fallen_pillars, similar_to_starred. Accepts comma-separated list of modes. limit: Max tracks to return (default 50) include_genres: List of genres to strictly include (case-insensitive partial match) exclude_genres: List of genres to exclude min_bpm: Minimum BPM max_bpm: Maximum BPM mood: 'relax', 'energy', 'focus', etc. max_tracks_per_artist: Diversity constraint reference_track_ids: List of source track IDs to use as seeds (Similarity expansion)

Inputs: mode (required), mood, limit, max_bpm, +5 more. Returns: result

list_playlistsA

Lists all available playlists with IDs for discoverability.

Inputs: no named parameters. Returns: result

manage_playlistA

Manages playlists and moods.

Args: name: Playlist name. For moods, use convention 'NG:Mood:{MoodName}'. operation: - 'create': Replaces/Creates playlist with track_ids. - 'append': Adds track_ids to playlist (creates if missing). - 'get': Returns tracks in playlist. track_ids: List of track IDs (required for create/append).

Inputs: name (required), operation, track_ids. Returns: result

search_by_tagC

Multi-genre intersection/union for 'vibe' search.

Inputs: tags (required), logic. Returns: result

search_music_enrichedA

Robust search with multi-strategy fallback. Returns enriched track metadata.

WHEN to use optional parameters:

  • artist: provide when you know the artist name (e.g., artist='Miles Davis'). Results are post-filtered so only tracks from this artist are returned.

  • album: provide when you know the album name (e.g., album='Bitches Brew'). Results are post-filtered on the song's album field — NOT the track title.

Search strategy (cascading, stops at first successful step):

  1. search3(query, songCount=limit*3, albumCount=2) → if songs found: post-filter by artist/album, return. → if only albums found: expand each album into tracks (max 2), post-filter, return.

  2. [only if artist provided] search3(artist) → post-filter by album.

  3. [only if album provided] search3(album, albumCount=5) → expand albums → return tracks.

  4. Unicode normalization fallback: retry step 1 with NFKD-normalized query (only if normalized query differs from original).

  5. Raw fallback: return step-1 results as-is (never returns empty if tracks exist).

Inputs: query (required), album, limit, artist. Returns: result

validate_playlist_rulesC

Dry-run validation for diversity and mood. Example rules: {"max_tracks_per_artist": 2, "exclude_genres": ["Metal"], "min_bpm": 100}

Inputs: rules (required), track_ids (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 15 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose, ranging from library analysis and playlist management to similarity and search. No two tools overlap significantly; even similar sounding tools like search_by_tag and search_music_enriched serve different search strategies.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case, such as analyze_library, get_similar_artists, and manage_playlist. The verbs are descriptive and align with the actions, making the set predictable.

    Tool Count5/5

    With 15 tools, the set is well-scoped for a music library assistant, covering analysis, search, playlist management, and similarity. The count is sufficient without being overwhelming.

    Completeness4/5

    The tool surface covers core operations like library analysis, playlist CRUD, search, and similarity. Minor gaps exist, such as missing explicit delete for playlists or detailed artist/album retrieval, but these are not critical for the intended curation use case.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Search, rate and organise your Discogs collection, wantlist and folders from an AI assistant. Self-hosted: deploy your own copy to Cloudflare Workers with the Deploy to Cloudflare button in the README. Not affiliated with Discogs.
      20
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides intelligent playlist curation tools using Spotify track data and audio feature analysis. It enables AI assistants to create mood-based playlists, find similar songs, analyze audio characteristics, and curate personalized music collections.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      AI-native MCP server for Qobuz that enables searching, browsing, and managing your music library, including favorites, playlists, and current playback.
      13 npm
      MIT