Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,42 @@ services:
- opencontext-network
restart: unless-stopped

# Mock Server for testing
open-context-mock-server:
build:
context: ./mcp-adapter
dockerfile: Dockerfile
image: opencontext/mcp-adapter:0.1.0
container_name: open-context-mock-server
ports:
- "8001:8001"
command: ["npm", "run", "mock"]
environment:
- MOCK_SERVER_PORT=8001
networks:
- opencontext-network
restart: unless-stopped

# Node.js MCP Adapter
open-context-mcp-adapter:
build:
context: ./mcp-adapter
dockerfile: Dockerfile
image: opencontext/mcp-adapter:0.1.0
container_name: open-context-mcp-adapter
ports:
- "3000:3000"
environment:
- OPENCONTEXT_CORE_URL=http://open-context-mock-server:8001
- OPENCONTEXT_DEFAULT_TOP_K=5
- OPENCONTEXT_DEFAULT_MAX_TOKENS=25000
- MCP_SERVER_PORT=3000
- MCP_MODE=http
depends_on:
- open-context-core
- open-context-mock-server
networks:
- opencontext-network
command: ["node", "dist/index.js", "--transport", "http", "--port", "3000"]
restart: unless-stopped

volumes:
Expand Down
7 changes: 7 additions & 0 deletions mcp-adapter/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ Thumbs.db
# Docker
Dockerfile
.dockerignore

# Build output
dist

# Test coverage
.nyc_output

5 changes: 4 additions & 1 deletion mcp-adapter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ logs
*.log

# Optional REPL history
.node_repl_history
.node_repl_history

# Build output
dist/
25 changes: 20 additions & 5 deletions mcp-adapter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,29 @@ WORKDIR /app
# Copy package files
COPY package*.json ./

# Install dependencies (only devDependencies for nodemon)
RUN npm install
# Install dependencies (including dev dependencies for build)
RUN npm ci

# Copy source code
COPY . .

# Expose port
# Build TypeScript
RUN npm run build

# Remove dev dependencies to reduce image size
RUN npm prune --production

# Create non-root user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nodejs -u 1001
USER nodejs

# Expose port (if needed for health checks)
EXPOSE 3000

# Start the application
CMD ["node", "index.js"]
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "console.log('MCP Server health check passed')" || exit 1

# Start MCP server
CMD ["node", "dist/index.js"]

Copilot AI Aug 11, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command starts index.js without the required transport arguments that are expected by the application. Based on the index.ts code, you should specify transport type, e.g., CMD ["node", "dist/index.js", "--transport", "stdio"] or use environment variables.

Suggested change
CMD ["node", "dist/index.js"]
CMD ["node", "dist/index.js", "--transport", "stdio"]

Copilot uses AI. Check for mistakes.
71 changes: 0 additions & 71 deletions mcp-adapter/index.js

This file was deleted.

Loading