cybersecurity-mcp-server
A security-first MCP (Model Context Protocol) backend built with Node.js and Express, featuring hardening, rate limiting, structured logging, and Docker support.
README
cybersecurity-mcp-server 🔐
Security-first MCP (Model Context Protocol) backend built with Node.js and Express.
🚀 Overview
This repository contains a secure, production-oriented MCP backend focusing on best practices for hardening, monitoring and safe defaults. It uses Express 5, Helmet for headers, rate limiting middleware, and structured logging (winston + winston-daily-rotate-file).
⚙️ Features
- Express 5 backend
- Security middleware (Helmet, rate limiting)
- Structured logging with
winstonandwinston-daily-rotate-file - Docker-friendly with a
Dockerfile - Simple, modular architecture (controllers, services, middleware)
📁 Project Structure
A short map of core folders and important files so contributors know where to look.
src/
├─ server.js # App entrypoint (starts HTTP server)
├─ app.js # Express app, middleware, routes registration
├─ routes/ # API route definitions (e.g., mcp.routes.js)
├─ controllers/ # Request handlers (mcp.controller.js)
├─ services/ # Business logic & integrations (mcp.service.js)
├─ middleware/ # auth, rateLimit, and other cross-cutting concerns
├─ config/ # env.js, security.js and config helpers
└─ utils/ # logger.js and helper utilities
logs/ # Rotated log files written by winston
Dockerfile # Container image build instructions
package.json # Scripts & dependencies
README.md # This document
Notes:
src/config/env.jscentralizes environment variable loading and defaults.utils/logger.jsuseswinston+winston-daily-rotate-filefor structured, rotated logs.- Keep business logic in
services/and handlers incontrollers/to keep tests and mocking straightforward.
🧑💻 Local Development
Below are platform-specific steps so contributors on Linux/macOS and Windows can get started quickly.
Linux / macOS
- Clone and install:
git clone https://github.com/Krishsakaria26/cybersecurity-mcp-server.git
cd cybersecurity-mcp-server
npm install
- Create a
.envfile (optional but recommended)
# copy example if present
cp .env.example .env || true
# or create manually
cat > .env <<EOF
PORT=3000
NODE_ENV=development
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=100
LOG_LEVEL=debug
EOF
- Start in development mode (auto-reloads on change)
npm run dev
- Production run
npm start
Tips:
- Use your IDE debugger attached to
src/server.jsfor breakpoints. - Add tests (Jest/Mocha) and a
testnpm script before merging features. - Use
pre-commithooks for linting/formatting consistency.
Windows (PowerShell / CMD / WSL)
For the closest parity with Linux/macOS behavior, use WSL or Git Bash. PowerShell and CMD work, but some shell behaviors differ (path separators, quoting).
- Clone and install (PowerShell / CMD):
git clone https://github.com/Krishsakaria26/cybersecurity-mcp-server.git
cd cybersecurity-mcp-server
npm install
- Create a
.envfile (PowerShell / CMD)
- PowerShell:
New-Item -Path . -Name '.env' -ItemType 'file' -Force
Add-Content -Path .env -Value 'PORT=3000'
Add-Content -Path .env -Value 'NODE_ENV=development'
Add-Content -Path .env -Value 'RATE_LIMIT_WINDOW_MS=60000'
Add-Content -Path .env -Value 'RATE_LIMIT_MAX=100'
Add-Content -Path .env -Value 'LOG_LEVEL=debug'
- CMD:
echo PORT=3000> .env
echo NODE_ENV=development>> .env
echo RATE_LIMIT_WINDOW_MS=60000>> .env
echo RATE_LIMIT_MAX=100>> .env
echo LOG_LEVEL=debug>> .env
- Start in development mode
npm run dev
Notes for Windows:
- If using Windows Defender / Firewall you'll be prompted when the server listens on a port—allow local access.
- If you need POSIX tools or to match Linux behavior (e.g., volume mounts in Docker), prefer using WSL or Git Bash.
🐳 Docker Deployment
Docker commands differ slightly across shells; below are examples for both platforms and tips for Windows users.
Linux / macOS
Build the image:
docker build -t mcp-server:latest .
Run (basic):
docker run -p 3000:3000 --rm --name mcp-server mcp-server:latest
Run with env-file and persistent logs:
docker run -p 3000:3000 --env-file .env -v "$(pwd)/logs:/app/logs" --restart unless-stopped --name mcp-server mcp-server:latest
Windows (PowerShell / Docker Desktop)
Build the image (same):
docker build -t mcp-server:latest .
Run (basic):
docker run -p 3000:3000 --rm --name mcp-server mcp-server:latest
Run with env-file and persistent logs (PowerShell):
docker run -p 3000:3000 --env-file .\.env -v "${PWD}\logs:/app/logs" --restart unless-stopped --name mcp-server mcp-server:latest
If ${PWD} path doesn't mount correctly, provide the full Windows path for the volume mapping (replace C:\path\to\repo):
docker run -p 3000:3000 --env-file .\.env -v "C:\full\path\to\repo\logs:/app/logs" --restart unless-stopped --name mcp-server mcp-server:latest
Notes & recommendations:
- On Windows prefer Docker Desktop with WSL2 integration enabled for better compatibility.
- Use full absolute paths for volume mounts if relative mounts fail in PowerShell/CMD.
- When running containers in production, pass secrets via your orchestrator or Docker secrets (avoid committing
.env).
Optional: Docker Compose (works cross-platform if file paths are adjusted):
version: '3.8'
services:
mcp-server:
build: .
image: mcp-server:latest
ports:
- "3000:3000"
env_file: .env
volumes:
- ./logs:/app/logs
restart: unless-stopped
Health & deployment notes:
- Provide resource limits and environment secrets via your orchestrator (Kubernetes/Swarm).
- Mount
logs/for host access or forward logs to a log aggregator for production. - Consider adding a container healthcheck for orchestrators that rely on it.
🧩 Configuration
Environment settings are loaded from src/config/env.js. Common variables:
PORT- server port (default: 3000)NODE_ENV- environment (development/production)- Rate limit options in
src/config/security.js(window, max requests)
Tip: Create a
.envfile in the project root for local development.
Logging
The app uses winston with winston-daily-rotate-file for rotated logs stored in the logs/ folder. Logs include structured timestamps and levels for easier parsing and aggregation.
🧪 Tests
There are no automated tests included yet. Contributions adding tests (Jest/Mocha) are welcomed.
🤝 Contributing
Contributions are welcome — please open issues or pull requests on the GitHub repository. Follow existing code patterns and keep security considerations in mind.
📄 License
MIT — see the LICENSE file.
👤 Author
Krish Sakaria : Cybersecurity & Backend Engineering
Manish Shah : Backend Engineering
Madhusmita Choudhary : Fullstack Engineering
Aryan Karna : Frontend Developer
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器