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
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ GITLAB_API_URL=gitlab.example.com
MCP_TRANSPORT_TYPE=stdio

# HTTP Stream 配置 (仅在 MCP_TRANSPORT_TYPE=httpStream 时使用)
# 服务器绑定地址 (默认: httpStream 模式为 0.0.0.0,其他模式为 localhost)
# 在 Docker 容器中运行时,推荐使用 0.0.0.0 以允许外部访问
MCP_HOST=0.0.0.0

# 服务器端口 (默认: 3000)
MCP_PORT=3000

Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ GITLAB_PROJECT_MAPPING={"project-name-a": 1001, "group/project-b": "group/projec
MCP_TRANSPORT_TYPE=stdio

# HTTP Stream Configuration (Only used when MCP_TRANSPORT_TYPE=httpStream)
# Server binding address (default: 0.0.0.0 for httpStream, localhost for stdio)
# For Docker deployments, use 0.0.0.0 to allow external access
MCP_HOST=0.0.0.0

# Server port (default: 3000)
MCP_PORT=3000

Expand Down Expand Up @@ -188,6 +192,7 @@ Environment variables:
- `GITLAB_API_URL`: Base URL of your GitLab API
- `GITLAB_TOKEN`: Access token for GitLab API authentication
- `MCP_TRANSPORT_TYPE`: Transport type (stdio/httpStream)
- `MCP_HOST`: Server binding address for HTTP stream mode
- `MCP_PORT`: HTTP port for HTTP stream mode
- `MCP_ENDPOINT`: HTTP endpoint path for HTTP stream mode

Expand All @@ -207,10 +212,31 @@ docker run -d \
-e GITLAB_API_URL=https://your-gitlab-instance.com \
-e GITLAB_TOKEN=your_access_token \
-e MCP_TRANSPORT_TYPE=httpStream \
-e MCP_HOST=0.0.0.0 \
-e MCP_PORT=3000 \
gitlab-mcp-server
```

#### Docker Compose Example

```yaml
services:
gitlab-mcp:
image: node:22.14.0
container_name: gitlab-mcp
ports:
- "3000:3000"
environment:
- GITLAB_TOKEN=your_gitlab_token
- GITLAB_API_URL=your-gitlab-instance.com
- MCP_TRANSPORT_TYPE=httpStream
- MCP_HOST=0.0.0.0
- MCP_PORT=3000
command: npx -y @zephyr-mcp/gitlab@latest
```

**Important for Docker:** When running in Docker containers, make sure to set `MCP_HOST=0.0.0.0` to allow external access. The default value for httpStream transport is already `0.0.0.0`, but setting it explicitly ensures compatibility.

### Manual Deployment

```bash
Expand Down
Loading