Token导航 LogoToken导航TokenDH.com
Claude Jarvis logo
运维云端未说明官方级别未说明来源级核验

Claude Jarvis

MCP Server

一个基于Docker的应用栈,包含PostgreSQL数据库、Nginx HTTPS服务器和Go语言开发的MCP服务器,适用于本地开发和网络服务部署。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
Go语言DockerPostgreSQL

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

billy1234

提供方

billy1234

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

贾维斯

基于Docker的应用程序堆栈,包含PostgreSQL、Nginx(HTTPS)和基于Go的MCP服务器。

建筑

  • PostgreSQL 16:数据库服务器
  • Nginx:仅支持HTTPS的web服务器和反向代理
  • MCP服务器:基于Go-based API服务器,具有数据库连接

先决条件

  • 码头工人
  • Docker Compose
  • OpenSSL(用于生成SSL证书)

设置

1.环境配置

复制示例环境文件并配置凭据:

cp .env.example .env

编辑 .env 并设置数据库凭据和端口:

DB_USER=your_db_user
DB_PASSWORD=your_secure_password
DB_NAME=your_db_name
DB_PORT=5432
WEB_HTTPS_PORT=443
MCP_PORT=8080

2.SSL证书

快速入门: 使用提供的辅助脚本以交互方式生成证书:

# Linux/macOS
./generate-ssl.sh

# Windows PowerShell
.\generate-ssl.ps1

或者手动选择以下选项之一:

选项A:具有可信证书的本地网络(建议用于开发)

使用 mkcert 创建在浏览器中工作且没有警告的本地受信任证书:

# Install mkcert (one-time setup)
# macOS: brew install mkcert
# Windows: choco install mkcert
# Linux: See https://github.com/FiloSottile/mkcert#installation

# Install local CA
mkcert -install

# Generate certificate for your domain
mkdir -p nginx/ssl
mkcert -key-file nginx/ssl/key.pem -cert-file nginx/ssl/cert.pem \
  localhost jarvis.local 192.168.1.100 "*.jarvis.local"

替换 192.168.1.100 使用您机器的本地IP。添加您要在网络上使用的任何自定义域。

选项B:自签名证书(快速入门)

为自定义域生成自签名证书:

mkdir -p nginx/ssl

# Replace jarvis.local with your desired domain
DOMAIN="jarvis.local"

openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
  -keyout nginx/ssl/key.pem \
  -out nginx/ssl/cert.pem \
  -subj "/C=US/ST=State/L=City/O=Jarvis/CN=${DOMAIN}" \
  -addext "subjectAltName=DNS:${DOMAIN},DNS:*.${DOMAIN},DNS:localhost,IP:127.0.0.1"

注: 浏览器将显示自签名证书的安全警告。您需要接受警告才能继续。

使用自定义域,如 jarvis.local 在您的网络上,将其添加到您的主机文件或DNS服务器中。

选项C:使用Cloudflare或Let’s Encrypt进行生产

对于公共互联网访问,请使用受信任的证书颁发机构:

使用Cloudflare:

  1. 将您的域名指向Cloudflare DNS中的服务器IP
  2. 在Cloudflare SSL/TLS设置中生成源证书
  3. 下载证书和密钥,另存为:

- nginx/ssl/cert.pem (证书) - nginx/ssl/key.pem (私钥)

使用Let's Encrypt(certbot):

# Install certbot
sudo apt-get install certbot

# Generate certificate (standalone mode - stop nginx first)
sudo certbot certonly --standalone -d yourdomain.com -d www.yourdomain.com

# Copy certificates
mkdir -p nginx/ssl
sudo cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem nginx/ssl/cert.pem
sudo cp /etc/letsencrypt/live/yourdomain.com/privkey.pem nginx/ssl/key.pem
sudo chown $USER:$USER nginx/ssl/*.pem

使用certbot的续订挂钩设置自动续订。

3.启动服务

docker-compose up -d

4.验证服务

检查所有服务是否正在运行:

docker-compose ps

测试运行状况端点:

curl -k https://localhost/health

预期响应:

{
  "status": "healthy",
  "database": "connected"
}

服务端点

  • web界面: https://localhost:443
  • MCP API: https://localhost/api/mcp
  • 健康检查: https://localhost/health
  • PostgreSQL: localhost:5432
  • MCP服务器(直接): localhost:8080

发展

查看日志

# All services
docker-compose logs -f

# Specific service
docker-compose logs -f mcp-server
docker-compose logs -f postgres
docker-compose logs -f web

重建服务

# Rebuild all
docker-compose up -d --build

# Rebuild specific service
docker-compose up -d --build mcp-server

停止服务

docker-compose down

停止并删除卷

docker-compose down -v

项目结构

.
├── docker-compose.yml          # Docker Compose configuration
├── .env.example               # Environment template
├── .env                       # Your environment (not in git)
├── generate-ssl.sh            # SSL certificate generator (Linux/macOS)
├── generate-ssl.ps1           # SSL certificate generator (Windows)
├── README.md                  # This file
├── mcp-server/               # MCP Go server
│   ├── Dockerfile
│   ├── main.go
│   ├── go.mod
│   └── go.sum
└── nginx/                    # Nginx configuration
    ├── nginx.conf            # Nginx config
    ├── html/                 # Static files
    │   └── index.html
    └── ssl/                  # SSL certificates
        ├── cert.pem
        └── key.pem

数据库访问

连接到PostgreSQL:

docker-compose exec postgres psql -U  -d 

故障排除

证书问题

如果遇到证书错误,请确保在 nginx/ssl 目录。

连接被拒绝

如果服务无法连接,请检查:

  1. 所有容器都在运行: docker-compose ps
  2. 检查日志: docker-compose logs
  3. 验证网络: docker network ls

数据库连接问题

如果MCP服务器无法连接到PostgreSQL:

  1. 验证中的凭据 .env
  2. 检查PostgreSQL日志: docker-compose logs postgres
  3. 确保数据库健康: docker-compose ps

安全须知

  • 默认配置仅将自签名证书用于开发
  • 更改生产中的所有默认凭据
  • 在生产中使用来自受信任CA的正确SSL证书
  • 考虑在生产环境中对敏感数据使用Docker secrets
  • PostgreSQL端口公开用于开发;限制生产
  • MCP服务器端口(8080)公开用于开发/调试。在生产中,从中删除端口映射 docker-compose.yml 因此MCP服务器只能通过Nginx HTTPS访问。更改:
  # Remove this in production:
  ports:
    - "${MCP_PORT:-8080}:${MCP_PORT:-8080}"

这确保了所有流量都通过具有适当SSL加密的反向代理

目录标签

目录标签

Go语言DockerPostgreSQLTypeScript本地部署NginxSSL证书

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP