A Node.js/NPM-based MCP server that:
- Exposes an HTTP SSE endpoint for MCP clients
- Provides an
exectool that runs arbitrary Linux command lines on the host
Security note: Intended to run inside a Docker container with trusted clients. The exec tool provides unrestricted command execution.
- nvm and a Node version that matches
.nvmrc - npm
cd /Users/manuel/git/github/dx-tooling/maas/maas-mcpserver-linux-cmd-line
nvm use
npm install- Dev (TypeScript):
nvm use
PORT=3000 npm run dev:http- Build + Run (JavaScript):
nvm use
npm run build
PORT=3000 npm run start:httpThe server exposes:
- GET
/health→ Health check endpoint (returns HTTP 200 with service status) - GET
/mcp→ Establishes SSE stream (deprecated HTTP+SSE transport) - POST
/messages?sessionId=<id>→ JSON-RPC messages from the client
Use an MCP-compatible client to connect via SSE. Manual interaction is non-trivial because the sessionId is provided over the SSE stream.
The server provides a health check endpoint at /health that returns HTTP 200 when the service is running:
curl http://localhost:3000/healthResponse:
{
"status": "healthy",
"timestamp": "2025-09-10T06:50:40.772Z",
"service": "maas-mcpserver-linux-cmd-line",
"version": "1.0.0",
"activeSessions": 0
}- Dev:
nvm use
npm run dev:stdio- Build + Run:
nvm use
npm run build
npm run start:stdio- Name:
exec - Description: Execute a Linux command on the host system
- Input schema:
command(string, required): Full shell command linecwd(string, optional): Working directoryenv(record<string,string>, optional): Extra environment variables
- Output schema (structured):
exitCode(number)stdout(string)stderr(string)
While the command runs, stdout/stderr chunks are forwarded as MCP logging messages over the current session.
nvm use
npm run quality- Default port is
3000whenPORTis not set. - SSE transport in this project is provided for compatibility/testing (deprecated protocol). For production, prefer stdio or modern transports with compatible clients.