@andrewlwn77/social-media-mcp
v1.0.0
Published
MCP server for downloading content from social media platforms
Downloads
16
Maintainers
Readme
Social Media MCP
A Model Context Protocol (MCP) server for downloading content from social media platforms.
Features
- Download videos, images, and audio from major social media platforms
- Support for TikTok, Instagram, Facebook, Twitter, YouTube, Pinterest, and LinkedIn
- In-memory caching to reduce API calls
- Comprehensive error handling
- URL validation for supported platforms
Installation
npm install @andrewlwn77/social-media-mcpConfiguration
Set up your environment variables:
export SOCIAL_DOWNLOAD_API_KEY="your-rapidapi-key-here"
export CACHE_ENABLED="true" # Optional, default: true
export CACHE_TTL_SECONDS="300" # Optional, default: 300 (5 minutes)
export CACHE_MAX_ENTRIES="100" # Optional, default: 100Get your API key from RapidAPI - Social Download All In One
MCP Configuration
Add to your Claude Code .mcp.json:
{
"mcpServers": {
"social-media-mcp": {
"command": "npx",
"args": ["-y", "@andrewlwn77/social-media-mcp"],
"transport": {
"type": "stdio"
},
"env": {
"SOCIAL_DOWNLOAD_API_KEY": "your-rapidapi-key-here",
"CACHE_ENABLED": "true",
"CACHE_TTL_SECONDS": "300",
"CACHE_MAX_ENTRIES": "100"
}
}
}
}Supported Platforms
- TikTok:
https://www.tiktok.com/@username/video/123456789 - Instagram:
https://www.instagram.com/p/ABC123/ - Facebook:
https://www.facebook.com/user/posts/123456789 - Twitter/X:
https://twitter.com/user/status/123456789orhttps://x.com/user/status/123456789 - YouTube:
https://www.youtube.com/watch?v=ABC123orhttps://youtu.be/ABC123 - Pinterest:
https://www.pinterest.com/pin/123456789 - LinkedIn:
https://www.linkedin.com/posts/user-123456789
Usage
The MCP server provides one tool:
download_social_content
Download content from social media URLs.
Parameters:
url(string, required): Social media URL to download content from
Example:
{
"url": "https://www.tiktok.com/@username/video/123456789"
}Response: Returns formatted text with:
- Platform information (TikTok, Instagram, etc.)
- Content title and author
- High-quality thumbnail URL
- Multiple download options with quality levels:
- HD videos without watermarks
- Standard quality videos
- Audio-only versions
- File sizes in MB
- Content duration
Example Response:
**Social Media Content Download**
**Platform**: Tiktok
**Source URL**: https://www.tiktok.com/@username/video/123456789
**Title**: Amazing video title #hashtag
**Thumbnail**: https://thumbnail-url.jpg
**Available Downloads**:
1. **VIDEO** (hd_no_watermark) (14.22MB): https://download-link-hd.mp4
2. **VIDEO** (no_watermark) (10.09MB): https://download-link-standard.mp4
3. **AUDIO** (audio): https://audio-download-link.mp3
**Duration**: 88sDevelopment
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devError Handling
The server provides comprehensive error handling for:
- Invalid URL formats
- Unsupported platforms
- Private or restricted content
- API rate limits
- Network errors
- Authentication issues
Caching
The server includes an in-memory LRU cache with TTL support to:
- Reduce API calls for duplicate requests
- Improve response times
- Respect rate limits
- Store successful download results
License
MIT
Support
For issues and questions, please visit the GitHub repository.
