A FastAPI-based MCP server that provides YouTube video metadata and transcripts as a tool for Cursor and other MCP-compatible clients. Fetches title, description, author, publish date, view count, tag
A FastAPI-based MCP server that provides YouTube video metadata and transcripts as a tool for Cursor and other MCP clients.
/youtube-info
endpoint as an MCP tool.pyproject.toml
for dependencies (uses FastAPI, yt-dlp, youtube-transcript-api, fastapi-mcp, etc.)# Clone the repository
git clone https://github.com/meh313/youtube-mcp.git
cd youtube-mcp
# (Recommended) Create a virtual environment
python -m venv .venv
.venv\Scripts\activate # On Windows
# or
source .venv/bin/activate # On Linux/Mac
# Install dependencies
pip install . # or use 'uv pip install' if you use uv
# Or install directly from pyproject.toml:
# pip install -e .
# or
# uv pip install -e .
uvicorn main:app --reload
Then access the API at:
http://localhost:8000/youtube-info?video_id=YOUR_VIDEO_ID
GET /youtube-info?video_id=l6TrXxqSzrE
{
"metadata": {
"title": "Create an AI Chat Bot in n8n in 60 Seconds or Less!",
"description": "...",
"author": "Kris Torrington",
"publish_date": "20250505",
"length": 91,
"views": 25,
"keywords": ["n8n", "AI chatbot", "..."],
"channel_url": "https://www.youtube.com/channel/UCUevUDRxTDJCoG1KxQveXag",
"thumbnail": "https://i.ytimg.com/vi/l6TrXxqSzrE/maxresdefault.jpg"
},
"transcript": "Hi everyone. I'm going to show you how..."
}
To use this server as a tool in Cursor:
uvicorn main:app --reload
)..cursor/mcp.json
:"youtube": {
"url": "http://localhost:8000/mcp"
}
/youtube-info
tool will be available in the tool list.To integrate this MCP server with any other MCP-compatible client:
http://localhost:8000
)."youtube": {
"url": "http://localhost:8000/mcp"
}
localhost
with your server's address if running remotely./mcp
exposes the YouTube info tool for all MCP clients.Refer to your specific MCP client's documentation for details on configuring external tools.
MIT License
Copyright (c) 2025 meh313
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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.