plex-mcp 0.0.1 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,9 +30,58 @@ A Model Context Protocol (MCP) server for searching Plex media libraries using C
30
30
  - Click "Show" next to "Plex Pass Subscription"
31
31
  - Your token will be displayed
32
32
 
33
+ ## Claude Desktop Configuration
34
+
35
+ ### Option 1: Using npx (Recommended)
36
+
37
+ Add this configuration to your Claude Desktop settings:
38
+
39
+ ```json
40
+ {
41
+ "mcpServers": {
42
+ "plex": {
43
+ "command": "npx",
44
+ "args": ["plex-mcp"],
45
+ "env": {
46
+ "PLEX_URL": "http://your-plex-server:32400",
47
+ "PLEX_TOKEN": "your_plex_token"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ### Option 2: Local development
55
+
56
+ For local development, add this configuration:
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "plex": {
62
+ "command": "node",
63
+ "args": ["/path/to/your/plex-mcp/index.js"],
64
+ "env": {
65
+ "PLEX_URL": "http://your-plex-server:32400",
66
+ "PLEX_TOKEN": "your_plex_token"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ Replace `/path/to/your/plex-mcp/` with the actual path to this project directory.
74
+
75
+ **Configuration Steps:**
76
+ 1. Open Claude Desktop settings (Cmd/Ctrl + ,)
77
+ 2. Navigate to the "MCP Servers" tab
78
+ 3. Add the configuration above
79
+ 4. Update `PLEX_URL` and `PLEX_TOKEN` with your Plex server details
80
+ 5. Restart Claude Desktop
81
+
33
82
  ## Usage
34
83
 
35
- Run the MCP server:
84
+ Run the MCP server standalone:
36
85
  ```bash
37
86
  node index.js
