一个封装在《星际迷航》LCARS命令界面中的生产就绪模型上下文协议服务器。\
起始日期:有效。所有系统均为标称系统。
◈ 任务简报
> “计算机是有史以来发明的最民主的工具。它的目的是做用户要求的任何事情。”\
> — 星际舰队指挥指令
MCP星际舰队司令部 是增强的 模型上下文协议(MCP) 具有完全交互功能的服务器 LCARS风格的网络仪表板 --同样的美学因星际飞船而闻名 企业它将Claude Code AI集成(通过MCP stdio)与一个漂亮的基于浏览器的命令控制台连接起来,为您提供开发人员工具、文件系统操作、系统监控和来自单个统一界面的Docker可观察性。
◈ 战术概述```
┌─────────────────────────────────────────────────────────────────────────────┐
│ ◈ DUAL-INTERFACE DESIGN │
│ │
│ [ Claude Code / AI ] [ Browser ] │
│ │ stdio MCP │ HTTP :3001 │
│ ▼ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ ENHANCED MCP SERVER CORE │ │
│ │ ┌──────────────┐ ┌──────────────────────┐ │ │
│ │ │ MCP Engine │ │ Express HTTP API │ │ │
│ │ │ (13 Tools) │◄──►│ REST Endpoints │ │ │
│ │ └──────────────┘ └──────────────────────┘ │ │
│ └─────────────────────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ [ AI responds with ] [ LCARS Dashboard UI ] │
│ tool results Interactive terminal │
│ System monitoring │
│ One-click tool execution │
└─────────────────────────────────────────────────────────────────────────────┘
______________________________________________________________________
## ◈ 船舶系统特征
### 🖖 命令接口
|能力|状态|
|---|---|
|MCP标准输入协议|✅ 活动|
|HTTP REST API |✅ 活动|
|LCARS网络仪表板|✅ 在线的
|交互式终端|✅ 现场直播|
|响应式设计|✅ 所有屏幕|
### 🛠️ 开发商运营
|工具|说明|
|---|---|
| `git_status` |存储库状态|
| `git_log` |完整的提交历史记录|
| `git_diff` |文件级差异|
| `git_branch` |分行列表|
| `search_files` |递归代码搜索|
### 💻 系统操作
|工具|说明|
|---|---|
| `list_files` |目录浏览|
| `read_file` |文件内容查看器|
| `write_file` |文件编写器|
| `create_directory` |目录创建|
| `run_command` |Shell执行|
| `system_info` |实时系统指标|
### 📊 数据处理
|工具|说明|
|---|---|
| `parse_json` |JSON验证|
| `format_json` |漂亮的打印JSON|
______________________________________________________________________
## ◈ 曲速部署
### 🚀 选项A——本地启动(Node.js)```bash
# 1. Install crew
npm install
# 2. Engage engines
npm start # Production warp
npm run dev # Debug mode (verbose logs)
# 3. Open LCARS console
open http://localhost:3001
🐳 选项B——Docker舰队(所有服务)```bash
Launch the full starship
docker-compose up -d
Services come online:
http://localhost:3001 ← MCP Server + LCARS Dashboard
http://localhost:3000 ← Grafana Analytics (change default creds in .env!)
http://localhost:3002 ← Real-time Analytics Engine
http://localhost:9090 ← Prometheus Metrics
http://localhost:8080 ← cAdvisor Container Monitor
Hail all stations
docker-compose logs -f
Stand down
docker-compose down
> 📖 完整部署指南→ `DOCKER-README.md` ·快速启动→ `QUICKSTART.md`
______________________________________________________________________
## ◈ 星舰建筑```
┌──────────────────────────┐
│ Internet / NGINX Proxy │
│ Load Balancing · SSL · Rate Limiting │
└────────────┬─────────────┘
│
┌──────────────────────┼──────────────────────┐
│ │ │
┌─────────▼──────────┐ ┌────────▼────────┐ ┌─────────▼──────────┐
│ MCP SERVER │ │ GRAFANA │ │ ANALYTICS │
│ Port 3001 │ │ Port 3000 │ │ Port 3002 │
│ HTTP + MCP/stdio │ │ Dashboards │ │ Metrics / Events │
└─────────┬──────────┘ └────────┬────────┘ └─────────┬──────────┘
│ │ │
┌─────────▼──────────────────────▼──────────────────────▼──────────┐
│ DATA LAYER │
│ Redis (cache) · Prometheus (metrics) · Volumes │
└──────────────────────────────────────────────────────────────────┘
| 服务 | 端口 | 用途 |
|---|---|---|
| MCP服务器 | :3001 |
核心服务器·LCARS仪表板·REST API |
| 格拉法纳 | :3000 |
可视化分析·警报·仪表板 |
| 分析 | :3002 |
实时事件跟踪 |
| 普罗米修斯 | :9090 |
时间序列指标数据库 |
| 容器顾问 | :8080 |
容器资源监控 |
| 瑞迪斯 | :6379 |
缓存层 |
| NGINX | :80/:443 |
反向代理·SSL |
◈ LCARS命令控制台--仪表板预览```
╔══════════════════════════════════════════════════════════════════╗
║ ████ STARFLEET MCP ████████████████████████████████ 47.2 GHz ████║
╠════════════╦═══════════════════════════════════════════════════╣
║ NAV ║ ┌──────────────────────────────────────────┐ ║
║ ▶ TERMINAL ║ │ > system_info │ ║
║ FILES ║ │ ✔ CPU: 12% MEM: 4.2GB UPTIME: 99.9% │ ║
║ GIT ║ │ > git_status │ ║
║ SYSTEM ║ │ ✔ Branch: main Modified: 2 Clean │ ║
║ TOOLS ║ └──────────────────────────────────────────┘ ║
║ ║ ║
║ ▓▓▓▓▓▓▓▓▓▓ ║ [⚡ GIT STATUS] [📁 LIST FILES] [💻 SYS INFO] ║
╚════════════╩═══════════════════════════════════════════════════╝
仪表板具有以下功能:
- **⚡ 交互式终端** --使用颜色编码输出实时执行命令
- **📡 系统监控** --实时CPU、内存、磁盘和正常运行时间仪表
- **🗂️ 工具面板** --每个MCP工具都可以作为一键式LCARS按钮使用
- **🔐 文件操作** --直接在浏览器中读取、写入和浏览文件
- **📊 Git集成** --状态、日志、差异、分支一目了然
______________________________________________________________________
## ◈ REST API-通信阵列```bash
# ─── Status check ───────────────────────────────────────────────
curl http://localhost:3001/api/status
# ── List all 13 available tools ─────────────────────────────────
curl http://localhost:3001/api/tools
# ── Execute any tool ────────────────────────────────────────────
curl -X POST http://localhost:3001/api/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool": "system_info", "args": {}}'
curl -X POST http://localhost:3001/api/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool": "git_status", "args": {"repoPath": "."}}'
curl -X POST http://localhost:3001/api/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool": "search_files", "args": {"query": "TODO", "searchDir": "."}}'
> MCP协议 --服务器通过MCP进行完整通话 stdio将Claude Code指向它,它将成为您的开发环境的扩展。
◈ 船舶计算机配置
| 变量 | 默认值 | 描述 |
|---|---|---|
PORT |
3001 |
HTTP服务器端口 |
DEBUG |
(未设置) | 设置 DEBUG=1 启用详细日志记录 |
NODE_ENV |
production |
环境模式 |
复制 .env.example → .env 并在发射前进行调整。
◈ 安全协议```
◈ Input validation on all tool parameters
◈ Path normalization — prevents directory traversal attacks
◈ Command execution sandboxed with 10 MB output buffer
◈ Error messages sanitized before client delivery
◈ NGINX rate limiting in production Docker stack
◈ Non-root container execution in Dockerfile
______________________________________________________________________
## ◈ 技术清单——用
|组件|技术|
|---|---|
|运行时| Node.js 18+|
|MCP协议| `@modelcontextprotocol/sdk` ^1.17 |
|HTTP服务器| Express.js 5.x|
|仪表板UI |普通HTML·CSS(LCARS)·JS|
|分析|自定义指标引擎|
|监控|普罗米修斯+格拉法纳|
|缓存| Redis|
|代理| NGINX|
|容器| Docker+Docker组合|
|Linting | ESLint+Prettier|
______________________________________________________________________
## ◈ 船员舱单开发```bash
npm run dev # Engage debug warp (DEBUG=1)
npm run lint # ESLint sweep
npm run lint:fix # Auto-fix lint violations
npm run format # Prettier formatting
npm run format:check # Verify formatting
npm run audit:fix # Fix known vulnerabilities
> 完整操作参考→ CHEATSHEET.md ·建筑深度挖掘→ ARCHITECTURE.md
__________╔═══════════════════════════════════════════════════════════╗
║ ◈ STARFLEET MCP · ALL SYSTEMS NOMINAL · WARP READY ◈ ║
╚═══════════════════════════════════════════════════════════╝
“大胆地推出以前没有开发人员推出过的产品。”
⭐ 如果这个回购能帮助你达到曲速,那就把它当明星吧!
