Skip to content

Commit 60fd9d8

Browse files
committed
feat: implement comprehensive GitLab MCP enhancements v4.4.0
BREAKING CHANGE: Major architectural improvements and feature additions - Migrate to Yarn 4 with strict TypeScript configuration - Implement comprehensive GraphQL Work Items API with 1021 tests - Add modular entity architecture (Core, Work Items, MRS, Files, Labels, etc.) - Implement dynamic tool registry with environment-based feature gating - Add comprehensive integration test suite with data lifecycle management - Enhance schema validation with case normalization and error handling - Implement smart user search with transliteration support - Add dual transport mode (stdio/HTTP) with automatic selection - Implement coverage reporting and CI/CD with semantic versioning - Add tool description customization for agentic optimization - Implement label name-to-ID conversion for improved UX - Add comprehensive error handling and logging infrastructure - Migrate from REST to GraphQL for work items operations - Add support for all GitLab Ultimate features and widgets - Implement security enhancements and read-only mode support Version: 4.4.0 (up from upstream 2.0.5) Tests: 1021 comprehensive tests (877 unit + 144 integration) Coverage: 76.69% statement coverage Architecture: Modern TypeScript with strict mode and ESM support
1 parent d1d3f1a commit 60fd9d8

File tree

157 files changed

+46881
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+46881
-216
lines changed

.dockerignore

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Dependencies
2+
node_modules/
3+
.yarn/cache/
4+
.yarn/install-state.gz
5+
6+
# Build outputs
7+
dist/
8+
build/
9+
*.tsbuildinfo
10+
11+
# Test coverage
12+
coverage/
13+
.nyc_output/
14+
15+
# Environment and config
16+
.env
17+
.env.*
18+
!.env.example
19+
20+
# Version control
21+
.git/
22+
.gitignore
23+
24+
# IDE
25+
.vscode/
26+
.idea/
27+
*.swp
28+
*.swo
29+
*~
30+
31+
# Documentation
32+
*.md
33+
!README.md
34+
!CHANGELOG.md
35+
36+
# CI/CD
37+
.github/
38+
!.github/workflows/
39+
40+
# Logs
41+
*.log
42+
npm-debug.log*
43+
yarn-debug.log*
44+
yarn-error.log*
45+
46+
# OS files
47+
.DS_Store
48+
Thumbs.db
49+
50+
# Testing
51+
tests/
52+
*.test.ts
53+
*.spec.ts
54+
jest.config.*
55+
.jest/
56+
57+
# Development files
58+
.eslintrc*
59+
.prettierrc*
60+
.editorconfig
61+
# Keep TypeScript config files for build
62+
!tsconfig.json
63+
!tsconfig.build.json
64+
65+
# Temporary files
66+
tmp/
67+
temp/
68+
*.tmp

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2+
# This config is aligned with your Prettier settings for best compatibility with WebStorm and other editors
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_style = space
10+
indent_size = 2
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.js]
15+
quote_type = single
16+
17+
[*.ts]
18+
quote_type = single
19+
20+
[*.json]
21+
indent_size = 2
22+
23+
[*.md]
24+
trim_trailing_whitespace = false

.env.example

Lines changed: 124 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,133 @@
1-
# GitLab API Configuration
1+
# GitLab MCP Server Environment Configuration
2+
# Copy this file to .env and fill in your values
3+
4+
# ============================================================================
5+
# REQUIRED CONFIGURATION
6+
# ============================================================================
7+
8+
# GitLab Personal Access Token (REQUIRED)
9+
# Create at: GitLab → Settings → Access Tokens
10+
# Required scopes: api, read_user, read_repository
11+
# For full functionality add: write_repository, read_api, write_api
12+
GITLAB_TOKEN=your_gitlab_token_here
13+
14+
# GitLab API Base URL (REQUIRED)
15+
# Examples:
16+
# GitLab.com: https://gitlab.com
17+
# Self-hosted: https://gitlab.company.com
18+
# Custom port: https://gitlab.company.com:8443
219
GITLAB_API_URL=https://gitlab.com
3-
GITLAB_TOKEN=your-gitlab-personal-access-token-here
420

