File Server MCP
An MCP (Model Context Protocol) server that provides tools to start and stop HTTP file servers.
Features
This MCP server provides three main tools:
- Start File Server - Start an HTTP file server at a given path
- Stop File Server - Stop a running HTTP file server
- List File Servers - List all currently running file servers
Installation
npm install
Usage
Running the MCP Server
npm start
The server will start and listen for MCP client connections via stdio.
Available Tools
Start File Server
Starts an HTTP file server using the serve library.
Parameters:
path (required): The directory path to serve files from
port (optional): The port to run the server on (default: 3000)
host (optional): The host to bind to (default: localhost)
Example:
{
"name": "start-file-server",
"arguments": {
"path": "/path/to/your/files",
"port": 8080,
"host": "localhost"
}
}
Stop File Server
Stops a running HTTP file server.
Parameters:
host (optional): The host of the server to stop (default: localhost)
port (optional): The port of the server to stop (default: 3000)
serverId (optional): The server ID to stop (e.g., "localhost:3000")
Example:
{
"name": "stop-file-server",
"arguments": {
"host": "localhost",
"port": 8080
}
}
List File Servers
Lists all currently running file servers.
Parameters: None
Example:
{
"name": "list-file-servers",
"arguments": {}
}
Configuration
This MCP server uses the serve library internally to provide HTTP file serving capabilities. The server processes are managed by the MCP server and can be started, stopped, and monitored through the provided tools.
Dependencies
@modelcontextprotocol/sdk: MCP SDK for TypeScript
serve: Lightweight HTTP file server
zod: Schema validation
tsx: TypeScript execution environment
License
MIT