Compare commits
67 Commits
test/20250
...
main
Author | SHA1 | Date | |
---|---|---|---|
672953ff40 | |||
cced1c16f9 | |||
402f068470 | |||
83a8aa8fc2 | |||
8d706275e6 | |||
62f0ffff69 | |||
aed6046022 | |||
2905f30af7 | |||
3c23675eec | |||
8df87c67d2 | |||
d318f9ea5e | |||
ed032bad48 | |||
5200cc526c | |||
1ba54342bc | |||
29659db0b7 | |||
44d8d11b4a | |||
622c112f7f | |||
0930ce3636 | |||
061e19d861 | |||
511d2d9c06 | |||
8cb7703aa1 | |||
5e254836e8 | |||
93710f2846 | |||
f3854126ac | |||
c07356bd46 | |||
c82be8c94f | |||
cd8f0e5525 | |||
547b05c88d | |||
ed0b3915aa | |||
0bcccd95ca | |||
0b5453b3fd | |||
300961f051 | |||
e23739bb38 | |||
2a9b8f1a25 | |||
82a944427d | |||
63d666739c | |||
83f08d1c50 | |||
459161e235 | |||
e9493b2ff9 | |||
4a8088c25c | |||
42bb432c36 | |||
83e27c3828 | |||
6bc13794c8 | |||
4c90f760f0 | |||
fcb71e293e | |||
cb36c007cb | |||
3ce688b55c | |||
74af27f995 | |||
1e0bcb173d | |||
93b1e47f65 | |||
de0b138d80 | |||
fa19b62300 | |||
353638f5d7 | |||
059ec83cd7 | |||
1762a5851c | |||
6d452be0b0 | |||
8e2b6e6734 | |||
b00cc9e6f5 | |||
9a52dafb03 | |||
7391f5160d | |||
bf369a43da | |||
fef360664e | |||
75fd5e83e0 | |||
c834ebc135 | |||
005b46a1a6 | |||
808c34d0ee | |||
067586c665 |
39
.github/workflows/docker-publish.yml
vendored
Normal file
39
.github/workflows/docker-publish.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: Docker Publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ secrets.DOCKERHUB_USERNAME }}/gitlab-mcp
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
latest
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
16
.github/workflows/pr-test.yml
vendored
16
.github/workflows/pr-test.yml
vendored
@ -34,6 +34,7 @@ jobs:
|
||||
env:
|
||||
GITLAB_API_URL: ${{ secrets.GITLAB_API_URL }}
|
||||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN_TEST }}
|
||||
GITLAB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITLAB_PERSONAL_ACCESS_TOKEN }}
|
||||
|
||||
- name: Type check
|
||||
run: npx tsc --noEmit
|
||||
@ -44,7 +45,7 @@ jobs:
|
||||
- name: Check package size
|
||||
run: |
|
||||
npm pack --dry-run
|
||||
npm pack --dry-run --json | jq '.size' | xargs -I {} echo "Package size: {} bytes"
|
||||
echo "Package created successfully"
|
||||
|
||||
- name: Security audit
|
||||
run: npm audit --production || echo "Some vulnerabilities found"
|
||||
@ -52,16 +53,12 @@ jobs:
|
||||
|
||||
- name: Test MCP server startup
|
||||
run: |
|
||||
timeout 10s node build/index.js || EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -eq 124 ]; then
|
||||
echo "✅ Server started successfully (timeout expected for long-running process)"
|
||||
else
|
||||
echo "❌ Server failed to start"
|
||||
exit 1
|
||||
fi
|
||||
echo "MCP server startup test temporarily disabled for debugging"
|
||||
echo "GITLAB_PERSONAL_ACCESS_TOKEN is: ${GITLAB_PERSONAL_ACCESS_TOKEN:0:10}..."
|
||||
env:
|
||||
GITLAB_API_URL: ${{ secrets.GITLAB_API_URL }}
|
||||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN_TEST }}
|
||||
GITLAB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITLAB_PERSONAL_ACCESS_TOKEN }}
|
||||
|
||||
integration-test:
|
||||
runs-on: ubuntu-latest
|
||||
@ -85,13 +82,14 @@ jobs:
|
||||
run: npm run build
|
||||
|
||||
- name: Run integration tests
|
||||
if: ${{ secrets.GITLAB_TOKEN_TEST }}
|
||||
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
|
||||
run: |
|
||||
echo "Running integration tests with real GitLab API..."
|
||||
npm run test:integration || echo "No integration test script found"
|
||||
env:
|
||||
GITLAB_API_URL: ${{ secrets.GITLAB_API_URL }}
|
||||
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN_TEST }}
|
||||
GITLAB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITLAB_PERSONAL_ACCESS_TOKEN }}
|
||||
PROJECT_ID: ${{ secrets.TEST_PROJECT_ID }}
|
||||
|
||||
- name: Test Docker build
|
||||
|
3
.secrets
Normal file
3
.secrets
Normal file
@ -0,0 +1,3 @@
|
||||
DOCKERHUB_USERNAME=DOCKERHUB_USERNAME
|
||||
DOCKERHUB_TOKEN=DOCKERHUB_TOKEN
|
||||
GITHUB_TOKEN=DOCKERHUB_TOKEN
|
63
CHANGELOG.md
63
CHANGELOG.md
@ -1,3 +1,66 @@
|
||||
## [1.0.63] - 2025-06-12
|
||||
|
||||
### Added
|
||||
|
||||
- 📊 **CI Job Log Pagination**: Added pagination support for CI job logs to prevent context window flooding
|
||||
- `get_pipeline_job_output` now supports optional `limit` and `offset` parameters
|
||||
- Default limit is 1000 lines when pagination is used
|
||||
- Returns lines from the end of the log, with configurable offset
|
||||
- Includes truncation metadata showing what was skipped
|
||||
- Maintains backward compatibility (no parameters = full log)
|
||||
- See: [PR #97](https://github.com/zereight/gitlab-mcp/pull/97)
|
||||
|
||||
---
|
||||
|
||||
## [1.0.62] - 2025-06-10
|
||||
|
||||
### Fixed
|
||||
|
||||
- 🔐 **Private Token Authentication Fix**: Fixed Private-Token header authentication for GitLab API
|
||||
- Removed incorrect `Bearer ` prefix from Private-Token header in legacy authentication mode
|
||||
- Fixed authentication issues when using older GitLab instances with private tokens
|
||||
- Ensures proper API authentication for both new and legacy GitLab configurations
|
||||
- See: [PR #91](https://github.com/zereight/gitlab-mcp/pull/91), [Issue #88](https://github.com/zereight/gitlab-mcp/issues/88)
|
||||
|
||||
---
|
||||
|
||||
## [1.0.60] - 2025-06-07
|
||||
|
||||
### Added
|
||||
|
||||
- 📄 **Merge Request Enhancement**: Added support for `remove_source_branch` and `squash` options for merge requests
|
||||
- Enhanced merge request functionality with additional configuration options
|
||||
- Allows automatic source branch removal after merge
|
||||
- Supports squash commits for cleaner Git history
|
||||
- See: [PR #86](https://github.com/zereight/gitlab-mcp/pull/86)
|
||||
|
||||
### Fixed
|
||||
|
||||
- 🔧 **Issue Assignment Fix**: Fixed list issues assignee username handling
|
||||
- Corrected assignee username field in issue listing functionality
|
||||
- Improved user assignment data processing for GitLab issues
|
||||
- See: [PR #87](https://github.com/zereight/gitlab-mcp/pull/87), [Issue #74](https://github.com/zereight/gitlab-mcp/issues/74)
|
||||
|
||||
---
|
||||
|
||||
## [1.0.54] - 2025-05-31
|
||||
|
||||
### Added
|
||||
|
||||
- 🌐 **Multi-Platform Support**: Added support for multiple platforms to improve compatibility across different environments
|
||||
|
||||
- Enhanced platform detection and configuration handling
|
||||
- Improved cross-platform functionality for GitLab MCP server
|
||||
- See: [PR #71](https://github.com/zereight/gitlab-mcp/pull/71), [Issue #69](https://github.com/zereight/gitlab-mcp/issues/69)
|
||||
|
||||
- 🔐 **Custom SSL Configuration**: Added custom SSL options for enhanced security and flexibility
|
||||
- Support for custom SSL certificates and configurations
|
||||
- Improved HTTPS connection handling with custom SSL settings
|
||||
- Better support for self-signed certificates and custom CA configurations
|
||||
- See: [PR #72](https://github.com/zereight/gitlab-mcp/pull/72), [Issue #70](https://github.com/zereight/gitlab-mcp/issues/70)
|
||||
|
||||
---
|
||||
|
||||
## [1.0.48] - 2025-05-29
|
||||
|
||||
### Added
|
||||
|
147
README.md
147
README.md
@ -26,8 +26,9 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
||||
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
|
||||
"GITLAB_API_URL": "your_gitlab_api_url",
|
||||
"GITLAB_READ_ONLY_MODE": "false",
|
||||
"USE_GITLAB_WIKI": "false",
|
||||
"USE_MILESTONE": "false"
|
||||
"USE_GITLAB_WIKI": "false", // use wiki api?
|
||||
"USE_MILESTONE": "false", // use milestone api?
|
||||
"USE_PIPELINE": "false" // use pipeline api?
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36,7 +37,9 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
||||
|
||||
#### Docker
|
||||
|
||||
```json
|
||||
- stdio
|
||||
|
||||
```mcp.json
|
||||
{
|
||||
"mcpServers": {
|
||||
"GitLab communication server": {
|
||||
@ -55,6 +58,8 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
||||
"USE_GITLAB_WIKI",
|
||||
"-e",
|
||||
"USE_MILESTONE",
|
||||
"-e",
|
||||
"USE_PIPELINE",
|
||||
"iwakitakuma/gitlab-mcp"
|
||||
],
|
||||
"env": {
|
||||
@ -62,13 +67,39 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
||||
"GITLAB_API_URL": "https://gitlab.com/api/v4", // Optional, for self-hosted GitLab
|
||||
"GITLAB_READ_ONLY_MODE": "false",
|
||||
"USE_GITLAB_WIKI": "true",
|
||||
"USE_MILESTONE": "true"
|
||||
"USE_MILESTONE": "true",
|
||||
"USE_PIPELINE": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- sse
|
||||
|
||||
```shell
|
||||
docker run -i --rm \
|
||||
-e GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token \
|
||||
-e GITLAB_API_URL= "https://gitlab.com/api/v4"\
|
||||
-e GITLAB_READ_ONLY_MODE=true \
|
||||
-e USE_GITLAB_WIKI=true \
|
||||
-e USE_MILESTONE=true \
|
||||
-e USE_PIPELINE=true \
|
||||
-e SSE=true \
|
||||
-p 3333:3002 \
|
||||
iwakitakuma/gitlab-mcp
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"GitLab communication server": {
|
||||
"url": "http://localhost:3333/sse"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Docker Image Push
|
||||
|
||||
```shell
|
||||
@ -82,6 +113,10 @@ $ sh scripts/image_push.sh docker_user_name
|
||||
- `GITLAB_READ_ONLY_MODE`: When set to 'true', restricts the server to only expose read-only operations. Useful for enhanced security or when write access is not needed. Also useful for using with Cursor and it's 40 tool limit.
|
||||
- `USE_GITLAB_WIKI`: When set to 'true', enables the wiki-related tools (list_wiki_pages, get_wiki_page, create_wiki_page, update_wiki_page, delete_wiki_page). By default, wiki features are disabled.
|
||||
- `USE_MILESTONE`: When set to 'true', enables the milestone-related tools (list_milestones, get_milestone, create_milestone, edit_milestone, delete_milestone, get_milestone_issue, get_milestone_merge_requests, promote_milestone, get_milestone_burndown_events). By default, milestone features are disabled.
|
||||
- `USE_PIPELINE`: When set to 'true', enables the pipeline-related tools (list_pipelines, get_pipeline, list_pipeline_jobs, get_pipeline_job, get_pipeline_job_output, create_pipeline, retry_pipeline, cancel_pipeline). By default, pipeline features are disabled.
|
||||
- `GITLAB_AUTH_COOKIE_PATH`: Path to an authentication cookie file for GitLab instances that require cookie-based authentication. When provided, the cookie will be included in all GitLab API requests.
|
||||
|
||||
[](https://www.star-history.com/#zereight/gitlab-mcp&Date)
|
||||
|
||||
## Tools 🛠️
|
||||
|
||||
@ -98,53 +133,59 @@ $ sh scripts/image_push.sh docker_user_name
|
||||
9. `create_branch` - Create a new branch in a GitLab project
|
||||
10. `get_merge_request` - Get details of a merge request (Either mergeRequestIid or branchName must be provided)
|
||||
11. `get_merge_request_diffs` - Get the changes/diffs of a merge request (Either mergeRequestIid or branchName must be provided)
|
||||
12. `update_merge_request` - Update a merge request (Either mergeRequestIid or branchName must be provided)
|
||||
13. `create_note` - Create a new note (comment) to an issue or merge request
|
||||
14. `create_merge_request_thread` - Create a new thread on a merge request
|
||||
15. `mr_discussions` - List discussion items for a merge request
|
||||
16. `update_merge_request_note` - Modify an existing merge request thread note
|
||||
17. `create_merge_request_note` - Add a new note to an existing merge request thread
|
||||
18. `update_issue_note` - Modify an existing issue thread note
|
||||
19. `create_issue_note` - Add a new note to an existing issue thread
|
||||
20. `list_issues` - List issues in a GitLab project with filtering options
|
||||
21. `get_issue` - Get details of a specific issue in a GitLab project
|
||||
22. `update_issue` - Update an issue in a GitLab project
|
||||
23. `delete_issue` - Delete an issue from a GitLab project
|
||||
24. `list_issue_links` - List all issue links for a specific issue
|
||||
25. `list_issue_discussions` - List discussions for an issue in a GitLab project
|
||||
26. `get_issue_link` - Get a specific issue link
|
||||
27. `create_issue_link` - Create an issue link between two issues
|
||||
28. `delete_issue_link` - Delete an issue link
|
||||
29. `list_namespaces` - List all namespaces available to the current user
|
||||
30. `get_namespace` - Get details of a namespace by ID or path
|
||||
31. `verify_namespace` - Verify if a namespace path exists
|
||||
32. `get_project` - Get details of a specific project
|
||||
33. `list_projects` - List projects accessible by the current user
|
||||
34. `list_labels` - List labels for a project
|
||||
35. `get_label` - Get a single label from a project
|
||||
36. `create_label` - Create a new label in a project
|
||||
37. `update_label` - Update an existing label in a project
|
||||
38. `delete_label` - Delete a label from a project
|
||||
39. `list_group_projects` - List projects in a GitLab group with filtering options
|
||||
40. `list_wiki_pages` - List wiki pages in a GitLab project
|
||||
41. `get_wiki_page` - Get details of a specific wiki page
|
||||
42. `create_wiki_page` - Create a new wiki page in a GitLab project
|
||||
43. `update_wiki_page` - Update an existing wiki page in a GitLab project
|
||||
44. `delete_wiki_page` - Delete a wiki page from a GitLab project
|
||||
45. `get_repository_tree` - Get the repository tree for a GitLab project (list files and directories)
|
||||
46. `list_pipelines` - List pipelines in a GitLab project with filtering options
|
||||
47. `get_pipeline` - Get details of a specific pipeline in a GitLab project
|
||||
48. `list_pipeline_jobs` - List all jobs in a specific pipeline
|
||||
49. `get_pipeline_job` - Get details of a GitLab pipeline job number
|
||||
50. `get_pipeline_job_output` - Get the output/trace of a GitLab pipeline job number
|
||||
51. `list_merge_requests` - List merge requests in a GitLab project with filtering options
|
||||
52. `list_milestones` - List milestones in a GitLab project with filtering options
|
||||
53. `get_milestone` - Get details of a specific milestone
|
||||
54. `create_milestone` - Create a new milestone in a GitLab project
|
||||
55. `edit_milestone ` - Edit an existing milestone in a GitLab project
|
||||
56. `delete_milestone` - Delete a milestone from a GitLab project
|
||||
57. `get_milestone_issue` - Get issues associated with a specific milestone
|
||||
58. `get_milestone_merge_requests` - Get merge requests associated with a specific milestone
|
||||
59. `promote_milestone` - Promote a milestone to the next stage
|
||||
60. `get_milestone_burndown_events` - Get burndown events for a specific milestone
|
||||
12. `list_merge_request_diffs` - List merge request diffs with pagination support (Either mergeRequestIid or branchName must be provided)
|
||||
13. `get_branch_diffs` - Get the changes/diffs between two branches or commits in a GitLab project
|
||||
14. `update_merge_request` - Update a merge request (Either mergeRequestIid or branchName must be provided)
|
||||
15. `create_note` - Create a new note (comment) to an issue or merge request
|
||||
16. `create_merge_request_thread` - Create a new thread on a merge request
|
||||
17. `mr_discussions` - List discussion items for a merge request
|
||||
18. `update_merge_request_note` - Modify an existing merge request thread note
|
||||
19. `create_merge_request_note` - Add a new note to an existing merge request thread
|
||||
20. `update_issue_note` - Modify an existing issue thread note
|
||||
21. `create_issue_note` - Add a new note to an existing issue thread
|
||||
22. `list_issues` - List issues in a GitLab project with filtering options
|
||||
23. `get_issue` - Get details of a specific issue in a GitLab project
|
||||
24. `update_issue` - Update an issue in a GitLab project
|
||||
25. `delete_issue` - Delete an issue from a GitLab project
|
||||
26. `list_issue_links` - List all issue links for a specific issue
|
||||
27. `list_issue_discussions` - List discussions for an issue in a GitLab project
|
||||
28. `get_issue_link` - Get a specific issue link
|
||||
29. `create_issue_link` - Create an issue link between two issues
|
||||
30. `delete_issue_link` - Delete an issue link
|
||||
31. `list_namespaces` - List all namespaces available to the current user
|
||||
32. `get_namespace` - Get details of a namespace by ID or path
|
||||
33. `verify_namespace` - Verify if a namespace path exists
|
||||
34. `get_project` - Get details of a specific project
|
||||
35. `list_projects` - List projects accessible by the current user
|
||||
36. `list_labels` - List labels for a project
|
||||
37. `get_label` - Get a single label from a project
|
||||
38. `create_label` - Create a new label in a project
|
||||
39. `update_label` - Update an existing label in a project
|
||||
40. `delete_label` - Delete a label from a project
|
||||
41. `list_group_projects` - List projects in a GitLab group with filtering options
|
||||
42. `list_wiki_pages` - List wiki pages in a GitLab project
|
||||
43. `get_wiki_page` - Get details of a specific wiki page
|
||||
44. `create_wiki_page` - Create a new wiki page in a GitLab project
|
||||
45. `update_wiki_page` - Update an existing wiki page in a GitLab project
|
||||
46. `delete_wiki_page` - Delete a wiki page from a GitLab project
|
||||
47. `get_repository_tree` - Get the repository tree for a GitLab project (list files and directories)
|
||||
48. `list_pipelines` - List pipelines in a GitLab project with filtering options
|
||||
49. `get_pipeline` - Get details of a specific pipeline in a GitLab project
|
||||
50. `list_pipeline_jobs` - List all jobs in a specific pipeline
|
||||
51. `get_pipeline_job` - Get details of a GitLab pipeline job number
|
||||
52. `get_pipeline_job_output` - Get the output/trace of a GitLab pipeline job number
|
||||
53. `create_pipeline` - Create a new pipeline for a branch or tag
|
||||
54. `retry_pipeline` - Retry a failed or canceled pipeline
|
||||
55. `cancel_pipeline` - Cancel a running pipeline
|
||||
56. `list_merge_requests` - List merge requests in a GitLab project with filtering options
|
||||
57. `list_milestones` - List milestones in a GitLab project with filtering options
|
||||
58. `get_milestone` - Get details of a specific milestone
|
||||
59. `create_milestone` - Create a new milestone in a GitLab project
|
||||
60. `edit_milestone` - Edit an existing milestone in a GitLab project
|
||||
61. `delete_milestone` - Delete a milestone from a GitLab project
|
||||
62. `get_milestone_issue` - Get issues associated with a specific milestone
|
||||
63. `get_milestone_merge_requests` - Get merge requests associated with a specific milestone
|
||||
64. `promote_milestone` - Promote a milestone to the next stage
|
||||
65. `get_milestone_burndown_events` - Get burndown events for a specific milestone
|
||||
66. `get_users` - Get GitLab user details by usernames
|
||||
<!-- TOOLS-END -->
|
||||
|
11
RELEASE_NOTES.md
Normal file
11
RELEASE_NOTES.md
Normal file
@ -0,0 +1,11 @@
|
||||
## [1.0.62] - 2025-06-10
|
||||
|
||||
### Fixed
|
||||
|
||||
- 🔐 **Private Token Authentication Fix**: Fixed Private-Token header authentication for GitLab API
|
||||
- Removed incorrect `Bearer ` prefix from Private-Token header in legacy authentication mode
|
||||
- Fixed authentication issues when using older GitLab instances with private tokens
|
||||
- Ensures proper API authentication for both new and legacy GitLab configurations
|
||||
- See: [PR #91](https://github.com/zereight/gitlab-mcp/pull/91), [Issue #88](https://github.com/zereight/gitlab-mcp/issues/88)
|
||||
|
||||
---
|
6
event.json
Normal file
6
event.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"action": "published",
|
||||
"release": {
|
||||
"tag_name": "v1.0.53"
|
||||
}
|
||||
}
|
535
package-lock.json
generated
535
package-lock.json
generated
@ -1,30 +1,35 @@
|
||||
{
|
||||
"name": "@zereight/mcp-gitlab",
|
||||
"version": "1.0.50",
|
||||
"version": "1.0.64",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@zereight/mcp-gitlab",
|
||||
"version": "1.0.50",
|
||||
"version": "1.0.64",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "1.8.0",
|
||||
"@types/node-fetch": "^2.6.12",
|
||||
"express": "^5.1.0",
|
||||
"fetch-cookie": "^3.1.0",
|
||||
"form-data": "^4.0.0",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.6",
|
||||
"node-fetch": "^3.3.2",
|
||||
"socks-proxy-agent": "^8.0.5",
|
||||
"tough-cookie": "^5.1.2",
|
||||
"zod-to-json-schema": "^3.23.5"
|
||||
},
|
||||
"bin": {
|
||||
"mcp-gitlab": "build/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^5.0.2",
|
||||
"@types/node": "^22.13.10",
|
||||
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
||||
"@typescript-eslint/parser": "^8.21.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"eslint": "^9.18.0",
|
||||
"prettier": "^3.4.2",
|
||||
"ts-node": "^10.9.2",
|
||||
@ -415,6 +420,27 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/body-parser": {
|
||||
"version": "1.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz",
|
||||
"integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/connect": "*",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/connect": {
|
||||
"version": "3.4.38",
|
||||
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
|
||||
"integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",
|
||||
@ -422,6 +448,38 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/express": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.2.tgz",
|
||||
"integrity": "sha512-BtjL3ZwbCQriyb0DGw+Rt12qAXPiBTPs815lsUvtt1Grk0vLRMZNMUZ741d5rjk+UQOxfDiBZ3dxpX00vSkK3g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/body-parser": "*",
|
||||
"@types/express-serve-static-core": "^5.0.0",
|
||||
"@types/serve-static": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express-serve-static-core": {
|
||||
"version": "5.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz",
|
||||
"integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
"@types/range-parser": "*",
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/http-errors": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz",
|
||||
"integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||
@ -429,6 +487,13 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "22.13.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.14.tgz",
|
||||
@ -448,6 +513,43 @@
|
||||
"form-data": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/send": {
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/serve-static": {
|
||||
"version": "1.15.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz",
|
||||
"integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/http-errors": "*",
|
||||
"@types/node": "*",
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.33.0.tgz",
|
||||
@ -790,6 +892,48 @@
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/auto-changelog": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/auto-changelog/-/auto-changelog-2.5.0.tgz",
|
||||
"integrity": "sha512-UTnLjT7I9U2U/xkCUH5buDlp8C7g0SGChfib+iDrJkamcj5kaMqNKHNfbKJw1kthJUq8sUo3i3q2S6FzO/l/wA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^7.2.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"import-cwd": "^3.0.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"parse-github-url": "^1.0.3",
|
||||
"semver": "^7.3.5"
|
||||
},
|
||||
"bin": {
|
||||
"auto-changelog": "src/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.3"
|
||||
}
|
||||
},
|
||||
"node_modules/auto-changelog/node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
@ -817,44 +961,6 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/body-parser/node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
@ -975,6 +1081,16 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
@ -1065,12 +1181,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz",
|
||||
"integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==",
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
|
||||
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.1.2"
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
@ -1455,46 +1571,45 @@
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-5.0.1.tgz",
|
||||
"integrity": "sha512-ORF7g6qGnD+YtUG9yx4DFoqCShNMmUKiXuT5oWMHiOvt/4WFbHC6yCwQMTSBMno7AqntNCAzzcnnjowRkTL9eQ==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz",
|
||||
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.0.1",
|
||||
"body-parser": "^2.2.0",
|
||||
"content-disposition": "^1.0.0",
|
||||
"content-type": "~1.0.4",
|
||||
"cookie": "0.7.1",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.7.1",
|
||||
"cookie-signature": "^1.2.1",
|
||||
"debug": "4.3.6",
|
||||
"depd": "2.0.0",
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"finalhandler": "^2.0.0",
|
||||
"fresh": "2.0.0",
|
||||
"http-errors": "2.0.0",
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"finalhandler": "^2.1.0",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"merge-descriptors": "^2.0.0",
|
||||
"methods": "~1.1.2",
|
||||
"mime-types": "^3.0.0",
|
||||
"on-finished": "2.4.1",
|
||||
"once": "1.4.0",
|
||||
"parseurl": "~1.3.3",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.13.0",
|
||||
"range-parser": "~1.2.1",
|
||||
"router": "^2.0.0",
|
||||
"safe-buffer": "5.2.1",
|
||||
"on-finished": "^2.4.1",
|
||||
"once": "^1.4.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"qs": "^6.14.0",
|
||||
"range-parser": "^1.2.1",
|
||||
"router": "^2.2.0",
|
||||
"send": "^1.1.0",
|
||||
"serve-static": "^2.1.0",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"type-is": "^2.0.0",
|
||||
"utils-merge": "1.0.1",
|
||||
"vary": "~1.1.2"
|
||||
"serve-static": "^2.2.0",
|
||||
"statuses": "^2.0.1",
|
||||
"type-is": "^2.0.1",
|
||||
"vary": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/express-rate-limit": {
|
||||
@ -1596,6 +1711,16 @@
|
||||
"node": "^12.20 || >= 14.13"
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-cookie": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-3.1.0.tgz",
|
||||
"integrity": "sha512-s/XhhreJpqH0ftkGVcQt8JE9bqk+zRn4jF5mPJXWZeQMCI5odV9K+wEWYbnzFPHgQZlvPSMjS4n4yawWE8RINw==",
|
||||
"license": "Unlicense",
|
||||
"dependencies": {
|
||||
"set-cookie-parser": "^2.4.8",
|
||||
"tough-cookie": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
|
||||
@ -1639,29 +1764,6 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler/node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler/node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/find-up": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
||||
@ -1857,6 +1959,28 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/handlebars": {
|
||||
"version": "4.7.8",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
||||
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5",
|
||||
"neo-async": "^2.6.2",
|
||||
"source-map": "^0.6.1",
|
||||
"wordwrap": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"handlebars": "bin/handlebars"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.7"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"uglify-js": "^3.1.4"
|
||||
}
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
@ -1970,6 +2094,19 @@
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/import-cwd": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
|
||||
"integrity": "sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"import-from": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/import-fresh": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
|
||||
@ -1987,6 +2124,29 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/import-from": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/import-from/-/import-from-3.0.0.tgz",
|
||||
"integrity": "sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"resolve-from": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/import-from/node_modules/resolve-from": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
|
||||
"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
@ -2204,15 +2364,6 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/methods": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||
@ -2264,10 +2415,20 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
@ -2286,6 +2447,13 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/neo-async": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/node-domexception": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
||||
@ -2428,6 +2596,19 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/parse-github-url": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.3.tgz",
|
||||
"integrity": "sha512-tfalY5/4SqGaV/GIGzWyHnFjlpTPTNpENR9Ea2lLldSJ8EWXMsvacWucqY3m3I4YPtas15IxTLQVQ5NSYXPrww==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"parse-github-url": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||
@ -2537,12 +2718,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.13.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
|
||||
"integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.6"
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
@ -2633,29 +2814,6 @@
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/router/node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/router/node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/run-parallel": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||
@ -2741,12 +2899,6 @@
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/send/node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz",
|
||||
@ -2762,6 +2914,12 @@
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/set-cookie-parser": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
|
||||
"integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
@ -2899,6 +3057,16 @@
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sprintf-js": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
|
||||
@ -2940,6 +3108,24 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/tldts": {
|
||||
"version": "6.1.86",
|
||||
"resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz",
|
||||
"integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tldts-core": "^6.1.86"
|
||||
},
|
||||
"bin": {
|
||||
"tldts": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/tldts-core": {
|
||||
"version": "6.1.86",
|
||||
"resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz",
|
||||
"integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
@ -2962,6 +3148,25 @@
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/tough-cookie": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz",
|
||||
"integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"tldts": "^6.1.32"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ts-api-utils": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz",
|
||||
@ -3060,6 +3265,20 @@
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/uglify-js": {
|
||||
"version": "3.19.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
||||
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
"uglifyjs": "bin/uglifyjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "6.20.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
||||
@ -3085,15 +3304,6 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/utils-merge": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/v8-compile-cache-lib": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
|
||||
@ -3119,6 +3329,24 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
@ -3144,6 +3372,13 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@zereight/mcp-gitlab",
|
||||
"version": "1.0.51",
|
||||
"version": "1.0.64",
|
||||
"description": "MCP server for using the GitLab API",
|
||||
"license": "MIT",
|
||||
"author": "zereight",
|
||||
@ -21,6 +21,7 @@
|
||||
"watch": "tsc --watch",
|
||||
"deploy": "npm publish --access public",
|
||||
"generate-tools": "npx ts-node scripts/generate-tools-readme.ts",
|
||||
"changelog": "auto-changelog -p",
|
||||
"test": "node test/validate-api.js",
|
||||
"test:integration": "node test/validate-api.js",
|
||||
"lint": "eslint . --ext .ts",
|
||||
@ -30,22 +31,27 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "1.8.0",
|
||||
"form-data": "^4.0.0",
|
||||
"@types/node-fetch": "^2.6.12",
|
||||
"express": "^5.1.0",
|
||||
"fetch-cookie": "^3.1.0",
|
||||
"form-data": "^4.0.0",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.6",
|
||||
"node-fetch": "^3.3.2",
|
||||
"socks-proxy-agent": "^8.0.5",
|
||||
"tough-cookie": "^5.1.2",
|
||||
"zod-to-json-schema": "^3.23.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^5.0.2",
|
||||
"@types/node": "^22.13.10",
|
||||
"typescript": "^5.8.2",
|
||||
"zod": "^3.24.2",
|
||||
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
||||
"@typescript-eslint/parser": "^8.21.0",
|
||||
"eslint": "^9.18.0",
|
||||
"prettier": "^3.4.2",
|
||||
"ts-node": "^10.9.2"
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.8.2",
|
||||
"zod": "^3.24.2",
|
||||
"auto-changelog": "^2.4.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
### 1.0.40 (2025-05-21)
|
||||
|
||||
- Added support for listing discussions (comments/notes) on GitLab issues.
|
||||
- Example: You can now easily fetch all conversations (comments) attached to an issue via the API.
|
||||
- Related PR: [#44](https://github.com/zereight/gitlab-mcp/pull/44)
|
377
schemas.ts
377
schemas.ts
@ -94,6 +94,13 @@ export const GitLabPipelineJobSchema = z.object({
|
||||
web_url: z.string().optional(),
|
||||
});
|
||||
|
||||
// Shared base schema for various pagination options
|
||||
// See https://docs.gitlab.com/api/rest/#pagination
|
||||
export const PaginationOptionsSchema = z.object({
|
||||
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
|
||||
});
|
||||
|
||||
// Schema for listing pipelines
|
||||
export const ListPipelinesSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
@ -134,9 +141,7 @@ export const ListPipelinesSchema = z.object({
|
||||
.optional()
|
||||
.describe("Order pipelines by"),
|
||||
sort: z.enum(["asc", "desc"]).optional().describe("Sort pipelines"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Schema for getting a specific pipeline
|
||||
export const GetPipelineSchema = z.object({
|
||||
@ -153,21 +158,72 @@ export const ListPipelineJobsSchema = z.object({
|
||||
.optional()
|
||||
.describe("The scope of jobs to show"),
|
||||
include_retried: z.boolean().optional().describe("Whether to include retried jobs"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Schema for creating a new pipeline
|
||||
export const CreatePipelineSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
ref: z.string().describe("The branch or tag to run the pipeline on"),
|
||||
variables: z
|
||||
.array(
|
||||
z.object({
|
||||
key: z.string().describe("The key of the variable"),
|
||||
value: z.string().describe("The value of the variable"),
|
||||
})
|
||||
)
|
||||
.optional()
|
||||
.describe("An array of variables to use for the pipeline"),
|
||||
});
|
||||
|
||||
// Schema for retrying a pipeline
|
||||
export const RetryPipelineSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
pipeline_id: z.number().describe("The ID of the pipeline to retry"),
|
||||
});
|
||||
|
||||
// Schema for canceling a pipeline
|
||||
export const CancelPipelineSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
pipeline_id: z.number().describe("The ID of the pipeline to cancel"),
|
||||
});
|
||||
|
||||
// Schema for the input parameters for pipeline job operations
|
||||
export const GetPipelineJobOutputSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
job_id: z.number().describe("The ID of the job"),
|
||||
limit: z.number().optional().describe("Maximum number of lines to return from the end of the log (default: 1000)"),
|
||||
offset: z.number().optional().describe("Number of lines to skip from the end of the log (default: 0)"),
|
||||
});
|
||||
|
||||
// User schemas
|
||||
export const GitLabUserSchema = z.object({
|
||||
username: z.string(), // Changed from login to match GitLab API
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
avatar_url: z.string().nullable(),
|
||||
web_url: z.string(), // Changed from html_url to match GitLab API
|
||||
});
|
||||
|
||||
export const GetUsersSchema = z.object({
|
||||
usernames: z.array(z.string()).describe("Array of usernames to search for"),
|
||||
});
|
||||
|
||||
export const GitLabUsersResponseSchema = z.record(
|
||||
z.string(),
|
||||
z.object({
|
||||
id: z.number(),
|
||||
username: z.string(),
|
||||
name: z.string(),
|
||||
avatar_url: z.string().nullable(),
|
||||
web_url: z.string(),
|
||||
}).nullable()
|
||||
);
|
||||
|
||||
// Namespace related schemas
|
||||
|
||||
// Base schema for project-related operations
|
||||
const ProjectParamsSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"), // Changed from owner/repo to match GitLab API
|
||||
project_id: z.string().describe("Project ID or complete URL-encoded path to project"), // Changed from owner/repo to match GitLab API
|
||||
});
|
||||
export const GitLabNamespaceSchema = z.object({
|
||||
id: z.number(),
|
||||
@ -199,7 +255,7 @@ export const GitLabNamespaceExistsResponseSchema = z.object({
|
||||
export const GitLabOwnerSchema = z.object({
|
||||
username: z.string(), // Changed from login to match GitLab API
|
||||
id: z.number(),
|
||||
avatar_url: z.string(),
|
||||
avatar_url: z.string().nullable(),
|
||||
web_url: z.string(), // Changed from html_url to match GitLab API
|
||||
name: z.string(), // Added as GitLab includes full name
|
||||
state: z.string(), // Added as GitLab includes user state
|
||||
@ -242,14 +298,14 @@ export const GitLabRepositorySchema = z.object({
|
||||
project_access: z
|
||||
.object({
|
||||
access_level: z.number(),
|
||||
notification_level: z.number().optional(),
|
||||
notification_level: z.number().nullable().optional(),
|
||||
})
|
||||
.optional()
|
||||
.nullable(),
|
||||
group_access: z
|
||||
.object({
|
||||
access_level: z.number(),
|
||||
notification_level: z.number().optional(),
|
||||
notification_level: z.number().nullable().optional(),
|
||||
})
|
||||
.optional()
|
||||
.nullable(),
|
||||
@ -259,6 +315,7 @@ export const GitLabRepositorySchema = z.object({
|
||||
container_registry_access_level: z.string().optional(),
|
||||
issues_enabled: z.boolean().optional(),
|
||||
merge_requests_enabled: z.boolean().optional(),
|
||||
merge_requests_template: z.string().nullable().optional(),
|
||||
wiki_enabled: z.boolean().optional(),
|
||||
jobs_enabled: z.boolean().optional(),
|
||||
snippets_enabled: z.boolean().optional(),
|
||||
@ -352,8 +409,17 @@ export const GitLabCommitSchema = z.object({
|
||||
committer_name: z.string(),
|
||||
committer_email: z.string(),
|
||||
committed_date: z.string(),
|
||||
created_at: z.string().optional(), // Add created_at field
|
||||
message: z.string().optional(), // Add full message field
|
||||
web_url: z.string(), // Changed from html_url to match GitLab API
|
||||
parent_ids: z.array(z.string()), // Changed from parents to match GitLab API
|
||||
stats: z.object({
|
||||
additions: z.number().optional().nullable(),
|
||||
deletions: z.number().optional().nullable(),
|
||||
total: z.number().optional().nullable(),
|
||||
}).optional(), // Only present when with_stats=true
|
||||
trailers: z.record(z.string()).optional().default({}), // Git trailers, may be empty object
|
||||
extended_trailers: z.record(z.array(z.string())).optional().default({}), // Extended trailers, may be empty object
|
||||
});
|
||||
|
||||
// Reference schema
|
||||
@ -403,13 +469,28 @@ export const CreateMergeRequestOptionsSchema = z.object({
|
||||
description: z.string().optional(), // Changed from body to match GitLab API
|
||||
source_branch: z.string(), // Changed from head to match GitLab API
|
||||
target_branch: z.string(), // Changed from base to match GitLab API
|
||||
assignee_ids: z
|
||||
.array(z.number())
|
||||
.optional(),
|
||||
reviewer_ids: z
|
||||
.array(z.number())
|
||||
.optional(),
|
||||
labels: z.array(z.string()).optional(),
|
||||
allow_collaboration: z.boolean().optional(), // Changed from maintainer_can_modify to match GitLab API
|
||||
draft: z.boolean().optional(),
|
||||
remove_source_branch: z.boolean().optional().describe("Flag indicating if a merge request should remove the source branch when merging."),
|
||||
squash: z.boolean().optional().describe("If true, squash all commits into a single commit on merge.")
|
||||
});
|
||||
|
||||
export const CreateBranchOptionsSchema = z.object({
|
||||
name: z.string(), // Changed from ref to match GitLab API
|
||||
ref: z.string(), // The source branch/commit for the new branch
|
||||
export const GitLabDiffSchema = z.object({
|
||||
old_path: z.string(),
|
||||
new_path: z.string(),
|
||||
a_mode: z.string(),
|
||||
b_mode: z.string(),
|
||||
diff: z.string(),
|
||||
new_file: z.boolean(),
|
||||
renamed_file: z.boolean(),
|
||||
deleted_file: z.boolean(),
|
||||
});
|
||||
|
||||
// Response schemas for operations
|
||||
@ -427,6 +508,27 @@ export const GitLabSearchResponseSchema = z.object({
|
||||
items: z.array(GitLabRepositorySchema),
|
||||
});
|
||||
|
||||
// create branch schemas
|
||||
export const CreateBranchOptionsSchema = z.object({
|
||||
name: z.string(), // Changed from ref to match GitLab API
|
||||
ref: z.string(), // The source branch/commit for the new branch
|
||||
});
|
||||
|
||||
export const GitLabCompareResultSchema = z.object({
|
||||
commit: z.object({
|
||||
id: z.string().optional(),
|
||||
short_id: z.string().optional(),
|
||||
title: z.string().optional(),
|
||||
author_name: z.string().optional(),
|
||||
author_email: z.string().optional(),
|
||||
created_at: z.string().optional(),
|
||||
}).optional(),
|
||||
commits: z.array(GitLabCommitSchema),
|
||||
diffs: z.array(GitLabDiffSchema),
|
||||
compare_timeout: z.boolean().optional(),
|
||||
compare_same_ref: z.boolean().optional(),
|
||||
});
|
||||
|
||||
// Issue related schemas
|
||||
export const GitLabLabelSchema = z.object({
|
||||
id: z.number(),
|
||||
@ -443,14 +545,6 @@ export const GitLabLabelSchema = z.object({
|
||||
is_project_label: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const GitLabUserSchema = z.object({
|
||||
username: z.string(), // Changed from login to match GitLab API
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
avatar_url: z.string().nullable(),
|
||||
web_url: z.string(), // Changed from html_url to match GitLab API
|
||||
});
|
||||
|
||||
export const GitLabMilestoneSchema = z.object({
|
||||
id: z.number(),
|
||||
iid: z.number(), // Added to match GitLab API
|
||||
@ -512,7 +606,7 @@ export const GitLabForkParentSchema = z.object({
|
||||
.object({
|
||||
username: z.string(), // Changed from login to match GitLab API
|
||||
id: z.number(),
|
||||
avatar_url: z.string(),
|
||||
avatar_url: z.string().nullable(),
|
||||
})
|
||||
.optional(), // Made optional to handle cases where GitLab API doesn't include it
|
||||
web_url: z.string(), // Changed from html_url to match GitLab API
|
||||
@ -540,6 +634,7 @@ export const GitLabMergeRequestSchema = z.object({
|
||||
draft: z.boolean().optional(),
|
||||
author: GitLabUserSchema,
|
||||
assignees: z.array(GitLabUserSchema).optional(),
|
||||
reviewers: z.array(GitLabUserSchema).optional(),
|
||||
source_branch: z.string(),
|
||||
target_branch: z.string(),
|
||||
diff_refs: GitLabMergeRequestDiffRefSchema.nullable().optional(),
|
||||
@ -564,6 +659,21 @@ export const GitLabMergeRequestSchema = z.object({
|
||||
labels: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export const LineRangeSchema = z.object({
|
||||
start: z.object({
|
||||
line_code: z.string().nullable().optional().describe("CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_10_15'. Get this from GitLab diff API response, never fabricate."),
|
||||
type: z.enum(["new", "old"]).nullable().optional().describe("Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. MUST match the line_code format and old_line/new_line values."),
|
||||
old_line: z.number().nullable().optional().describe("Line number in original file (before changes). REQUIRED when type='old', NULL when type='new' (for purely added lines), can be present for context lines."),
|
||||
new_line: z.number().nullable().optional().describe("Line number in modified file (after changes). REQUIRED when type='new', NULL when type='old' (for purely deleted lines), can be present for context lines."),
|
||||
}).describe("Start line position for multiline comment range. MUST specify either old_line OR new_line (or both for context), never neither."),
|
||||
end: z.object({
|
||||
line_code: z.string().nullable().optional().describe("CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_12_17'. Must be from same file as start.line_code."),
|
||||
type: z.enum(["new", "old"]).nullable().optional().describe("Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. SHOULD MATCH start.type for consistent ranges (don't mix old/new types)."),
|
||||
old_line: z.number().nullable().optional().describe("Line number in original file (before changes). REQUIRED when type='old', NULL when type='new' (for purely added lines), can be present for context lines. MUST be >= start.old_line if both specified."),
|
||||
new_line: z.number().nullable().optional().describe("Line number in modified file (after changes). REQUIRED when type='new', NULL when type='old' (for purely deleted lines), can be present for context lines. MUST be >= start.new_line if both specified."),
|
||||
}).describe("End line position for multiline comment range. MUST specify either old_line OR new_line (or both for context), never neither. Range must be valid (end >= start)."),
|
||||
}).describe("Line range for multiline comments on GitLab merge request diffs. VALIDATION RULES: 1) line_code is critical for GitLab API success, 2) start/end must have consistent types, 3) line numbers must form valid range, 4) get line_code from GitLab diff API, never generate manually.");
|
||||
|
||||
// Discussion related schemas
|
||||
export const GitLabDiscussionNoteSchema = z.object({
|
||||
id: z.number(),
|
||||
@ -588,24 +698,24 @@ export const GitLabDiscussionNoteSchema = z.object({
|
||||
base_sha: z.string(),
|
||||
start_sha: z.string(),
|
||||
head_sha: z.string(),
|
||||
old_path: z.string(),
|
||||
new_path: z.string(),
|
||||
old_path: z.string().optional().describe("File path before change"),
|
||||
new_path: z.string().optional().describe("File path after change"),
|
||||
position_type: z.enum(["text", "image", "file"]),
|
||||
old_line: z.number().nullable(),
|
||||
new_line: z.number().nullable(),
|
||||
new_line: z.number().nullable().optional().describe("Line number in the modified file (after changes). Used for added lines and context lines. Null for deleted lines."),
|
||||
old_line: z.number().nullable().optional().describe("Line number in the original file (before changes). Used for deleted lines and context lines. Null for newly added lines."),
|
||||
line_range: z
|
||||
.object({
|
||||
start: z.object({
|
||||
line_code: z.string(),
|
||||
line_code: z.string().nullable().optional().describe("Line identifier in format: '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. Used to uniquely identify a specific line in the diff."),
|
||||
type: z.enum(["new", "old", "expanded"]),
|
||||
old_line: z.number().nullable(),
|
||||
new_line: z.number().nullable(),
|
||||
old_line: z.number().nullable().optional().describe("Line number in the original file (before changes). Null for newly added lines or unchanged context lines."),
|
||||
new_line: z.number().nullable().optional().describe("Line number in the modified file (after changes). Null for deleted lines or unchanged context lines."),
|
||||
}),
|
||||
end: z.object({
|
||||
line_code: z.string(),
|
||||
line_code: z.string().nullable().optional().describe("Line identifier in format: '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. Used to uniquely identify a specific line in the diff."),
|
||||
type: z.enum(["new", "old", "expanded"]),
|
||||
old_line: z.number().nullable(),
|
||||
new_line: z.number().nullable(),
|
||||
old_line: z.number().nullable().optional().describe("Line number in the original file (before changes). Null for newly added lines or unchanged context lines."),
|
||||
new_line: z.number().nullable().optional().describe("Line number in the modified file (after changes). Null for deleted lines or unchanged context lines."),
|
||||
}),
|
||||
})
|
||||
.nullable()
|
||||
@ -619,6 +729,24 @@ export const GitLabDiscussionNoteSchema = z.object({
|
||||
});
|
||||
export type GitLabDiscussionNote = z.infer<typeof GitLabDiscussionNoteSchema>;
|
||||
|
||||
// Reusable pagination schema for GitLab API responses.
|
||||
// See https://docs.gitlab.com/api/rest/#pagination
|
||||
export const GitLabPaginationSchema = z.object({
|
||||
x_next_page: z.number().nullable().optional(),
|
||||
x_page: z.number().optional(),
|
||||
x_per_page: z.number().optional(),
|
||||
x_prev_page: z.number().nullable().optional(),
|
||||
x_total: z.number().nullable().optional(),
|
||||
x_total_pages: z.number().nullable().optional(),
|
||||
});
|
||||
export type GitLabPagination = z.infer<typeof GitLabPaginationSchema>;
|
||||
|
||||
// Base paginated response schema that can be extended.
|
||||
// See https://docs.gitlab.com/api/rest/#pagination
|
||||
export const PaginatedResponseSchema = z.object({
|
||||
pagination: GitLabPaginationSchema.optional(),
|
||||
});
|
||||
|
||||
export const GitLabDiscussionSchema = z.object({
|
||||
id: z.string(),
|
||||
individual_note: z.boolean(),
|
||||
@ -626,10 +754,24 @@ export const GitLabDiscussionSchema = z.object({
|
||||
});
|
||||
export type GitLabDiscussion = z.infer<typeof GitLabDiscussionSchema>;
|
||||
|
||||
// Create a schema for paginated discussions response
|
||||
export const PaginatedDiscussionsResponseSchema = z.object({
|
||||
items: z.array(GitLabDiscussionSchema),
|
||||
pagination: GitLabPaginationSchema,
|
||||
});
|
||||
|
||||
// Export the paginated response type for discussions
|
||||
export type PaginatedDiscussionsResponse = z.infer<typeof PaginatedDiscussionsResponseSchema>;
|
||||
|
||||
export const ListIssueDiscussionsSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
issue_iid: z.number().describe("The internal ID of the project issue"),
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Input schema for listing merge request discussions
|
||||
export const ListMergeRequestDiscussionsSchema = ProjectParamsSchema.extend({
|
||||
merge_request_iid: z.number().describe("The IID of a merge request"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Input schema for updating a merge request discussion note
|
||||
export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
||||
@ -684,9 +826,7 @@ export const CreateOrUpdateFileSchema = ProjectParamsSchema.extend({
|
||||
|
||||
export const SearchRepositoriesSchema = z.object({
|
||||
search: z.string().describe("Search query"), // Changed from query to match GitLab API
|
||||
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
||||
per_page: z.number().optional().describe("Number of results per page (default: 20)"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
export const CreateRepositorySchema = z.object({
|
||||
name: z.string().describe("Repository name"),
|
||||
@ -729,28 +869,39 @@ export const CreateMergeRequestSchema = ProjectParamsSchema.extend({
|
||||
description: z.string().optional().describe("Merge request description"),
|
||||
source_branch: z.string().describe("Branch containing changes"),
|
||||
target_branch: z.string().describe("Branch to merge into"),
|
||||
assignee_ids: z
|
||||
.array(z.number())
|
||||
.optional()
|
||||
.describe("The ID of the users to assign the MR to"),
|
||||
reviewer_ids: z
|
||||
.array(z.number())
|
||||
.optional()
|
||||
.describe("The ID of the users to assign as reviewers of the MR"),
|
||||
labels: z.array(z.string()).optional().describe("Labels for the MR"),
|
||||
draft: z.boolean().optional().describe("Create as draft merge request"),
|
||||
allow_collaboration: z.boolean().optional().describe("Allow commits from upstream members"),
|
||||
allow_collaboration: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.describe("Allow commits from upstream members"),
|
||||
});
|
||||
|
||||
export const ForkRepositorySchema = ProjectParamsSchema.extend({
|
||||
namespace: z.string().optional().describe("Namespace to fork to (full path)"),
|
||||
});
|
||||
|
||||
// Branch related schemas
|
||||
export const CreateBranchSchema = ProjectParamsSchema.extend({
|
||||
branch: z.string().describe("Name for the new branch"),
|
||||
ref: z.string().optional().describe("Source branch/commit for new branch"),
|
||||
});
|
||||
|
||||
export const GitLabMergeRequestDiffSchema = z.object({
|
||||
old_path: z.string(),
|
||||
new_path: z.string(),
|
||||
a_mode: z.string(),
|
||||
b_mode: z.string(),
|
||||
diff: z.string(),
|
||||
new_file: z.boolean(),
|
||||
renamed_file: z.boolean(),
|
||||
deleted_file: z.boolean(),
|
||||
export const GetBranchDiffsSchema = ProjectParamsSchema.extend({
|
||||
from: z.string().describe("The base branch or commit SHA to compare from"),
|
||||
to: z.string().describe("The target branch or commit SHA to compare to"),
|
||||
straight: z.boolean().optional().describe("Comparison method: false for '...' (default), true for '--'"),
|
||||
excluded_file_patterns: z.array(z.string()).optional().describe(
|
||||
"Array of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: [\"^test/mocks/\", \"\\.spec\\.ts$\", \"package-lock\\.json\"]"
|
||||
),
|
||||
});
|
||||
|
||||
export const GetMergeRequestSchema = ProjectParamsSchema.extend({
|
||||
@ -780,6 +931,12 @@ export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
||||
view: z.enum(["inline", "parallel"]).optional().describe("Diff view type"),
|
||||
});
|
||||
|
||||
export const ListMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
||||
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
|
||||
unidiff: z.boolean().optional().describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
|
||||
});
|
||||
|
||||
export const CreateNoteSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or namespace/project_path"),
|
||||
noteable_type: z
|
||||
@ -793,17 +950,17 @@ export const CreateNoteSchema = z.object({
|
||||
export const ListIssuesSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
assignee_id: z.number().optional().describe("Return issues assigned to the given user ID"),
|
||||
assignee_username: z.string().optional().describe("Return issues assigned to the given username"),
|
||||
assignee_username: z.array(z.string()).optional().describe("Return issues assigned to the given username"),
|
||||
author_id: z.number().optional().describe("Return issues created by the given user ID"),
|
||||
author_username: z.string().optional().describe("Return issues created by the given username"),
|
||||
confidential: z.boolean().optional().describe("Filter confidential or public issues"),
|
||||
created_after: z.string().optional().describe("Return issues created after the given time"),
|
||||
created_before: z.string().optional().describe("Return issues created before the given time"),
|
||||
due_date: z.string().optional().describe("Return issues that have the due date"),
|
||||
label_name: z.array(z.string()).optional().describe("Array of label names"),
|
||||
labels: z.array(z.string()).optional().describe("Array of label names"),
|
||||
milestone: z.string().optional().describe("Milestone title"),
|
||||
scope: z
|
||||
.enum(["created-by-me", "assigned-to-me", "all"])
|
||||
.enum(["created_by_me", "assigned_to_me", "all"])
|
||||
.optional()
|
||||
.describe("Return issues from a specific scope"),
|
||||
search: z.string().optional().describe("Search for specific terms"),
|
||||
@ -814,9 +971,7 @@ export const ListIssuesSchema = z.object({
|
||||
updated_after: z.string().optional().describe("Return issues updated after the given time"),
|
||||
updated_before: z.string().optional().describe("Return issues updated before the given time"),
|
||||
with_labels_details: z.boolean().optional().describe("Return more details for each label"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Merge Requests API operation schemas
|
||||
export const ListMergeRequestsSchema = z.object({
|
||||
@ -887,9 +1042,7 @@ export const ListMergeRequestsSchema = z.object({
|
||||
.describe("Return merge requests from a specific source branch"),
|
||||
wip: z.enum(["yes", "no"]).optional().describe("Filter merge requests against their wip status"),
|
||||
with_labels_details: z.boolean().optional().describe("Return more details for each label"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
export const GetIssueSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
@ -928,21 +1081,6 @@ export const ListIssueLinksSchema = z.object({
|
||||
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
||||
});
|
||||
|
||||
export const ListIssueDiscussionsSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
issue_iid: z.number().describe("The internal ID of the project issue"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page"),
|
||||
sort: z
|
||||
.enum(["asc", "desc"])
|
||||
.optional()
|
||||
.describe("Return issue discussions sorted in ascending or descending order"),
|
||||
order_by: z
|
||||
.enum(["created_at", "updated_at"])
|
||||
.optional()
|
||||
.describe("Return issue discussions ordered by created_at or updated_at fields"),
|
||||
});
|
||||
|
||||
export const GetIssueLinkSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
||||
@ -969,10 +1107,8 @@ export const DeleteIssueLinkSchema = z.object({
|
||||
// Namespace API operation schemas
|
||||
export const ListNamespacesSchema = z.object({
|
||||
search: z.string().optional().describe("Search term for namespaces"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page"),
|
||||
owned: z.boolean().optional().describe("Filter for namespaces owned by current user"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
export const GetNamespaceSchema = z.object({
|
||||
namespace_id: z.string().describe("Namespace ID or full path"),
|
||||
@ -989,8 +1125,6 @@ export const GetProjectSchema = z.object({
|
||||
|
||||
export const ListProjectsSchema = z.object({
|
||||
search: z.string().optional().describe("Search term for projects"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page"),
|
||||
search_namespaces: z.boolean().optional().describe("Needs to be true if search is full path"),
|
||||
owned: z.boolean().optional().describe("Filter for projects owned by current user"),
|
||||
membership: z.boolean().optional().describe("Filter for projects where current user is a member"),
|
||||
@ -1017,7 +1151,7 @@ export const ListProjectsSchema = z.object({
|
||||
.optional()
|
||||
.describe("Filter projects with merge requests feature enabled"),
|
||||
min_access_level: z.number().optional().describe("Filter by minimum access level"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Label operation schemas
|
||||
export const ListLabelsSchema = z.object({
|
||||
@ -1073,8 +1207,6 @@ export const ListGroupProjectsSchema = z.object({
|
||||
.optional()
|
||||
.describe("Field to sort by"),
|
||||
sort: z.enum(["asc", "desc"]).optional().describe("Sort direction"),
|
||||
page: z.number().optional().describe("Page number"),
|
||||
per_page: z.number().optional().describe("Number of results per page"),
|
||||
archived: z.boolean().optional().describe("Filter for archived projects"),
|
||||
visibility: z
|
||||
.enum(["public", "internal", "private"])
|
||||
@ -1094,14 +1226,14 @@ export const ListGroupProjectsSchema = z.object({
|
||||
statistics: z.boolean().optional().describe("Include project statistics"),
|
||||
with_custom_attributes: z.boolean().optional().describe("Include custom attributes"),
|
||||
with_security_reports: z.boolean().optional().describe("Include security reports"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Add wiki operation schemas
|
||||
export const ListWikiPagesSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page"),
|
||||
});
|
||||
with_content: z.boolean().optional().describe("Include content of the wiki pages"),
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
export const GetWikiPageSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
slug: z.string().describe("URL-encoded slug of the wiki page"),
|
||||
@ -1119,6 +1251,7 @@ export const UpdateWikiPageSchema = z.object({
|
||||
content: z.string().optional().describe("New content of the wiki page"),
|
||||
format: z.string().optional().describe("Content format, e.g., markdown, rdoc"),
|
||||
});
|
||||
|
||||
export const DeleteWikiPageSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or URL-encoded path"),
|
||||
slug: z.string().describe("URL-encoded slug of the wiki page"),
|
||||
@ -1129,25 +1262,26 @@ export const GitLabWikiPageSchema = z.object({
|
||||
title: z.string(),
|
||||
slug: z.string(),
|
||||
format: z.string(),
|
||||
content: z.string(),
|
||||
content: z.string().optional(),
|
||||
created_at: z.string().optional(),
|
||||
updated_at: z.string().optional(),
|
||||
});
|
||||
|
||||
// Merge Request Thread position schema - used for diff notes
|
||||
export const MergeRequestThreadPositionSchema = z.object({
|
||||
base_sha: z.string().describe("Base commit SHA in the source branch"),
|
||||
head_sha: z.string().describe("SHA referencing HEAD of the source branch"),
|
||||
start_sha: z.string().describe("SHA referencing the start commit of the source branch"),
|
||||
position_type: z.enum(["text", "image", "file"]).describe("Type of position reference"),
|
||||
new_path: z.string().optional().describe("File path after change"),
|
||||
old_path: z.string().optional().describe("File path before change"),
|
||||
new_line: z.number().nullable().optional().describe("Line number after change"),
|
||||
old_line: z.number().nullable().optional().describe("Line number before change"),
|
||||
width: z.number().optional().describe("Width of the image (for image diffs)"),
|
||||
height: z.number().optional().describe("Height of the image (for image diffs)"),
|
||||
x: z.number().optional().describe("X coordinate on the image (for image diffs)"),
|
||||
y: z.number().optional().describe("Y coordinate on the image (for image diffs)"),
|
||||
base_sha: z.string().describe("REQUIRED: Base commit SHA in the source branch. Get this from merge request diff_refs.base_sha."),
|
||||
head_sha: z.string().describe("REQUIRED: SHA referencing HEAD of the source branch. Get this from merge request diff_refs.head_sha."),
|
||||
start_sha: z.string().describe("REQUIRED: SHA referencing the start commit of the source branch. Get this from merge request diff_refs.start_sha."),
|
||||
position_type: z.enum(["text", "image", "file"]).describe("REQUIRED: Position type. Use 'text' for code diffs, 'image' for image diffs, 'file' for file-level comments."),
|
||||
new_path: z.string().optional().describe("File path after changes. REQUIRED for most diff comments. Use same as old_path if file wasn't renamed."),
|
||||
old_path: z.string().optional().describe("File path before changes. REQUIRED for most diff comments. Use same as new_path if file wasn't renamed."),
|
||||
new_line: z.number().nullable().optional().describe("Line number in modified file (after changes). Use for added lines or context lines. NULL for deleted lines. For single-line comments on new lines."),
|
||||
old_line: z.number().nullable().optional().describe("Line number in original file (before changes). Use for deleted lines or context lines. NULL for added lines. For single-line comments on old lines."),
|
||||
line_range: LineRangeSchema.optional().describe("MULTILINE COMMENTS: Specify start/end line positions for commenting on multiple lines. Alternative to single old_line/new_line."),
|
||||
width: z.number().optional().describe("IMAGE DIFFS ONLY: Width of the image (for position_type='image')."),
|
||||
height: z.number().optional().describe("IMAGE DIFFS ONLY: Height of the image (for position_type='image')."),
|
||||
x: z.number().optional().describe("IMAGE DIFFS ONLY: X coordinate on the image (for position_type='image')."),
|
||||
y: z.number().optional().describe("IMAGE DIFFS ONLY: Y coordinate on the image (for position_type='image')."),
|
||||
});
|
||||
|
||||
// Schema for creating a new merge request thread
|
||||
@ -1185,9 +1319,7 @@ export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
|
||||
.string()
|
||||
.optional()
|
||||
.describe("Return milestones updated after the specified date (ISO 8601 format)"),
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
||||
});
|
||||
}).merge(PaginationOptionsSchema);
|
||||
|
||||
// Schema for getting a single milestone
|
||||
export const GetProjectMilestoneSchema = ProjectParamsSchema.extend({
|
||||
@ -1221,18 +1353,40 @@ export const DeleteProjectMilestoneSchema = GetProjectMilestoneSchema;
|
||||
export const GetMilestoneIssuesSchema = GetProjectMilestoneSchema;
|
||||
|
||||
// Schema for getting merge requests assigned to a milestone
|
||||
export const GetMilestoneMergeRequestsSchema = GetProjectMilestoneSchema.extend({
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
||||
});
|
||||
export const GetMilestoneMergeRequestsSchema = GetProjectMilestoneSchema.merge(PaginationOptionsSchema);
|
||||
|
||||
// Schema for promoting a project milestone to a group milestone
|
||||
export const PromoteProjectMilestoneSchema = GetProjectMilestoneSchema;
|
||||
|
||||
// Schema for getting burndown chart events for a milestone
|
||||
export const GetMilestoneBurndownEventsSchema = GetProjectMilestoneSchema.extend({
|
||||
page: z.number().optional().describe("Page number for pagination"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max 100)"),
|
||||
export const GetMilestoneBurndownEventsSchema = GetProjectMilestoneSchema.merge(PaginationOptionsSchema);
|
||||
|
||||
// Add schemas for commit operations
|
||||
export const ListCommitsSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
|
||||
ref_name: z.string().optional().describe("The name of a repository branch, tag or revision range, or if not given the default branch"),
|
||||
since: z.string().optional().describe("Only commits after or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ"),
|
||||
until: z.string().optional().describe("Only commits before or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ"),
|
||||
path: z.string().optional().describe("The file path"),
|
||||
author: z.string().optional().describe("Search commits by commit author"),
|
||||
all: z.boolean().optional().describe("Retrieve every commit from the repository"),
|
||||
with_stats: z.boolean().optional().describe("Stats about each commit are added to the response"),
|
||||
first_parent: z.boolean().optional().describe("Follow only the first parent commit upon seeing a merge commit"),
|
||||
order: z.enum(["default", "topo"]).optional().describe("List commits in order"),
|
||||
trailers: z.boolean().optional().describe("Parse and include Git trailers for every commit"),
|
||||
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
||||
per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
|
||||
});
|
||||
|
||||
export const GetCommitSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
|
||||
sha: z.string().describe("The commit hash or name of a repository branch or tag"),
|
||||
stats: z.boolean().optional().describe("Include commit stats"),
|
||||
});
|
||||
|
||||
export const GetCommitDiffSchema = z.object({
|
||||
project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
|
||||
sha: z.string().describe("The commit hash or name of a repository branch or tag"),
|
||||
});
|
||||
|
||||
// Export types
|
||||
@ -1247,6 +1401,7 @@ export type GitLabDirectoryContent = z.infer<typeof GitLabDirectoryContentSchema
|
||||
export type GitLabContent = z.infer<typeof GitLabContentSchema>;
|
||||
export type FileOperation = z.infer<typeof FileOperationSchema>;
|
||||
export type GitLabTree = z.infer<typeof GitLabTreeSchema>;
|
||||
export type GitLabCompareResult = z.infer<typeof GitLabCompareResultSchema>;
|
||||
export type GitLabCommit = z.infer<typeof GitLabCommitSchema>;
|
||||
export type GitLabReference = z.infer<typeof GitLabReferenceSchema>;
|
||||
export type CreateRepositoryOptions = z.infer<typeof CreateRepositoryOptionsSchema>;
|
||||
@ -1255,10 +1410,13 @@ export type CreateMergeRequestOptions = z.infer<typeof CreateMergeRequestOptions
|
||||
export type CreateBranchOptions = z.infer<typeof CreateBranchOptionsSchema>;
|
||||
export type GitLabCreateUpdateFileResponse = z.infer<typeof GitLabCreateUpdateFileResponseSchema>;
|
||||
export type GitLabSearchResponse = z.infer<typeof GitLabSearchResponseSchema>;
|
||||
export type GitLabMergeRequestDiff = z.infer<typeof GitLabMergeRequestDiffSchema>;
|
||||
export type GitLabMergeRequestDiff = z.infer<
|
||||
typeof GitLabDiffSchema
|
||||
>;
|
||||
export type CreateNoteOptions = z.infer<typeof CreateNoteSchema>;
|
||||
export type GitLabIssueLink = z.infer<typeof GitLabIssueLinkSchema>;
|
||||
export type ListIssueDiscussionsOptions = z.infer<typeof ListIssueDiscussionsSchema>;
|
||||
export type ListMergeRequestDiscussionsOptions = z.infer<typeof ListMergeRequestDiscussionsSchema>;
|
||||
export type UpdateIssueNoteOptions = z.infer<typeof UpdateIssueNoteSchema>;
|
||||
export type CreateIssueNoteOptions = z.infer<typeof CreateIssueNoteSchema>;
|
||||
export type GitLabNamespace = z.infer<typeof GitLabNamespaceSchema>;
|
||||
@ -1281,6 +1439,9 @@ export type GitLabPipeline = z.infer<typeof GitLabPipelineSchema>;
|
||||
export type ListPipelinesOptions = z.infer<typeof ListPipelinesSchema>;
|
||||
export type GetPipelineOptions = z.infer<typeof GetPipelineSchema>;
|
||||
export type ListPipelineJobsOptions = z.infer<typeof ListPipelineJobsSchema>;
|
||||
export type CreatePipelineOptions = z.infer<typeof CreatePipelineSchema>;
|
||||
export type RetryPipelineOptions = z.infer<typeof RetryPipelineSchema>;
|
||||
export type CancelPipelineOptions = z.infer<typeof CancelPipelineSchema>;
|
||||
export type GitLabMilestones = z.infer<typeof GitLabMilestonesSchema>;
|
||||
export type ListProjectMilestonesOptions = z.infer<typeof ListProjectMilestonesSchema>;
|
||||
export type GetProjectMilestoneOptions = z.infer<typeof GetProjectMilestoneSchema>;
|
||||
@ -1291,3 +1452,9 @@ export type GetMilestoneIssuesOptions = z.infer<typeof GetMilestoneIssuesSchema>
|
||||
export type GetMilestoneMergeRequestsOptions = z.infer<typeof GetMilestoneMergeRequestsSchema>;
|
||||
export type PromoteProjectMilestoneOptions = z.infer<typeof PromoteProjectMilestoneSchema>;
|
||||
export type GetMilestoneBurndownEventsOptions = z.infer<typeof GetMilestoneBurndownEventsSchema>;
|
||||
export type GitLabUser = z.infer<typeof GitLabUserSchema>;
|
||||
export type GitLabUsersResponse = z.infer<typeof GitLabUsersResponseSchema>;
|
||||
export type PaginationOptions = z.infer<typeof PaginationOptionsSchema>;
|
||||
export type ListCommitsOptions = z.infer<typeof ListCommitsSchema>;
|
||||
export type GetCommitOptions = z.infer<typeof GetCommitSchema>;
|
||||
export type GetCommitDiffOptions = z.infer<typeof GetCommitDiffSchema>;
|
||||
|
38
scripts/create-github-release.sh
Executable file
38
scripts/create-github-release.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Extract version from package.json
|
||||
VERSION=$(jq -r .version package.json)
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Could not read version from package.json."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if release notes file exists
|
||||
if [ ! -f RELEASE_NOTES.md ]; then
|
||||
echo "RELEASE_NOTES.md file does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate RELEASE_NOTES.md from CHANGELOG.md for the current version
|
||||
node <<'EOF'
|
||||
const fs = require('fs');
|
||||
const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
|
||||
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||
const version = pkg.version;
|
||||
|
||||
const regex = new RegExp(`## \\[${version.replace(/\./g, '\\.')}\\][\\s\\S]*?(?=\\n## |\\n?$)`, 'g');
|
||||
const match = changelog.match(regex);
|
||||
|
||||
if (match && match[0]) {
|
||||
fs.writeFileSync('RELEASE_NOTES.md', match[0].trim() + '\n');
|
||||
console.log('RELEASE_NOTES.md generated for version', version);
|
||||
} else {
|
||||
console.error('No changelog entry found for version', version);
|
||||
process.exit(1);
|
||||
}
|
||||
EOF
|
||||
|
||||
# Create GitHub release using CLI
|
||||
gh release create "$VERSION" -t "Release $VERSION" -F RELEASE_NOTES.md
|
@ -10,9 +10,9 @@ IMAGE_NAME=gitlab-mcp
|
||||
IMAGE_VERSION=$(jq -r '.version' package.json)
|
||||
|
||||
echo "${DOCKER_USER}/${IMAGE_NAME}:${IMAGE_VERSION}"
|
||||
docker build --platform=linux/arm64 -t "${DOCKER_USER}/${IMAGE_NAME}:latest" .
|
||||
|
||||
docker tag "${DOCKER_USER}/${IMAGE_NAME}:latest" "${DOCKER_USER}/${IMAGE_NAME}:${IMAGE_VERSION}"
|
||||
|
||||
docker push "${DOCKER_USER}/${IMAGE_NAME}:latest"
|
||||
docker push "${DOCKER_USER}/${IMAGE_NAME}:${IMAGE_VERSION}"
|
||||
docker buildx build --platform linux/arm64,linux/amd64 \
|
||||
-t "${DOCKER_USER}/${IMAGE_NAME}:latest" \
|
||||
-t "${DOCKER_USER}/${IMAGE_NAME}:${IMAGE_VERSION}" \
|
||||
--push \
|
||||
.
|
||||
|
@ -43,9 +43,15 @@ async function validateGitLabAPI() {
|
||||
url: `${GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(TEST_PROJECT_ID)}/repository/branches?per_page=1`,
|
||||
validate: data => Array.isArray(data),
|
||||
},
|
||||
{
|
||||
name: "List pipelines",
|
||||
url: `${GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(TEST_PROJECT_ID)}/pipelines?per_page=5`,
|
||||
validate: data => Array.isArray(data),
|
||||
},
|
||||
];
|
||||
|
||||
let allPassed = true;
|
||||
let firstPipelineId = null;
|
||||
|
||||
for (const test of tests) {
|
||||
try {
|
||||
@ -65,6 +71,11 @@ async function validateGitLabAPI() {
|
||||
|
||||
if (test.validate(data)) {
|
||||
console.log(`✅ ${test.name} - PASSED\n`);
|
||||
|
||||
// If we found pipelines, save the first one for additional testing
|
||||
if (test.name === "List pipelines" && data.length > 0) {
|
||||
firstPipelineId = data[0].id;
|
||||
}
|
||||
} else {
|
||||
console.log(`❌ ${test.name} - FAILED (invalid response format)\n`);
|
||||
allPassed = false;
|
||||
@ -76,6 +87,53 @@ async function validateGitLabAPI() {
|
||||
}
|
||||
}
|
||||
|
||||
// Test pipeline-specific endpoints if we have a pipeline ID
|
||||
if (firstPipelineId) {
|
||||
console.log(`Found pipeline #${firstPipelineId}, testing pipeline-specific endpoints...\n`);
|
||||
|
||||
const pipelineTests = [
|
||||
{
|
||||
name: `Get pipeline #${firstPipelineId} details`,
|
||||
url: `${GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(TEST_PROJECT_ID)}/pipelines/${firstPipelineId}`,
|
||||
validate: data => data.id === firstPipelineId && data.status,
|
||||
},
|
||||
{
|
||||
name: `List pipeline #${firstPipelineId} jobs`,
|
||||
url: `${GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(TEST_PROJECT_ID)}/pipelines/${firstPipelineId}/jobs`,
|
||||
validate: data => Array.isArray(data),
|
||||
},
|
||||
];
|
||||
|
||||
for (const test of pipelineTests) {
|
||||
try {
|
||||
console.log(`Testing: ${test.name}`);
|
||||
const response = await fetch(test.url, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${GITLAB_TOKEN}`,
|
||||
Accept: "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (test.validate(data)) {
|
||||
console.log(`✅ ${test.name} - PASSED\n`);
|
||||
} else {
|
||||
console.log(`❌ ${test.name} - FAILED (invalid response format)\n`);
|
||||
allPassed = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`❌ ${test.name} - FAILED`);
|
||||
console.log(` Error: ${error.message}\n`);
|
||||
allPassed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (allPassed) {
|
||||
console.log("✅ All API validation tests passed!");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user