5-
# Test Configuration (for integration tests)
6-
GITLAB_TOKEN_TEST=your-test-token-here
7-
TEST_PROJECT_ID=your-test-project-id
8-
ISSUE_IID=1
21+
# ============================================================================
22+
# TRANSPORT CONFIGURATION
23+
# ============================================================================
924

25+
# HTTP Streamable mode (recommended for web clients)
26+
# Set to true for HTTP streaming transport
27+
STREAMABLE_HTTP=true
1028

11-
# MCP Transport Mode (Optional)
12-
# Description:
13-
# When multiple transport modes are enabled, the server will use the following priority:
14-
# 1. **Streamable HTTP** (if `STREAMABLE_HTTP=true`) - Highest priority
15-
# 2. **SSE** (if `SSE=true` and `STREAMABLE_HTTP!=true`) - Medium priority
16-
# 3. **Stdio** (if `SSE!=true` and `STREAMABLE_HTTP!=true`)
17-
SSE=true
18-
STREAMABLE_HTTP=false
29+
# Server-Sent Events mode
30+
# Set to true for SSE transport (note: only one transport should be true)
31+
SSE=false
1932

20-
# MCP Server Host With SSE Transport and Streamable Http Transport
33+
# Server host for HTTP/SSE modes
2134
HOST=127.0.0.1
2235

23-
# Proxy Configuration (optional)
36+
# Server port for HTTP/SSE modes
37+
PORT=3000
38+
39+
# ============================================================================
40+
# OPTIONAL GITLAB TARGETING
41+
# ============================================================================
42+
43+
# Default project for operations that don't specify a target
44+
# Format: "username/project" or "group/project" or project ID
45+
# Leave empty if not using default targeting
46+
GITLAB_PROJECT_ID=
47+
48+
# Default group for group-level operations
49+
# Format: "group-name" or "parent-group/sub-group"
50+
# Leave empty if not using default group targeting
51+
GITLAB_GROUP_PATH=
52+
53+
# ============================================================================
54+
# FEATURE FLAGS (GitLab Tier-specific)
55+
# ============================================================================
56+
57+
# Enable Work Items (GitLab Premium/Ultimate)
58+
# Set to false for GitLab Free tier
59+
USE_WORKITEMS=true
60+
61+
# Enable Milestones (GitLab Premium/Ultimate for group milestones)
62+
# Project milestones available in all tiers
63+
USE_MILESTONE=true
64+
65+
# Enable CI/CD Pipelines (available in all tiers)
66+
USE_PIPELINE=true
67+
68+
# Enable Wiki functionality (available in all tiers)
69+
USE_GITLAB_WIKI=true
70+
71+
# ============================================================================
72+
# SECURITY AND ACCESS CONTROL
73+
# ============================================================================
74+
75+
# Read-only mode (disables all write operations)
76+
# Recommended for security-sensitive environments
77+
GITLAB_READ_ONLY_MODE=false
78+
79+
# Regex pattern to deny specific tools
80+
# Example: "delete.*|create.*" to block delete and create operations
81+
# Leave empty to allow all tools
82+
GITLAB_DENIED_TOOLS_REGEX=
83+
84+
# ============================================================================
85+
# LOGGING AND DEBUGGING
86+
# ============================================================================
87+
88+
# Log level: error, warn, info, debug, trace
89+
LOG_LEVEL=info
90+
91+
# Node.js environment
92+
NODE_ENV=development
93+
94+
# ============================================================================
95+
# NETWORK AND PROXY SETTINGS
96+
# ============================================================================
97+
98+
# HTTP proxy for outbound requests
2499
HTTP_PROXY=
100+
101+
# HTTPS proxy for outbound requests
25102
HTTPS_PROXY=
26-
NO_PROXY=localhost,127.0.0.1
103+
104+
# Comma-separated list of hosts to bypass proxy
105+
NO_PROXY=localhost,127.0.0.1
106+
107+
# ============================================================================
108+
# PERFORMANCE TUNING
109+
# ============================================================================
110+
111+
# Node.js memory limit and options
112+
NODE_OPTIONS=--max-old-space-size=512
113+
114+
# Health check endpoint
115+
HEALTH_CHECK_ENABLED=true
116+
117+
# ============================================================================
118+
# USAGE NOTES
119+
# ============================================================================
120+
121+
# Transport Mode Priority:
122+
# 1. STREAMABLE_HTTP=true (highest priority, recommended)
123+
# 2. SSE=true (if STREAMABLE_HTTP!=true)
124+
# 3. Stdio mode (if both STREAMABLE_HTTP and SSE are false)
125+
126+
# GitLab Tier Compatibility:
127+
# - GitLab Free: Set USE_WORKITEMS=false
128+
# - GitLab Premium/Ultimate: All features available
129+
130+
# Security Best Practices:
131+
# - Use read-only mode for security-sensitive environments
132+
# - Limit tool access with GITLAB_DENIED_TOOLS_REGEX
133+
# - Use environment-specific API URLs and tokens

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: "tron:TFDsezHa1cBkoeZT5q2T49Wp66K8t2DmdA"