38
87
  ```
package/TODO.md ADDED
@@ -0,0 +1,252 @@
1
+ # Plex MCP Server - TODO List
2
+
3
+ ## Unimplemented Plex API Features
4
+
5
+ ### Critical Missing APIs (High Priority)
6
+
7
+ #### Session Management
8
+ - [ ] **get_active_sessions** - List current "Now Playing" sessions
9
+ - Endpoint: `/status/sessions`
10
+ - Returns: Active playback sessions with user, client, media info
11
+ - [ ] **get_transcode_sessions** - List active transcoding operations
12
+ - Endpoint: `/transcode/sessions`
13
+ - Returns: Transcoding progress, quality settings, resource usage
14
+ - [ ] **terminate_session** - Stop/kill active playback sessions
15
+ - Endpoint: `/status/sessions/terminate`
16
+ - Action: Force stop sessions by session ID
17
+
18
+ #### Playback Control
19
+ - [ ] **control_playback** - Control playback (play/pause/stop/seek)
20
+ - Endpoint: `/player/playback/{command}`
21
+ - Commands: play, pause, stop, stepForward, stepBack, seekTo
22
+ - [ ] **start_playback** - Initiate playback on specific clients
23
+ - Endpoint: `/player/playback/playMedia`
24
+ - Parameters: media key, client ID, resume offset
25
+ - [ ] **remote_control** - Advanced remote control operations
26
+ - Endpoint: `/player/navigation/{command}`
27
+ - Commands: moveUp, moveDown, select, back, home
28
+
29
+ #### Client & Device Management
30
+ - [ ] **get_clients** - List available Plex clients/players
31
+ - Endpoint: `/clients`
32
+ - Returns: Client names, IDs, capabilities, online status
33
+ - [ ] **get_devices** - List all registered devices
34
+ - Endpoint: `/devices`
35
+ - Returns: Device info, last seen, platform details
36
+ - [ ] **get_servers** - List available Plex servers
37
+ - Endpoint: `/servers`
38
+ - Returns: Server list for multi-server setups
39
+
40
+ ### Server Administration (Medium Priority)
41
+
42
+ #### Server Info & Management
43
+ - [ ] **get_server_info** - Server capabilities and status
44
+ - Endpoint: `/`
45
+ - Returns: Version, capabilities, transcoder info, platform
46
+ - [ ] **get_server_preferences** - Server configuration settings
47
+ - Endpoint: `/:/prefs`
48
+ - Returns: All server preferences and settings
49
+ - [ ] **scan_library** - Trigger library content scan
50
+ - Endpoint: `/library/sections/{id}/refresh`
51
+ - Action: Force library scan for new content
52
+ - [ ] **refresh_metadata** - Force metadata refresh for items
53
+ - Endpoint: `/library/metadata/{id}/refresh`
54
+ - Action: Re-download metadata, artwork, etc.
55
+
56
+ #### User Management
57
+ - [ ] **get_users** - List server users and accounts
58
+ - Endpoint: `/accounts`
59
+ - Returns: User list, permissions, sharing status
60
+ - [ ] **get_user_activity** - User-specific activity logs
61
+ - Endpoint: `/status/sessions/history/all?accountID={id}`
62
+ - Returns: Per-user watch history and statistics
63
+
64
+ ### Content Discovery & Recommendations (Medium Priority)
65
+
66
+ #### Advanced Discovery
67
+ - [ ] **get_content_hubs** - Plex's recommendation engine
68
+ - Endpoint: `/hubs`
69
+ - Returns: Curated content recommendations, trending
70
+ - [ ] **get_discover_content** - Discover new content across libraries
71
+ - Endpoint: `/library/sections/all?discover=1`
72
+ - Returns: Cross-library content discovery
73
+ - [ ] **get_trending** - Trending content on Plex platform
74
+ - Endpoint: `/hubs/trending`
75
+ - Returns: Popular content across Plex network
76
+
77
+ #### Metadata Enhancement
78
+ - [ ] **get_genres** - Available genres across libraries
79
+ - Endpoint: `/library/sections/{id}/genre`
80
+ - Returns: Genre list with item counts
81
+ - [ ] **get_years** - Available years across libraries
82
+ - Endpoint: `/library/sections/{id}/year`
83
+ - Returns: Year list with item counts
84
+ - [ ] **get_studios** - Available studios/networks
85
+ - Endpoint: `/library/sections/{id}/studio`
86
+ - Returns: Studio/network list with item counts
87
+ - [ ] **get_directors** - Available directors/actors
88
+ - Endpoint: `/library/sections/{id}/director`
89
+ - Returns: People list with filmography counts
90
+
91
+ ### Media Management (Medium Priority)
92
+
93
+ #### Watch Status Management
94
+ - [ ] **mark_watched** - Mark items as watched
95
+ - Endpoint: `/:/scrobble?key={id}&identifier=com.plexapp.plugins.library`
96
+ - Action: Set watch status, update play count
97
+ - [ ] **mark_unwatched** - Mark items as unwatched
98
+ - Endpoint: `/:/unscrobble?key={id}&identifier=com.plexapp.plugins.library`
99
+ - Action: Remove watch status, reset play count
100
+ - [ ] **set_rating** - Rate content (stars/thumbs)
101
+ - Endpoint: `/:/rate?key={id}&rating={rating}&identifier=com.plexapp.plugins.library`
102
+ - Action: Set user rating for content
103
+
104
+ #### Library Maintenance
105
+ - [ ] **optimize_library** - Database optimization operations
106
+ - Endpoint: `/library/optimize`
107
+ - Action: Clean up database, optimize indexes
108
+ - [ ] **empty_trash** - Empty library trash/deleted items
109
+ - Endpoint: `/library/sections/{id}/emptyTrash`
110
+ - Action: Permanently delete trashed items
111
+ - [ ] **update_library** - Update library metadata
112
+ - Endpoint: `/library/sections/{id}/update`
113
+ - Action: Update library without full scan
114
+
115
+ ### Advanced Features (Low Priority)
116
+
117
+ #### Transcoding Management
118
+ - [ ] **get_transcoding_settings** - Transcoding preferences
119
+ - Endpoint: `/:/prefs?group=transcoder`
120
+ - Returns: Quality settings, codec preferences
121
+ - [ ] **optimize_content** - Content optimization for devices
122
+ - Endpoint: `/library/metadata/{id}/optimize`
123
+ - Action: Pre-transcode content for specific devices
124
+
125
+ #### Sync & Download
126
+ - [ ] **get_sync_items** - Sync queue and downloaded items
127
+ - Endpoint: `/sync/items`
128
+ - Returns: Sync status, download queue
129
+ - [ ] **download_media** - Download content for offline viewing
130
+ - Endpoint: `/sync/items`
131
+ - Action: Queue content for download/sync
132
+
133
+ #### Webhooks & Events
134
+ - [ ] **get_webhooks** - List configured webhooks
135
+ - Endpoint: `/:/webhooks`
136
+ - Returns: Webhook URLs and trigger events
137
+ - [ ] **listen_events** - Real-time event streaming
138
+ - Endpoint: `/:/events` (WebSocket/SSE)
139
+ - Returns: Live server events, playback updates
140
+
141
+ ## Missing Test Coverage
142
+
143
+ ### Unit Tests
144
+ - [ ] **Session management handlers** - Tests for new session control APIs
145
+ - [ ] **Playback control handlers** - Tests for media control functionality
146
+ - [ ] **Client management handlers** - Tests for device/client discovery
147
+ - [ ] **Server admin handlers** - Tests for administrative functions
148
+ - [ ] **User management handlers** - Tests for multi-user functionality
149
+ - [ ] **Content discovery handlers** - Tests for recommendation features
150
+ - [ ] **Watch status handlers** - Tests for marking watched/unwatched
151
+ - [ ] **Library management handlers** - Tests for scan/refresh operations
152
+
153
+ ### Integration Tests
154
+ - [ ] **Multi-library operations** - Cross-library search and discovery
155
+ - [ ] **Playlist management with new content** - Advanced playlist operations
156
+ - [ ] **User permission scenarios** - Multi-user access control
157
+ - [ ] **Server configuration changes** - Settings modification testing
158
+ - [ ] **Transcoding workflow** - End-to-end transcoding scenarios
159
+ - [ ] **Sync/download workflows** - Offline content management
160
+
161
+ ### Mock Data Enhancement
162
+ - [ ] **Session data mocks** - Active session responses
163
+ - [ ] **Client data mocks** - Available client/device responses
164
+ - [ ] **Server info mocks** - Server capabilities and status
165
+ - [ ] **User data mocks** - Multi-user account responses
166
+ - [ ] **Transcoding mocks** - Transcoding session responses
167
+ - [ ] **Webhook mocks** - Event and webhook responses
168
+
169
+ ## E2E Tests to Add
170
+
171
+ ### Real Server Integration
172
+ - [ ] **Live session monitoring** - Connect to real server, monitor active sessions
173
+ - Test with actual playback sessions
174
+ - Verify session data accuracy
175
+ - Test session termination
176
+ - [ ] **Live playback control** - Control actual Plex clients
177
+ - Test play/pause/stop commands
178
+ - Test seek functionality
179
+ - Test client discovery and selection
180
+ - [ ] **Live library management** - Real library operations
181
+ - Test library scanning
182
+ - Test metadata refresh
183
+ - Test library optimization
184
+ - [ ] **Live user scenarios** - Multi-user testing
185
+ - Test shared library access
186
+ - Test user-specific history
187
+ - Test permission boundaries
188
+
189
+ ### Cross-Platform Testing
190
+ - [ ] **Multiple client types** - Test with various Plex clients
191
+ - Desktop app, mobile app, web player
192
+ - Smart TV apps, streaming devices
193
+ - Verify control compatibility
194
+ - [ ] **Multiple server versions** - Test against different Plex server versions
195
+ - Latest stable, previous versions
196
+ - PlexPass vs free features
197
+ - API compatibility testing
198
+
199
+ ### Network Scenarios
200
+ - [ ] **SSL/TLS configurations** - Various security setups
201
+ - Self-signed certificates
202
+ - Valid SSL certificates
203
+ - Mixed HTTP/HTTPS environments
204
+ - [ ] **Remote access testing** - Plex relay and direct connections
205
+ - Remote server access via Plex.tv
206
+ - Direct IP connections
207
+ - VPN/tunnel scenarios
208
+ - [ ] **Performance testing** - Large library scenarios
209
+ - Libraries with 10k+ items
210
+ - Multiple concurrent operations
211
+ - Memory and CPU usage monitoring
212
+
213
+ ## Code Quality & Architecture
214
+
215
+ ### Error Handling Improvements
216
+ - [ ] **Granular error types** - Specific error classes for different failure modes
217
+ - [ ] **Retry mechanisms** - Automatic retry for transient failures
218
+ - [ ] **Circuit breaker pattern** - Fail-fast for consistently failing operations
219
+ - [ ] **Rate limiting** - Respect Plex server rate limits
220
+
221
+ ### Performance Optimizations
222
+ - [ ] **Response caching** - Cache frequently accessed data
223
+ - [ ] **Batch operations** - Combine multiple API calls when possible
224
+ - [ ] **Streaming responses** - Handle large datasets efficiently
225
+ - [ ] **Connection pooling** - Reuse HTTP connections
226
+
227
+ ### Documentation
228
+ - [ ] **API reference docs** - Complete documentation for all tools
229
+ - [ ] **Usage examples** - Real-world scenarios and code examples
230
+ - [ ] **Troubleshooting guide** - Common issues and solutions
231
+ - [ ] **Performance tuning** - Optimization recommendations
232
+
233
+ ### Security Enhancements
234
+ - [ ] **Token validation** - Verify Plex token format and permissions
235
+ - [ ] **SSL certificate validation** - Proper certificate handling
236
+ - [ ] **Input sanitization** - Validate all user inputs
237
+ - [ ] **Audit logging** - Log all administrative operations
238
+
239
+ ## Development Infrastructure
240
+
241
+ ### CI/CD Improvements
242
+ - [ ] **Automated testing** - Run full test suite on every commit
243
+ - [ ] **Code coverage tracking** - Monitor and improve test coverage
244
+ - [ ] **Performance benchmarks** - Track performance regressions
245
+ - [ ] **Security scanning** - Automated vulnerability detection
246
+
247
+ ### Development Tools
248
+ - [ ] **Mock Plex server** - Local development server for testing
249
+ - [ ] **Test data generator** - Generate realistic test datasets
250
+ - [ ] **Performance profiler** - Identify bottlenecks and optimize
251
+ - [ ] **Documentation generator** - Auto-generate API docs from code
252
+