Skip to content

Commit 05b8aff

Browse files
committed
feat(satellite): Implement runtime state management for MCP server processes
1 parent 838c0e5 commit 05b8aff

File tree

9 files changed

+1739
-9
lines changed

9 files changed

+1739
-9
lines changed

services/satellite/Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
# Production image
2-
FROM node:24-alpine
1+
# Production image - Debian base required for nsjail
2+
FROM node:24-bookworm-slim
3+
4+
# Install nsjail for stdio MCP server process isolation
5+
RUN apt-get update && \
6+
apt-get install -y --no-install-recommends \
7+
nsjail \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Enable unprivileged user namespaces (required for nsjail)
11+
RUN echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/00-local-userns.conf
312

413
WORKDIR /app
514

615
# Copy package files
716
COPY services/satellite/package.json ./
817

9-
# Install ONLY production dependencies (much faster than a full install)
18+
# Install ONLY production dependencies
1019
RUN npm install --omit=dev --no-package-lock
1120

1221
# Copy pre-built files
@@ -18,4 +27,8 @@ RUN echo "NODE_ENV=production" > .env && \
1827
echo "LOG_LEVEL=info" >> .env
1928

2029
EXPOSE 3001
30+
31+
# Run as non-root user for security
32+
USER node
33+
2134
CMD ["node", "--env-file=.env", "dist/index.js"]

services/satellite/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ The satellite will **fail to start** with clear error messages if required varia
138138
- `npm run lint` - Run ESLint with auto-fix
139139
- `npm start` - Start production server
140140

141+
### System Prerequisites
142+
143+
**Local Development:**
144+
- No special requirements - stdio MCP server process management works without isolation
145+
- Plain Node.js spawn() used for easy debugging
146+
- Works on macOS, Windows, and Linux
147+
148+
**Production (Docker):**
149+
- nsjail automatically installed in Docker image for secure process isolation
150+
- See Dockerfile for configuration details
151+
141152
### Initial Setup Requirements
142153

143154
1. **Backend Running**: Ensure DeployStack Backend is running at `DEPLOYSTACK_BACKEND_URL`

0 commit comments

Comments
 (0)