MCP Media Server
A Model Context Protocol (MCP) server and client for listing and playing media files from ~/Media/MOVIES
. Supports stdio, HTTP, and HTTPS transports, compatible with Claude Desktop.
Features
List Movies: Browse all media files in your Movies directory
Play Movies: Start playback using system default media player
Multiple Transports: stdio (for Claude Desktop), HTTP, and HTTPS
Cross-Platform: Works on Linux, ( later macOS, and Windows )
Installation
Quick Start
Server
stdio (for Claude Desktop):
HTTP:
HTTPS: there is no built in https (regardless of what said) use Caddy as reverse proxy to handle https and forwad http to media_server
Play movie via stdio:
List movies via HTTP:
Play movie via HTTPS:
Caddy for https
In my case "pi5c.example.com" is public DNS entry with a local IP. There has got to be a better way, but it works for now.
I have a wildcard cert for *.example.com which I copied locally Copy the certs to /etc/caddy/certs/ (create if missing) and change owner to caddy
Configuration
Media Directory
By default, the server looks for media files in ~/Media/MOVIES
. To change this, edit the MEDIA_DIR
variable in media_server.py
:
Supported File Types
The following video formats are supported:
.mp4, .mkv, .avi, .mov, .wmv, .flv, .webm, .m4v, .mpg, .mpeg
To add more formats, edit the MEDIA_EXTENSIONS
set in media_server.py
.
Claude Desktop Integration
Add to your Claude Desktop configuration (claude_desktop_config.json
):
n8n Integration
UNTESTED For n8n, use the HTTP or HTTPS transport:
Start the server with HTTP/HTTPS transport
In n8n, use the HTTP Request node to connect to
http://your-server:8000/sse
Use POST requests to
/messages
endpoint for MCP communication
Media Player Requirements
The server will automatically detect and use available media players:
Linux:
MPV (
mpv
) this is the only player that works reliablyVLC (
vlc
)MPlayer (
mplayer
)Or system default (
xdg-open
)
macOS:
Uses
open
command (system default player)
Windows:
Uses
os.startfile()
(system default player)
Install a Player (Linux)
API Reference
Tools
list_movies
Lists all media files in the Movies directory.
Arguments: None
Returns: List of movies with name, path, size, and file type
Example:
play_movie
Plays a specific movie using the system's default media player.
Arguments:
filename
(string, required): Name of the movie file
Returns: Status message indicating success or error
Example:
Server Command-Line Options
Client Command-Line Options
Troubleshooting
No media player found
Install MPV or another supported media player:
Connection errors with HTTP/HTTPS
Check that the server is running
Verify the URL includes
/sse
endpointFor HTTPS, ensure certificate files are valid
Permission errors
Ensure the ~/Media/MOVIES
directory exists and is readable:
Security Notes
The server only accesses files in the configured media directory
The server does not modify or delete any files
License
MIT License - Feel free to use and modify as needed.
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables browsing and playing media files from a local Movies directory through natural language commands. Supports listing all movies and launching playback using the system's default media player.