Repository navigation
Conversation
…t player - Add _SharedCatalogue to reuse HTTP keep-alive, tokens, and ResponseCache - Add _PlayerPool for persistent Dealer WebSocket connection across player tools - Support compact=True on search and now_playing to cut payload size by 96% - Add --no-persistent-player flag to preserve one-shot per-command isolation
Owner
|
Thanks for the contribution! Could you fix the player connection-state check, tie pooled resources to the MCP lifespan, preserve all search categories in compact mode, add regression tests for pooling/reconnection/cleanup, and leave versioning and release dates unchanged? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Profiles and optimizes the SpotAPI FastMCP server to resolve latency bottlenecks and LLM token bloat:
_SharedCatalogue):Reuses TCP/TLS connections across tool calls rather than creating a new
Catalogue()on every tool call. Search network latency reduced by ~57% (1,461 ms → 621 ms).ResponseCache):Adds an LRU cache (256 items, 300s TTL) for catalogue resource lookups (
get_album,get_track, etc.). Cached retrieval drops from 1,255 ms to 4.5 ms (~280x faster)._PlayerPool):Maintains persistent WebSocket connections for player actions (
play,pause,next,volume) instead of reconnecting per call. Multi-action playback sequences speed up by ~10x (1,435 ms → 144 ms). Added--no-persistent-playerCLI flag for one-shot isolation.compact=True):Adds
compact=True(enabled by default insearchandnow_playing) to strip redundant Spotify internal structures, cutting search response payloads by 96.2% (44.6 KB → 1.6 KB, saving ~10,700 tokens per search).Testing