README.md•2.3 kB
MCP Linux Deployment
This repository contains an MCP server to manage Windows servers from Linux. It is designed for per-user installs under your home directory and does not write system-wide files.
Minimal runtime layout (after running `./scripts/setup.sh`):
- $HOME/MCPServer/ (per-user target)
- bin/ (start, stop, health_check, uninstall)
- config/ (application code and `.env`)
- venv/ (Python virtualenv)
- logs/
- run/
Essentials (what to keep in the repo):
- `server.py` — MCP server entrypoint and tool registration
- `scripts/` — setup/start/stop/health_check/uninstall wrappers
- `requirements.txt` — pinned dependencies
Quick start (per-user)
1) Make scripts executable
```bash
chmod +x scripts/*.sh
```
2) Create a per-user install (targets $HOME/MCPServer by default)
```bash
./scripts/setup.sh --target "$HOME/MCPServer"
```
3) Edit configuration and credentials
```bash
vi "$HOME/MCPServer/config/.env"
# set MCP_HOST, MCP_PORT, WIN_DASH_API_BASE, MCP_API_TOKEN, WIN_DEFAULT_USER, WIN_DEFAULT_PASS
```
4) Start the server
```bash
"$HOME/MCPServer/bin/start.sh"
```
5) Check health and logs
```bash
"$HOME/MCPServer/bin/health_check.sh"
tail -f "$HOME/MCPServer/logs/mcp-server.log"
```
6) Stop the server
```bash
"$HOME/MCPServer/bin/stop.sh"
```
Installing dependencies into the repo venv (dev only)
```bash
./venv/bin/python -m pip install -r requirements.txt
```
Troubleshooting highlights
- Port binding: This server explicitly starts uvicorn with `host=$MCP_HOST` and `port=$MCP_PORT`. Default is 0.0.0.0:3000. Check with:
```bash
ss -ltnp | grep :${MCP_PORT:-3000}
curl -v http://localhost:${MCP_PORT:-3000}/health
```
- Missing packages: If you see `ModuleNotFoundError`, install requirements into the venv used by your install:
```bash
"$HOME/MCPServer/venv/bin/python" -m pip install -r requirements.txt
```
- Logs and PIDs: logs are at `<install>/logs/mcp-server.log`; PID file at `<install>/run/mcp-server.pid`.
Support
Collect these artifacts if you need help debugging:
```bash
tail -n 200 "$HOME/MCPServer/logs/mcp-server.log" > mcp-debug.log
ss -ltnp > ss-output.txt
ps aux | grep server.py > ps-output.txt
```
This README is compact and contains runtime, install, and key troubleshooting steps to operate the MCP server on Linux.