plex-mcp 0.0.1

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.txt~ ADDED
@@ -0,0 +1,198 @@
1
+ ================================================================================
2
+ PLEX MCP SERVER
3
+ Model Context Protocol Server for Plex
4
+ ================================================================================
5
+
6
+ DESCRIPTION
7
+ -----------
8
+ A comprehensive MCP (Model Context Protocol) server that provides AI assistants
9
+ with full access to your Plex Media Server. Search, browse, manage playlists,
10
+ analyze listening habits, and get detailed media information through a rich set
11
+ of tools.
12
+
13
+ FEATURES
14
+ --------
15
+ • Search across all Plex libraries with advanced filtering
16
+ • Browse libraries, collections, and recently added content
17
+ • Comprehensive playlist management (create, modify, delete)
18
+ • Watch history and continue watching (On Deck) access
19
+ • Music listening statistics and recommendations
20
+ • Advanced content filtering (genre, year, rating, resolution, audio format)
21
+ • Media file analysis and codec information
22
+ • Library storage and usage analytics
23
+ • Activity-based filtering (play counts, last played dates)
24
+
25
+ REQUIREMENTS
26
+ ------------
27
+ • Node.js 14+
28
+ • Plex Media Server with API access
29
+ • Valid Plex authentication token
30
+
31
+ INSTALLATION
32
+ ------------
33
+ 1. Clone this repository
34
+ 2. Install dependencies:
35
+ npm install
36
+
37
+ 3. Set environment variables:
38
+ export PLEX_URL="http://your-plex-server:32400"
39
+ export PLEX_TOKEN="your-plex-token"
40
+
41
+ 4. Run the server:
42
+ node index.js
43
+
44
+ GETTING YOUR PLEX TOKEN
45
+ -----------------------
46
+ 1. Sign in to Plex Web App
47
+ 2. Open browser developer tools (F12)
48
+ 3. Go to Network tab
49
+ 4. Refresh the page
50
+ 5. Look for requests to plex.tv with X-Plex-Token header
51
+ 6. Copy the token value
52
+
53
+ AVAILABLE TOOLS
54
+ ---------------
55
+
56
+ SEARCH & BROWSE:
57
+ • search_plex - Search across all libraries with filters
58
+ • browse_libraries - List all available Plex libraries
59
+ • browse_library - Browse content within a specific library
60
+ • browse_collections - List all Plex collections
61
+ • browse_collection - View contents of a specific collection
62
+ • get_recently_added - Show recently added content
63
+
64
+ ACTIVITY & HISTORY:
65
+ • get_watch_history - View playback history with filtering
66
+ • get_on_deck - Show continue watching items
67
+ • get_watched_status - Check watched status of content
68
+ • get_listening_stats - Music analytics and recommendations
69
+
70
+ PLAYLIST MANAGEMENT:
71
+ • list_playlists - Show all playlists with filtering
72
+ • create_playlist - Create new playlists (regular or smart)
73
+ • add_to_playlist - Add items to existing playlists
74
+ • remove_from_playlist- Remove items from playlists
75
+ • delete_playlist - Delete playlists
76
+
77
+ MEDIA INFO & STATS:
78
+ • get_media_info - Detailed file and codec information
79
+ • get_library_stats - Storage and usage analytics
80
+
81
+ FILTERING OPTIONS
82
+ -----------------
83
+
84
+ BASIC FILTERS (search_plex, browse_library):
85
+ • genre - Filter by genre (Action, Comedy, Rock, etc.)
86
+ • year - Specific release year
87
+ • year_min/year_max - Year range filtering
88
+ • studio - Studio or record label
89
+ • director/writer/actor - Cast and crew filtering
90
+ • rating_min/rating_max - Rating range (0-10 scale)
91
+ • duration_min/duration_max - Duration in minutes
92
+ • added_after/added_before - Date-based filtering
93
+
94
+ ACTIVITY FILTERS:
95
+ • play_count_min/max - Filter by play count range
96
+ • never_played - Show only unplayed content
97
+ • last_played_after/before - Filter by last played date
98
+ • played_in_last_days - Recently played content
99
+
100
+ ADVANCED FILTERS:
101
+ • content_rating - Content rating (G, PG, PG-13, R, etc.)
102
+ • resolution - Video resolution (4k, 1080, 720, sd)
103
+ • audio_format - Audio codec or quality (lossless, lossy, flac, etc.)
104
+ • file_size_min/max - File size filtering in MB
105
+
106
+ USAGE EXAMPLES
107
+ --------------
108
+
109
+ Search for action movies from 2020-2023:
110
+ {
111
+ "tool": "search_plex",
112
+ "arguments": {
113
+ "query": "action",
114
+ "type": "movie",
115
+ "genre": "Action",
116
+ "year_min": 2020,
117
+ "year_max": 2023
118
+ }
119
+ }
120
+
121
+ Browse music library for highly-rated albums never played:
122
+ {
123
+ "tool": "browse_library",
124
+ "arguments": {
125
+ "library_id": "3",
126
+ "type": "album",
127
+ "rating_min": 8,
128
+ "never_played": true,
129
+ "sort": "rating"
130
+ }
131
+ }
132
+
133
+ Get listening stats for the past month:
134
+ {
135
+ "tool": "get_listening_stats",
136
+ "arguments": {
137
+ "period": "month",
138
+ "include_recommendations": true
139
+ }
140
+ }
141
+
142
+ TESTING
143
+ -------
144
+ Run the test suite:
145
+ npm test
146
+
147
+ Run specific test suites:
148
+ npm test -- --testPathPattern=parsers.test.js
149
+ npm test -- --testPathPattern=handlers.test.js
150
+
151
+ DEVELOPMENT
152
+ -----------
153
+ The server is built using:
154
+ • Node.js with axios for HTTP requests
155
+ • Jest for testing with comprehensive unit and integration tests
156
+ • MCP (Model Context Protocol) for AI assistant integration
157
+
158
+ Project structure:
159
+ index.js - Main server implementation
160
+ tests/
161
+ unit/ - Unit tests for parsers, formatters, filters
162
+ integration/ - Integration tests for handlers
163
+ fixtures/ - Test data and mocks
164
+
165
+ ENVIRONMENT VARIABLES
166
+ ---------------------
167
+ Required:
168
+ • PLEX_URL - Your Plex server URL (e.g., http://localhost:32400)
169
+ • PLEX_TOKEN - Your Plex authentication token
170
+
171
+ Optional:
172
+ • NODE_ENV - Set to 'development' for debug logging
173
+
174
+ TROUBLESHOOTING
175
+ ---------------
176
+ • Ensure Plex server is running and accessible
177
+ • Verify PLEX_TOKEN is valid and has proper permissions
178
+ • Check network connectivity between server and Plex
179
+ • Enable debug logging with NODE_ENV=development
180
+
181
+ For 401 Unauthorized errors, regenerate your Plex token.
182
+ For connection errors, verify PLEX_URL and network settings.
183
+
184
+ LICENSE
185
+ -------
186
+ This project is open source. See LICENSE file for details.
187
+
188
+ CONTRIBUTING
189
+ ------------
190
+ 1. Fork the repository
191
+ 2. Create a feature branch
192
+ 3. Add tests for new functionality
193
+ 4. Ensure all tests pass
194
+ 5. Submit a pull request
195
+
196
+ ================================================================================
197
+ For support and updates, visit: https://github.com/your-username/plex-mcp
198
+ ================================================================================