@felores/mcp-video 0.5.3

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/.prettierrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "endOfLine": "auto"
3
+ }
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ - The use of sexualized language or imagery
16
+ - Personal attacks
17
+ - Trolling or insulting/derogatory comments
18
+ - Public or private harassment
19
+ - Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ - Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This Code of Conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at anais@anaisbetts.org. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
package/COPYING ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2024 Anaïs Betts
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,207 @@
1
+ # Video MCP Server
2
+
3
+ A powerful Model Context Protocol (MCP) server that enables AI assistants like Claude to work with video content. This server provides capabilities for downloading video transcripts in plain text and videos from various platforms including YouTube, Vimeo, Twitter/X, and TikTok.
4
+
5
+ This project is a fork from anaisbetts/mcp-youtube which only outputs the transcript with timestamps. This project outputs the transcript in plain text without timestamps for easy LLM consumption and adds the download tool.
6
+
7
+ ## Features
8
+
9
+ - Download and process video subtitles/closed captions for AI analysis
10
+ - Download videos in high quality (up to 1080p)
11
+ - Support for multiple platforms:
12
+ - YouTube
13
+ - Vimeo
14
+ - Twitter/X
15
+ - TikTok
16
+ - And more platforms supported by yt-dlp
17
+
18
+ ## MCP Tools
19
+
20
+ This server provides two powerful tools that can be used by AI assistants through the Model Context Protocol:
21
+
22
+ ### 1. Video Transcript Tool (`get_video_transcript`)
23
+ - Downloads and processes video subtitles/closed captions into plain text format
24
+ - Removes timestamps and formatting for easy AI consumption
25
+ - Supports auto-generated captions when available
26
+ - Works with multiple languages (defaults to English)
27
+ - Input: Video URL from any supported platform
28
+ - Output: Clean, plain text transcript ready for AI analysis
29
+
30
+ ### 2. Video Download Tool (`download_video`)
31
+ - Downloads videos in high quality (limited to 1080p for reasonable file sizes)
32
+ - Automatically selects the best quality format
33
+ - Merges video and audio streams when necessary
34
+ - Saves files to a configurable downloads directory
35
+ - Input:
36
+ - Video URL from any supported platform
37
+ - Optional filename (recommended format: platform-id, e.g., 'youtube-MhOTvvmlqLM')
38
+ - Output:
39
+ - Downloaded video file in MP4 format
40
+ - File information including title, duration, resolution, and file size
41
+
42
+ ## Prerequisites
43
+
44
+ ### Node.js and npm
45
+
46
+ 1. Install Node.js (version 18 or higher) and npm from [nodejs.org](https://nodejs.org/)
47
+ 2. Verify installation:
48
+ ```bash
49
+ node --version
50
+ npm --version
51
+ ```
52
+
53
+ ### Installing yt-dlp
54
+
55
+ The server requires `yt-dlp` to be installed on your system. Here are the installation methods for different platforms:
56
+
57
+ #### Windows
58
+ 1. Using WinGet (Recommended):
59
+ ```powershell
60
+ winget install yt-dlp
61
+ ```
62
+ 2. Using Scoop:
63
+ ```powershell
64
+ scoop install yt-dlp
65
+ ```
66
+ 3. Manual Installation:
67
+ - Download the latest release from [yt-dlp releases](https://github.com/yt-dlp/yt-dlp/releases)
68
+ - Place the executable in a directory in your PATH
69
+
70
+ #### macOS
71
+ 1. Using Homebrew:
72
+ ```bash
73
+ brew install yt-dlp
74
+ ```
75
+ 2. Using MacPorts:
76
+ ```bash
77
+ sudo port install yt-dlp
78
+ ```
79
+
80
+ #### Linux
81
+ 1. Using package manager:
82
+ ```bash
83
+ # On Debian/Ubuntu
84
+ sudo apt install yt-dlp
85
+
86
+ # On Fedora
87
+ sudo dnf install yt-dlp
88
+
89
+ # On Arch Linux
90
+ sudo pacman -S yt-dlp
91
+ ```
92
+ 2. Using pip:
93
+ ```bash
94
+ python3 -m pip install -U yt-dlp
95
+ ```
96
+
97
+ ## Installation and Setup
98
+
99
+ ### Option 1: Direct Installation (Recommended for Users)
100
+
101
+ Install the MCP server using the [mcp-installer](https://github.com/anaisbetts/mcp-installer):
102
+ ```bash
103
+ # Install mcp-installer if you haven't already
104
+ npm install -g @anaisbetts/mcp-installer
105
+
106
+ # Install this MCP server
107
+ mcp-installer install @felores/mcp-video
108
+ ```
109
+
110
+ ### Option 2: Manual Installation (Recommended for Developers)
111
+
112
+ 1. Clone the repository:
113
+ ```bash
114
+ git clone https://github.com/felores/mcp-video.git
115
+ cd mcp-video
116
+ ```
117
+
118
+ 2. Install dependencies:
119
+ ```bash
120
+ npm install
121
+ ```
122
+
123
+ 3. Build the project:
124
+ ```bash
125
+ npm run build
126
+ ```
127
+
128
+ 4. Start the server:
129
+ ```bash
130
+ npm start
131
+ ```
132
+
133
+ ## Usage
134
+
135
+ Once installed, you can use this server through any MCP-compatible client (like Claude.ai). Here are some example prompts:
136
+
137
+ 1. To analyze a video's content:
138
+ ```
139
+ Summarize the YouTube video https://youtube.com/watch?v=VIDEO_ID
140
+ ```
141
+
142
+ 2. To get specific information:
143
+ ```
144
+ What are the main points discussed in this video: https://youtube.com/watch?v=VIDEO_ID
145
+ ```
146
+
147
+ The server will automatically:
148
+ 1. Download the video's subtitles/closed captions
149
+ 2. Process and clean the text
150
+ 3. Make it available to the AI assistant for analysis
151
+
152
+ ## Environment Variables
153
+
154
+ - `DOWNLOADS_DIR`: Specify a custom directory for downloaded videos (default: `./downloads`)
155
+
156
+ ## Development
157
+
158
+ ### Setting Up Development Environment
159
+
160
+ 1. Fork and clone the repository:
161
+ ```bash
162
+ git clone https://github.com/YOUR_USERNAME/mcp-video.git
163
+ cd mcp-video
164
+ ```
165
+
166
+ 2. Install development dependencies:
167
+ ```bash
168
+ npm install
169
+ ```
170
+
171
+ 3. Build the project:
172
+ ```bash
173
+ npm run build
174
+ ```
175
+
176
+ 4. Start the development server:
177
+ ```bash
178
+ npm start
179
+ ```
180
+
181
+ ### Running Tests
182
+ ```bash
183
+ npm test
184
+ ```
185
+
186
+ ### Making Changes
187
+ 1. Create a new branch:
188
+ ```bash
189
+ git checkout -b feature/your-feature-name
190
+ ```
191
+
192
+ 2. Make your changes and commit:
193
+ ```bash
194
+ git add .
195
+ git commit -m "Description of changes"
196
+ ```
197
+
198
+ 3. Push to your fork:
199
+ ```bash
200
+ git push origin feature/your-feature-name
201
+ ```
202
+
203
+ 4. Create a Pull Request from your fork to the main repository
204
+
205
+ ## License
206
+
207
+ MIT License - See [COPYING](COPYING) for details.
@@ -0,0 +1,308 @@
1
+ # MCP Inspector Guide for LLMs
2
+
3
+ This guide provides detailed information about using the MCP Inspector tool for testing, debugging, and validating MCP servers.
4
+
5
+ ## 1. Getting Started
6
+
7
+ ### Installation and Basic Usage
8
+ ```bash
9
+ # Run directly without installation
10
+ npx mcp-inspector <server-command>
11
+
12
+ # For NPM/PyPi packages
13
+ npx mcp-inspector npx -y @your-package/server-name
14
+
15
+ # For local development
16
+ npx mcp-inspector node path/to/your/server.js
17
+ npx mcp-inspector python path/to/your/server.py
18
+ ```
19
+
20
+ ### Server Connection Setup
21
+ 1. Select appropriate transport (stdio/SSE)
22
+ 2. Configure command-line arguments
23
+ 3. Set required environment variables
24
+ 4. Test initial connection
25
+
26
+ ## 2. Core Features
27
+
28
+ ### Server Connection Pane
29
+ 1. Transport Selection:
30
+ - stdio for local servers
31
+ - SSE for network-based servers
32
+ - Custom transport configuration
33
+
34
+ 2. Connection Settings:
35
+ - Command-line arguments
36
+ - Environment variables
37
+ - Connection timeouts
38
+
39
+ 3. Status Monitoring:
40
+ - Connection state
41
+ - Protocol version
42
+ - Capability negotiation
43
+
44
+ ### Resources Tab
45
+ 1. Resource Listing:
46
+ ```typescript
47
+ // Example resource listing structure
48
+ {
49
+ resources: [
50
+ {
51
+ uri: "custom://resource",
52
+ name: "Resource Name",
53
+ description: "Resource description",
54
+ mimeType: "text/plain"
55
+ }
56
+ ]
57
+ }
58
+ ```
59
+
60
+ 2. Resource Inspection:
61
+ - View metadata
62
+ - Examine content
63
+ - Check MIME types
64
+ - Test resource reading
65
+
66
+ 3. Subscription Testing:
67
+ - Subscribe to updates
68
+ - Monitor changes
69
+ - Test unsubscribe
70
+
71
+ ### Prompts Tab
72
+ 1. Template Inspection:
73
+ ```typescript
74
+ // Example prompt structure
75
+ {
76
+ name: "prompt-name",
77
+ description: "Prompt description",
78
+ arguments: [
79
+ {
80
+ name: "arg1",
81
+ description: "Argument description",
82
+ required: true
83
+ }
84
+ ]
85
+ }
86
+ ```
87
+
88
+ 2. Testing Features:
89
+ - View available templates
90
+ - Test with custom arguments
91
+ - Preview generated messages
92
+ - Validate responses
93
+
94
+ ### Tools Tab
95
+ 1. Tool Discovery:
96
+ ```typescript
97
+ // Example tool listing
98
+ {
99
+ tools: [
100
+ {
101
+ name: "tool-name",
102
+ description: "Tool description",
103
+ inputSchema: {
104
+ type: "object",
105
+ properties: {
106
+ // Parameter definitions
107
+ }
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ ```
113
+
114
+ 2. Testing Features:
115
+ - List available tools
116
+ - Validate schemas
117
+ - Test execution
118
+ - Monitor results
119
+
120
+ ### Notifications Pane
121
+ 1. Message Types:
122
+ - Server logs
123
+ - Error messages
124
+ - Status updates
125
+ - Progress notifications
126
+
127
+ 2. Monitoring:
128
+ - Real-time updates
129
+ - Message filtering
130
+ - Error tracking
131
+
132
+ ## 3. Testing Workflows
133
+
134
+ ### Development Workflow
135
+ 1. Initial Testing:
136
+ ```bash
137
+ # Start Inspector with development server
138
+ npx mcp-inspector npm run dev
139
+ ```
140
+
141
+ 2. Development Cycle:
142
+ - Make code changes
143
+ - Restart server
144
+ - Test affected features
145
+ - Monitor logs
146
+ - Debug issues
147
+
148
+ 3. Feature Testing:
149
+ - Verify basic functionality
150
+ - Test edge cases
151
+ - Check error handling
152
+ - Validate responses
153
+
154
+ ### Resource Testing
155
+ 1. Listing Verification:
156
+ - Check resource discovery
157
+ - Validate metadata
158
+ - Test pagination
159
+ - Check updates
160
+
161
+ 2. Content Testing:
162
+ - Read resource content
163
+ - Verify MIME types
164
+ - Test binary data
165
+ - Check encoding
166
+
167
+ 3. Subscription Testing:
168
+ - Subscribe to resources
169
+ - Monitor updates
170
+ - Test unsubscribe
171
+ - Verify notifications
172
+
173
+ ### Tool Testing
174
+ 1. Discovery Testing:
175
+ - List available tools
176
+ - Verify schemas
177
+ - Check descriptions
178
+ - Validate metadata
179
+
180
+ 2. Execution Testing:
181
+ - Test with valid inputs
182
+ - Try invalid inputs
183
+ - Check error handling
184
+ - Monitor progress
185
+ - Validate results
186
+
187
+ ### Prompt Testing
188
+ 1. Template Verification:
189
+ - Check available prompts
190
+ - Validate arguments
191
+ - Test descriptions
192
+ - Verify schemas
193
+
194
+ 2. Generation Testing:
195
+ - Test with arguments
196
+ - Check message format
197
+ - Validate content
198
+ - Test error cases
199
+
200
+ ## 4. Debugging
201
+
202
+ ### Common Issues
203
+ 1. Connection Problems:
204
+ - Check server process
205
+ - Verify transport
206
+ - Monitor initialization
207
+ - Check capabilities
208
+
209
+ 2. Message Errors:
210
+ - Validate formats
211
+ - Check handlers
212
+ - Monitor responses
213
+ - Track errors
214
+
215
+ 3. Resource Issues:
216
+ - Check permissions
217
+ - Verify paths
218
+ - Test content types
219
+ - Monitor updates
220
+
221
+ ### Debugging Tools
222
+ 1. Console Logging:
223
+ ```typescript
224
+ // Server-side logging
225
+ console.error("Debug message");
226
+ ```
227
+
228
+ 2. Message Inspection:
229
+ - View raw messages
230
+ - Check formatting
231
+ - Track request/response
232
+ - Monitor timing
233
+
234
+ 3. Error Analysis:
235
+ - Stack traces
236
+ - Error codes
237
+ - Response validation
238
+ - Context examination
239
+
240
+ ## 5. Best Practices
241
+
242
+ ### Testing Strategy
243
+ 1. Systematic Approach:
244
+ - Test core features first
245
+ - Add edge cases
246
+ - Verify error handling
247
+ - Check performance
248
+
249
+ 2. Resource Management:
250
+ - Monitor memory usage
251
+ - Check file handles
252
+ - Verify cleanup
253
+ - Test limits
254
+
255
+ 3. Error Handling:
256
+ - Test all error paths
257
+ - Verify messages
258
+ - Check recovery
259
+ - Monitor cleanup
260
+
261
+ ### Security Testing
262
+ 1. Input Validation:
263
+ - Test boundaries
264
+ - Try invalid input
265
+ - Check sanitization
266
+ - Verify limits
267
+
268
+ 2. Authentication:
269
+ - Test credentials
270
+ - Check permissions
271
+ - Verify tokens
272
+ - Monitor access
273
+
274
+ 3. Resource Protection:
275
+ - Test access control
276
+ - Check paths
277
+ - Verify isolation
278
+ - Monitor usage
279
+
280
+ ## 6. Performance Testing
281
+
282
+ ### Response Time
283
+ 1. Operation Timing:
284
+ - Track latency
285
+ - Monitor variance
286
+ - Check thresholds
287
+ - Log outliers
288
+
289
+ 2. Batch Operations:
290
+ - Test concurrent requests
291
+ - Monitor memory
292
+ - Check throughput
293
+ - Verify ordering
294
+
295
+ ### Resource Usage
296
+ 1. Memory Monitoring:
297
+ - Track allocation
298
+ - Check leaks
299
+ - Monitor peaks
300
+ - Verify cleanup
301
+
302
+ 2. Connection Management:
303
+ - Test connection stability
304
+ - Check timeouts
305
+ - Monitor states
306
+ - Verify cleanup
307
+
308
+ This guide should be used as a reference when testing and debugging MCP servers using the Inspector tool. Always consider the specific requirements of your server while following these guidelines.