.github/git-commit-instructions.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Git Commit Instructions for GitHub Copilot
2+
3+
## Conventional Commits Format
4+
5+
Use the Conventional Commits specification for all commit messages:
6+
7+
```
8+
<type>[optional scope]: <description>
9+
10+
[optional body]
11+
12+
[optional footer(s)]
13+
```
14+
15+
## Commit Types
16+
17+
- **feat**: A new feature for the user
18+
- **fix**: A bug fix for the user
19+
- **docs**: Changes to documentation only
20+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
21+
- **refactor**: A code change that neither fixes a bug nor adds a feature
22+
- **perf**: A code change that improves performance
23+
- **test**: Adding missing tests or correcting existing tests
24+
- **chore**: Changes to the build process or auxiliary tools and libraries
25+
- **ci**: Changes to CI configuration files and scripts
26+
- **build**: Changes that affect the build system or external dependencies
27+
- **revert**: Reverts a previous commit
28+
29+
## Commit Message Guidelines
30+
31+
### Subject Line Rules
32+
33+
- Use imperative mood: "Add feature" not "Added feature" or "Adds feature"
34+
- Keep subject line under 50 characters
35+
- Do not end with a period
36+
- Capitalize the first letter of the description
37+
- Use present tense
38+
39+
### Examples of Good Commit Messages
40+
41+
```
42+
feat: add work item synchronization across providers
43+
fix: resolve null pointer exception in provider manager
44+
docs: update README with new configuration options
45+
refactor: extract common validation logic to utility class
46+
test: add unit tests for GitLab provider integration
47+
chore: update dependencies to latest versions
48+
ci: add semantic-release workflow for automated publishing
49+
```
50+
51+
### Examples with Scope
52+
53+
```
54+
feat(providers): add Azure DevOps provider integration
55+
fix(server): handle connection errors gracefully
56+
docs(api): document new work item endpoints
57+
test(integration): add end-to-end provider tests
58+
```
59+
60+
### Breaking Changes
61+
62+
For breaking changes, use either:
63+
64+
- Add `!` after the type: `feat!: remove deprecated API endpoints`
65+
- Add `BREAKING CHANGE:` in the footer with explanation
66+
67+
### Body and Footer
68+
69+
- Use the body to explain **what** and **why** vs. **how**
70+
- Wrap body at 72 characters
71+
- Separate body from subject with a blank line
72+
- Use footer for referencing issues: `Fixes #123` or `Closes #456`
73+
74+
### Full Example
75+
76+
```
77+
feat(auth): add OAuth2 authentication support
78+
79+
Implement OAuth2 flow for GitHub and GitLab providers to improve
80+
security and eliminate the need for personal access tokens in
81+
some scenarios.
82+
83+
- Add OAuth2 client configuration
84+
- Implement token refresh mechanism
85+
- Update provider initialization to support OAuth2
86+
87+
Closes #45
88+
Fixes #67
89+
```
90+
91+
## Semantic Versioning Impact
92+
93+
- `feat:` → Minor version bump (0.1.0 → 0.2.0)
94+
- `fix:` → Patch version bump (0.1.0 → 0.1.1)
95+
- `feat!:` or `BREAKING CHANGE:` → Major version bump (0.1.0 → 1.0.0)
96+
- Other types → No version bump (chore, docs, style, etc.)
97+
98+
## Additional Guidelines
99+
100+
- One logical change per commit
101+
- Test your changes before committing
102+
- Keep commits atomic and focused
103+
- Write commit messages for future developers (including yourself)

0 commit comments

Comments
 (0)