Compare commits

..

22 Commits

Author SHA1 Message Date
2a80988a02 [main] chore: v1.0.48 버전 업데이트
📝 Details:
- Milestone Management Tools 추가 (PR #59)
- Docker Image Push Script 추가 (PR #60)
- package.json 버전 업데이트
- CHANGELOG.md 업데이트
2025-05-29 19:56:37 +09:00
5762b32a69 feat: add milestone management commands to README
🚀 Breaking Changes:
- Introduced new commands for milestone management in GitLab.

📝 Details:
- Added commands: list_milestones, get_milestone, create_milestone, edit_milestone, delete_milestone, get_milestone_issue, get_milestone_merge_requests, promote_milestone, get_milestone_burndown_events.
2025-05-29 19:53:19 +09:00
55e7ca3100 Merge pull request #59 from VinceCYLiao/feat/add-tools-for-milestones
feat: add tools for milestones
2025-05-29 19:52:36 +09:00
953f748e0d Merge pull request #60 from zereight/feat/docker_image_push
FEAT: docker image push script
2025-05-29 19:51:48 +09:00
0b876ebff6 FEAT: docker image push script 2025-05-29 16:46:53 +09:00
fd1c8b9704 feat: add tools for milestones 2025-05-29 15:10:12 +08:00
a2c2ac185a [main] release: v1.0.47
📝 Details:
- 버전을 1.0.47로 업데이트
- CHANGELOG에 새로운 기능과 버그 수정 사항 추가
  - list_merge_requests 기능 추가 (#56)
  - GitLabUserSchema의 avatar_url nullable 처리 (#55)
  - GitLabPipelineSchema의 illustration nullable 처리 (#58)
2025-05-29 09:13:43 +09:00
2462168697 Merge pull request #58 from zereight/fix/illustration-nullable
fix(schemas): make illustration nullable in GitLabPipelineSchema
2025-05-29 09:09:16 +09:00
88af65fcd0 Merge pull request #56 from jwang-sue/feature/list-merge-requests
feat: implement list_merge_requests functionality
2025-05-29 09:09:05 +09:00
0b55cc3cee Merge pull request #55 from svengt/fix/avatar-url-nullable
fix(schemas): make avatar_url nullable in GitLabUserSchema
2025-05-29 09:08:41 +09:00
40e39d7b36 fix(schemas): make illustration nullable in GitLabPipelineSchema 2025-05-29 04:35:29 +09:00
cc847772f1 feat: implement list_merge_requests functionality
- Add ListMergeRequestsSchema with comprehensive filtering options
- Implement listMergeRequests function following GitLab API
- Add tool definition and switch case handler
- Include in readOnlyTools array
- Update README.md with new tool documentation
2025-05-28 17:22:40 +02:00
ab571d211d fix(schemas): make avatar_url nullable in GitLabUserSchema
Users without profile pictures have null avatar_url values in GitLab API responses.
This change prevents errors when calling get_issue tool.
2025-05-28 15:44:15 +02:00
f8b1444afd [main] fix: description null error handling
📝 Details:
- GitLab issues/milestones의 null description 처리
- schemas.ts에서 description을 nullable로 변경
2025-05-27 12:25:31 +09:00
06f9437329 Merge pull request #53 from zereight/fix/51-description-nullable
FIX: description null error
2025-05-27 12:20:39 +09:00
dc99f864ca FIX: description null error 2025-05-27 02:00:36 +09:00
8ba33986f3 [main] docs: update changelog for v1.0.45 pipeline tools
🚀 Breaking Changes:
- None

📝 Details:
- Added 5 new pipeline management tools
- Pipeline status monitoring and analysis support
2025-05-24 21:02:58 +09:00
64a936446e [release] feat: update version to 1.0.45
🚀 Breaking Changes:
- Version updated from 1.0.44 to 1.0.45
2025-05-24 20:57:15 +09:00
8ab0ac7145 Merge pull request #52 from vicendominguez/main
feat(release): 1.0.44  adds pipeline jobs tool
2025-05-24 20:55:55 +09:00
ea06c21f29 feat(release): 1.0.44 adds pipeline jobs tool 2025-05-24 13:31:47 +02:00
140620397b chore(release): 1.0.43 - get_repository_tree is added read_only_mode 2025-05-23 00:41:56 +09:00
3d7aa8035d docs: translate issue notes changelog from Korean to English 2025-05-22 21:28:34 +09:00
7 changed files with 1187 additions and 31 deletions

View File

@ -1,12 +1,82 @@
## [1.0.48] - 2025-05-29
### Added
- 🎯 **Milestone Management Tools**: Added comprehensive milestone management functionality
- `create_milestone`: Create new milestones for GitLab projects
- `update_milestone`: Update existing milestone properties (title, description, dates, state)
- `delete_milestone`: Delete milestones from projects
- `list_milestones`: List and filter project milestones
- `get_milestone`: Get detailed information about specific milestones
- See: [PR #59](https://github.com/zereight/gitlab-mcp/pull/59)
### Fixed
- 🐳 **Docker Image Push Script**: Added automated Docker image push script for easier deployment
- Simplifies the Docker image build and push process
- See: [PR #60](https://github.com/zereight/gitlab-mcp/pull/60)
---
## [1.0.47] - 2025-05-29
### Added
- 🔄 **List Merge Requests Tool**: Added functionality to list and filter merge requests in GitLab projects
- `list_merge_requests`: List merge requests with comprehensive filtering options
- Supports filtering by state, scope, author, assignee, reviewer, labels, and more
- Includes pagination support for large result sets
- See: [PR #56](https://github.com/zereight/gitlab-mcp/pull/56)
### Fixed
- Fixed issue where GitLab users without profile pictures would cause JSON-RPC errors
- Changed `avatar_url` field to be nullable in GitLabUserSchema
- This allows proper handling of users without avatars in GitLab API responses
- See: [PR #55](https://github.com/zereight/gitlab-mcp/pull/55)
- Fixed issue where GitLab pipelines without illustrations would cause JSON-RPC errors
- Changed `illustration` field to be nullable in GitLabPipelineSchema
- This allows proper handling of pipelines without illustrations
- See: [PR #58](https://github.com/zereight/gitlab-mcp/pull/58), [Issue #57](https://github.com/zereight/gitlab-mcp/issues/57)
---
## [1.0.46] - 2025-05-27
### Fixed
- Fixed issue where GitLab issues and milestones with null descriptions would cause JSON-RPC errors
- Changed `description` field to be nullable with default empty string in schemas
- This allows proper handling of GitLab issues/milestones without descriptions
- See: [PR #53](https://github.com/zereight/gitlab-mcp/pull/53), [Issue #51](https://github.com/zereight/gitlab-mcp/issues/51)
---
## [1.0.45] - 2025-05-24
### Added
- 🔄 **Pipeline Management Tools**: Added GitLab pipeline status monitoring and management functionality
- `list_pipelines`: List project pipelines with various filtering options
- `get_pipeline`: Get detailed information about a specific pipeline
- `list_pipeline_jobs`: List all jobs in a specific pipeline
- `get_pipeline_job`: Get detailed information about a specific pipeline job
- `get_pipeline_job_output`: Get execution logs/output from pipeline jobs
- 📊 Pipeline status summary and analysis support
- Example: "How many of the last N pipelines are successful?"
- Example: "Can you make a summary of the output in the last pipeline?"
- See: [PR #52](https://github.com/zereight/gitlab-mcp/pull/52)
---
## [1.0.42] - 2025-05-22
### Added
- 이슈(issues)에 노트(note)를 생성하고 수정할 수 있는 기능이 추가되었습니다.
- 이제 버그나 할 일 같은 이슈에도 댓글(메모)을 달거나, 이미 단 댓글을 고칠 수 있습니다.
- 예시: "버그를 고쳤어요!"라는 댓글을 이슈에 달 수 있고, 필요하면 "버그를 완전히 고쳤어요!"로 바꿀 수 있습니다.
- 함수형 프로그래밍 원칙과 SOLID 원칙을 준수하여, 코드의 재사용성과 유지보수성이 높아졌습니다.
- 출처: [PR #47](https://github.com/zereight/gitlab-mcp/pull/47)
- Added support for creating and updating issue notes (comments) in GitLab.
- You can now add or edit comments on issues.
- See: [PR #47](https://github.com/zereight/gitlab-mcp/pull/47)
---

View File

@ -52,7 +52,7 @@ When using with the Claude App, you need to set up your API key and URLs directl
"GITLAB_READ_ONLY_MODE",
"-e",
"USE_GITLAB_WIKI",
"nkwd/gitlab-mcp"
"iwakitakuma/gitlab-mcp"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
@ -65,6 +65,12 @@ When using with the Claude App, you need to set up your API key and URLs directl
}
```
#### Docker Image Push
```shell
$ sh scripts/image_push.sh docker_user_name
```
### Environment Variables
- `GITLAB_PERSONAL_ACCESS_TOKEN`: Your GitLab personal access token.
@ -75,7 +81,6 @@ When using with the Claude App, you need to set up your API key and URLs directl
## Tools 🛠️
+<!-- TOOLS-START -->
1. `create_or_update_file` - Create or update a single file in a GitLab project
2. `search_repositories` - Search for GitLab projects
3. `create_repository` - Create a new GitLab project
@ -93,7 +98,7 @@ When using with the Claude App, you need to set up your API key and URLs directl
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` - Update the content of an existing issue note
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
@ -121,4 +126,19 @@ When using with the Claude App, you need to set up your API key and URLs directl
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
<!-- TOOLS-END -->

799
index.ts
View File

@ -17,7 +17,6 @@ import { fileURLToPath } from "url";
import { dirname } from "path";
import fs from "fs";
import path from "path";
// Add type imports for proxy agents
import { Agent } from "http";
import { URL } from "url";
@ -84,6 +83,15 @@ import {
UpdateWikiPageSchema,
DeleteWikiPageSchema,
GitLabWikiPageSchema,
GetRepositoryTreeSchema,
GitLabTreeItemSchema,
GitLabPipelineSchema,
GetPipelineSchema,
ListPipelinesSchema,
ListPipelineJobsSchema,
// pipeline job schemas
GetPipelineJobOutputSchema,
GitLabPipelineJobSchema,
// Discussion Schemas
GitLabDiscussionNoteSchema, // Added
GitLabDiscussionSchema,
@ -108,6 +116,21 @@ import {
type GitLabNamespaceExistsResponse,
type GitLabProject,
type GitLabLabel,
type GitLabPipeline,
type ListPipelinesOptions,
type GetPipelineOptions,
type ListPipelineJobsOptions,
type GitLabPipelineJob,
type GitLabMilestones,
type ListProjectMilestonesOptions,
type GetProjectMilestoneOptions,
type CreateProjectMilestoneOptions,
type EditProjectMilestoneOptions,
type DeleteProjectMilestoneOptions,
type GetMilestoneIssuesOptions,
type GetMilestoneMergeRequestsOptions,
type PromoteProjectMilestoneOptions,
type GetMilestoneBurndownEventsOptions,
// Discussion Types
type GitLabDiscussionNote, // Added
type GitLabDiscussion,
@ -117,12 +140,21 @@ import {
type UpdateWikiPageOptions,
type DeleteWikiPageOptions,
type GitLabWikiPage,
GitLabTreeItemSchema,
GetRepositoryTreeSchema,
type GitLabTreeItem,
type GetRepositoryTreeOptions,
UpdateIssueNoteSchema,
CreateIssueNoteSchema,
ListMergeRequestsSchema,
GitLabMilestonesSchema,
ListProjectMilestonesSchema,
GetProjectMilestoneSchema,
CreateProjectMilestoneSchema,
EditProjectMilestoneSchema,
DeleteProjectMilestoneSchema,
GetMilestoneIssuesSchema,
GetMilestoneMergeRequestsSchema,
PromoteProjectMilestoneSchema,
GetMilestoneBurndownEventsSchema,
} from "./schemas.js";
/**
@ -430,6 +462,81 @@ const allTools = [
"Get the repository tree for a GitLab project (list files and directories)",
inputSchema: zodToJsonSchema(GetRepositoryTreeSchema),
},
{
name: "list_pipelines",
description: "List pipelines in a GitLab project with filtering options",
inputSchema: zodToJsonSchema(ListPipelinesSchema),
},
{
name: "get_pipeline",
description: "Get details of a specific pipeline in a GitLab project",
inputSchema: zodToJsonSchema(GetPipelineSchema),
},
{
name: "list_pipeline_jobs",
description: "List all jobs in a specific pipeline",
inputSchema: zodToJsonSchema(ListPipelineJobsSchema),
},
{
name: "get_pipeline_job",
description: "Get details of a GitLab pipeline job number",
inputSchema: zodToJsonSchema(GetPipelineJobOutputSchema),
},
{
name: "get_pipeline_job_output",
description: "Get the output/trace of a GitLab pipeline job number",
inputSchema: zodToJsonSchema(GetPipelineJobOutputSchema),
},
{
name: "list_merge_requests",
description: "List merge requests in a GitLab project with filtering options",
inputSchema: zodToJsonSchema(ListMergeRequestsSchema),
},
{
name: "list_milestones",
description: "List milestones in a GitLab project with filtering options",
inputSchema: zodToJsonSchema(ListProjectMilestonesSchema),
},
{
name: "get_milestone",
description: "Get details of a specific milestone",
inputSchema: zodToJsonSchema(GetProjectMilestoneSchema),
},
{
name: "create_milestone",
description: "Create a new milestone in a GitLab project",
inputSchema: zodToJsonSchema(CreateProjectMilestoneSchema),
},
{
name: "edit_milestone ",
description: "Edit an existing milestone in a GitLab project",
inputSchema: zodToJsonSchema(EditProjectMilestoneSchema),
},
{
name: "delete_milestone",
description: "Delete a milestone from a GitLab project",
inputSchema: zodToJsonSchema(DeleteProjectMilestoneSchema),
},
{
name: "get_milestone_issue",
description: "Get issues associated with a specific milestone",
inputSchema: zodToJsonSchema(GetMilestoneIssuesSchema),
},
{
name: "get_milestone_merge_requests",
description: "Get merge requests associated with a specific milestone",
inputSchema: zodToJsonSchema(GetMilestoneMergeRequestsSchema),
},
{
name: "promote_milestone",
description: "Promote a milestone to the next stage",
inputSchema: zodToJsonSchema(PromoteProjectMilestoneSchema),
},
{
name: "get_milestone_burndown_events",
description: "Get burndown events for a specific milestone",
inputSchema: zodToJsonSchema(GetMilestoneBurndownEventsSchema),
},
];
// Define which tools are read-only
@ -440,6 +547,7 @@ const readOnlyTools = [
"get_merge_request_diffs",
"mr_discussions",
"list_issues",
"list_merge_requests",
"get_issue",
"list_issue_links",
"list_issue_discussions",
@ -448,10 +556,21 @@ const readOnlyTools = [
"get_namespace",
"verify_namespace",
"get_project",
"get_pipeline",
"list_pipelines",
"list_pipeline_jobs",
"get_pipeline_job",
"get_pipeline_job_output",
"list_projects",
"list_labels",
"get_label",
"list_group_projects",
"get_repository_tree",
"list_milestones",
"get_milestone",
"get_milestone_issue",
"get_milestone_merge_requests",
"get_milestone_burndown_events"
];
// Define which tools are related to wiki and can be toggled by USE_GITLAB_WIKI
@ -749,6 +868,43 @@ async function listIssues(
return z.array(GitLabIssueSchema).parse(data);
}
/**
* List merge requests in a GitLab project with optional filtering
*
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {Object} options - Optional filtering parameters
* @returns {Promise<GitLabMergeRequest[]>} List of merge requests
*/
async function listMergeRequests(
projectId: string,
options: Omit<z.infer<typeof ListMergeRequestsSchema>, "project_id"> = {}
): Promise<GitLabMergeRequest[]> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/merge_requests`
);
// Add all query parameters
Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) {
if (key === "labels" && Array.isArray(value)) {
// Handle array of labels
url.searchParams.append(key, value.join(","));
} else {
url.searchParams.append(key, value.toString());
}
}
});
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
await handleGitLabError(response);
const data = await response.json();
return z.array(GitLabMergeRequestSchema).parse(data);
}
/**
* Get a single issue from a GitLab project
* 단일 이슈 조회
@ -1054,10 +1210,10 @@ async function listIssueDiscussions(
projectId: string,
issueIid: number,
options: {
page?: number,
per_page?: number,
sort?: "asc" | "desc",
order_by?: "created_at" | "updated_at"
page?: number;
per_page?: number;
sort?: "asc" | "desc";
order_by?: "created_at" | "updated_at";
} = {}
): Promise<GitLabDiscussion[]> {
projectId = decodeURIComponent(projectId); // Decode project ID
@ -2299,6 +2455,166 @@ async function deleteWikiPage(projectId: string, slug: string): Promise<void> {
await handleGitLabError(response);
}
/**
* List pipelines in a GitLab project
*
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {ListPipelinesOptions} options - Options for filtering pipelines
* @returns {Promise<GitLabPipeline[]>} List of pipelines
*/
async function listPipelines(
projectId: string,
options: Omit<ListPipelinesOptions, "project_id"> = {}
): Promise<GitLabPipeline[]> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/pipelines`
);
// Add all query parameters
Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) {
url.searchParams.append(key, value.toString());
}
});
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
await handleGitLabError(response);
const data = await response.json();
return z.array(GitLabPipelineSchema).parse(data);
}
/**
* Get details of a specific pipeline
*
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} pipelineId - The ID of the pipeline
* @returns {Promise<GitLabPipeline>} Pipeline details
*/
async function getPipeline(
projectId: string,
pipelineId: number
): Promise<GitLabPipeline> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/pipelines/${pipelineId}`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
if (response.status === 404) {
throw new Error(`Pipeline not found`);
}
await handleGitLabError(response);
const data = await response.json();
return GitLabPipelineSchema.parse(data);
}
/**
* List all jobs in a specific pipeline
*
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} pipelineId - The ID of the pipeline
* @param {Object} options - Options for filtering jobs
* @returns {Promise<GitLabPipelineJob[]>} List of pipeline jobs
*/
async function listPipelineJobs(
projectId: string,
pipelineId: number,
options: Omit<ListPipelineJobsOptions, "project_id" | "pipeline_id"> = {}
): Promise<GitLabPipelineJob[]> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/pipelines/${pipelineId}/jobs`
);
// Add all query parameters
Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) {
if (typeof value === "boolean") {
url.searchParams.append(key, value ? "true" : "false");
} else {
url.searchParams.append(key, value.toString());
}
}
});
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
if (response.status === 404) {
throw new Error(`Pipeline not found`);
}
await handleGitLabError(response);
const data = await response.json();
return z.array(GitLabPipelineJobSchema).parse(data);
}
async function getPipelineJob(
projectId: string,
jobId: number
): Promise<GitLabPipelineJob> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(
projectId
)}/jobs/${jobId}`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
if (response.status === 404) {
throw new Error(`Job not found`);
}
await handleGitLabError(response);
const data = await response.json();
return GitLabPipelineJobSchema.parse(data);
}
/**
* Get the output/trace of a pipeline job
*
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} jobId - The ID of the job
* @returns {Promise<string>} The job output/trace
*/
async function getPipelineJobOutput(
projectId: string,
jobId: number
): Promise<string> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(
projectId
)}/jobs/${jobId}/trace`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
headers: {
...DEFAULT_HEADERS,
Accept: "text/plain", // Override Accept header to get plain text
},
});
if (response.status === 404) {
throw new Error(`Job trace not found or job is not finished yet`);
}
await handleGitLabError(response);
return await response.text();
}
/**
* Get the repository tree for a project
* @param {string} projectId - The ID or URL-encoded path of the project
@ -2342,6 +2658,231 @@ async function getRepositoryTree(
return z.array(GitLabTreeItemSchema).parse(data);
}
/**
* List project milestones in a GitLab project
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {Object} options - Options for listing milestones
* @returns {Promise<GitLabMilestones[]>} List of milestones
*/
async function listProjectMilestones(
projectId: string,
options: Omit<z.infer<typeof ListProjectMilestonesSchema>, "project_id">
): Promise<GitLabMilestones[]> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones`
);
Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) {
if (key === "iids" && Array.isArray(value) && value.length > 0) {
value.forEach((iid) => {
url.searchParams.append("iids[]", iid.toString());
});
} else if (value !== undefined) {
url.searchParams.append(key, value.toString());
}
}
});
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
await handleGitLabError(response);
const data = await response.json();
return z.array(GitLabMilestonesSchema).parse(data);
}
/**
* Get a single milestone in a GitLab project
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} milestoneId - The ID of the milestone
* @returns {Promise<GitLabMilestones>} Milestone details
*/
async function getProjectMilestone(
projectId: string,
milestoneId: number
): Promise<GitLabMilestones> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones/${milestoneId}`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
await handleGitLabError(response);
const data = await response.json();
return GitLabMilestonesSchema.parse(data);
}
/**
* Create a new milestone in a GitLab project
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {Object} options - Options for creating a milestone
* @returns {Promise<GitLabMilestones>} Created milestone
*/
async function createProjectMilestone(
projectId: string,
options: Omit<z.infer<typeof CreateProjectMilestoneSchema>, "project_id">
): Promise<GitLabMilestones> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
method: "POST",
body: JSON.stringify(options),
});
await handleGitLabError(response);
const data = await response.json();
return GitLabMilestonesSchema.parse(data);
}
/**
* Edit an existing milestone in a GitLab project
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} milestoneId - The ID of the milestone
* @param {Object} options - Options for editing a milestone
* @returns {Promise<GitLabMilestones>} Updated milestone
*/
async function editProjectMilestone(
projectId: string,
milestoneId: number,
options: Omit<z.infer<typeof EditProjectMilestoneSchema>, "project_id" | "milestone_id">
): Promise<GitLabMilestones> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones/${milestoneId}`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
method: "PUT",
body: JSON.stringify(options),
});
await handleGitLabError(response);
const data = await response.json();
return GitLabMilestonesSchema.parse(data);
}
/**
* Delete a milestone from a GitLab project
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} milestoneId - The ID of the milestone
* @returns {Promise<void>}
*/
async function deleteProjectMilestone(
projectId: string,
milestoneId: number
): Promise<void> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones/${milestoneId}`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
method: "DELETE",
});
await handleGitLabError(response);
}
/**
* Get all issues assigned to a single milestone
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} milestoneId - The ID of the milestone
* @returns {Promise<GitLabIssue[]>} List of issues
*/
async function getMilestoneIssues(
projectId: string,
milestoneId: number
): Promise<GitLabIssue[]> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones/${milestoneId}/issues`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
await handleGitLabError(response);
const data = await response.json();
return z.array(GitLabIssueSchema).parse(data);
}
/**
* Get all merge requests assigned to a single milestone
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} milestoneId - The ID of the milestone
* @returns {Promise<GitLabMergeRequest[]>} List of merge requests
*/
async function getMilestoneMergeRequests(
projectId: string,
milestoneId: number
): Promise<GitLabMergeRequest[]> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones/${milestoneId}/merge_requests`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
await handleGitLabError(response);
const data = await response.json();
return z.array(GitLabMergeRequestSchema).parse(data);
}
/**
* Promote a project milestone to a group milestone
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} milestoneId - The ID of the milestone
* @returns {Promise<GitLabMilestones>} Promoted milestone
*/
async function promoteProjectMilestone(
projectId: string,
milestoneId: number
): Promise<GitLabMilestones> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones/${milestoneId}/promote`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
method: "POST",
});
await handleGitLabError(response);
const data = await response.json();
return GitLabMilestonesSchema.parse(data);
}
/**
* Get all burndown chart events for a single milestone
* @param {string} projectId - The ID or URL-encoded path of the project
* @param {number} milestoneId - The ID of the milestone
* @returns {Promise<any[]>} Burndown chart events
*/
async function getMilestoneBurndownEvents(
projectId: string,
milestoneId: number
): Promise<any[]> {
projectId = decodeURIComponent(projectId);
const url = new URL(
`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/milestones/${milestoneId}/burndown_events`
);
const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG,
});
await handleGitLabError(response);
const data = await response.json();
return data as any[];
}
server.setRequestHandler(ListToolsRequestSchema, async () => {
// Apply read-only filter first
const tools0 = GITLAB_READ_ONLY_MODE
@ -2549,9 +3090,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
}
case "update_issue_note": {
const args = UpdateIssueNoteSchema.parse(
request.params.arguments
);
const args = UpdateIssueNoteSchema.parse(request.params.arguments);
const note = await updateIssueNote(
args.project_id,
args.issue_iid,
@ -2565,9 +3104,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
}
case "create_issue_note": {
const args = CreateIssueNoteSchema.parse(
request.params.arguments
);
const args = CreateIssueNoteSchema.parse(request.params.arguments);
const note = await createIssueNote(
args.project_id,
args.issue_iid,
@ -2757,8 +3294,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
}
case "create_merge_request_thread": {
const args = CreateMergeRequestThreadSchema.parse(request.params.arguments);
const { project_id, merge_request_iid, body, position, created_at } = args;
const args = CreateMergeRequestThreadSchema.parse(
request.params.arguments
);
const { project_id, merge_request_iid, body, position, created_at } =
args;
const thread = await createMergeRequestThread(
project_id,
@ -2827,9 +3367,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
const args = ListIssueDiscussionsSchema.parse(request.params.arguments);
const { project_id, issue_iid, ...options } = args;
const discussions = await listIssueDiscussions(project_id, issue_iid, options);
const discussions = await listIssueDiscussions(
project_id,
issue_iid,
options
);
return {
content: [{ type: "text", text: JSON.stringify(discussions, null, 2) }],
content: [
{ type: "text", text: JSON.stringify(discussions, null, 2) },
],
};
}
@ -3024,6 +3570,225 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
};
}
case "list_pipelines": {
const args = ListPipelinesSchema.parse(request.params.arguments);
const { project_id, ...options } = args;
const pipelines = await listPipelines(project_id, options);
return {
content: [{ type: "text", text: JSON.stringify(pipelines, null, 2) }],
};
}
case "get_pipeline": {
const { project_id, pipeline_id } = GetPipelineSchema.parse(
request.params.arguments
);
const pipeline = await getPipeline(project_id, pipeline_id);
return {
content: [
{
type: "text",
text: JSON.stringify(pipeline, null, 2),
},
],
};
}
case "list_pipeline_jobs": {
const { project_id, pipeline_id, ...options } = ListPipelineJobsSchema.parse(
request.params.arguments
);
const jobs = await listPipelineJobs(project_id, pipeline_id, options);
return {
content: [
{
type: "text",
text: JSON.stringify(jobs, null, 2),
},
],
};
}
case "get_pipeline_job": {
const { project_id, job_id } = GetPipelineJobOutputSchema.parse(
request.params.arguments
);
const jobDetails = await getPipelineJob(project_id, job_id);
return {
content: [
{
type: "text",
text: JSON.stringify(jobDetails, null, 2),
},
],
};
}
case "get_pipeline_job_output": {
const { project_id, job_id } = GetPipelineJobOutputSchema.parse(
request.params.arguments
);
const jobOutput = await getPipelineJobOutput(project_id, job_id);
return {
content: [
{
type: "text",
text: jobOutput,
},
],
};
}
case "list_merge_requests": {
const args = ListMergeRequestsSchema.parse(request.params.arguments);
const mergeRequests = await listMergeRequests(args.project_id, args);
return {
content: [{ type: "text", text: JSON.stringify(mergeRequests, null, 2) }],
};
}
case "list_milestones": {
const { project_id, ...options } = ListProjectMilestonesSchema.parse(
request.params.arguments
);
const milestones = await listProjectMilestones(project_id, options);
return {
content: [
{
type: "text",
text: JSON.stringify(milestones, null, 2),
},
],
};
}
case "get_milestone": {
const { project_id, milestone_id } = GetProjectMilestoneSchema.parse(
request.params.arguments
);
const milestone = await getProjectMilestone(project_id, milestone_id);
return {
content: [
{
type: "text",
text: JSON.stringify(milestone, null, 2),
},
],
};
}
case "create_milestone": {
const { project_id, ...options } = CreateProjectMilestoneSchema.parse(
request.params.arguments
);
const milestone = await createProjectMilestone(project_id, options);
return {
content: [
{
type: "text",
text: JSON.stringify(milestone, null, 2),
},
],
};
}
case "edit_milestone": {
const { project_id, milestone_id, ...options } = EditProjectMilestoneSchema.parse(
request.params.arguments
);
const milestone = await editProjectMilestone(project_id, milestone_id, options);
return {
content: [
{
type: "text",
text: JSON.stringify(milestone, null, 2),
},
],
};
}
case "delete_milestone": {
const { project_id, milestone_id } = DeleteProjectMilestoneSchema.parse(
request.params.arguments
);
await deleteProjectMilestone(project_id, milestone_id);
return {
content: [
{
type: "text",
text: JSON.stringify(
{
status: "success",
message: "Milestone deleted successfully",
},
null,
2
),
},
],
};
}
case "get_milestone_issue": {
const { project_id, milestone_id } = GetMilestoneIssuesSchema.parse(
request.params.arguments
);
const issues = await getMilestoneIssues(project_id, milestone_id);
return {
content: [
{
type: "text",
text: JSON.stringify(issues, null, 2),
},
],
};
}
case "get_milestone_merge_requests": {
const { project_id, milestone_id } = GetMilestoneMergeRequestsSchema.parse(
request.params.arguments
);
const mergeRequests = await getMilestoneMergeRequests(project_id, milestone_id);
return {
content: [
{
type: "text",
text: JSON.stringify(mergeRequests, null, 2),
},
],
};
}
case "promote_milestone": {
const { project_id, milestone_id } = PromoteProjectMilestoneSchema.parse(
request.params.arguments
);
const milestone = await promoteProjectMilestone(project_id, milestone_id);
return {
content: [
{
type: "text",
text: JSON.stringify(milestone, null, 2),
},
],
};
}
case "get_milestone_burndown_events": {
const { project_id, milestone_id } = GetMilestoneBurndownEventsSchema.parse(
request.params.arguments
);
const events = await getMilestoneBurndownEvents(project_id, milestone_id);
return {
content: [
{
type: "text",
text: JSON.stringify(events, null, 2),
},
],
};
}
default:
throw new Error(`Unknown tool: ${request.params.name}`);
}

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@zereight/mcp-gitlab",
"version": "1.0.38",
"version": "1.0.46",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@zereight/mcp-gitlab",
"version": "1.0.38",
"version": "1.0.46",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "1.8.0",

View File

@ -1,6 +1,6 @@
{
"name": "@zereight/mcp-gitlab",
"version": "1.0.42",
"version": "1.0.48",
"description": "MCP server for using the GitLab API",
"license": "MIT",
"author": "zereight",

View File

@ -7,6 +7,119 @@ export const GitLabAuthorSchema = z.object({
date: z.string(),
});
// Pipeline related schemas
export const GitLabPipelineSchema = z.object({
id: z.number(),
project_id: z.number(),
sha: z.string(),
ref: z.string(),
status: z.string(),
source: z.string().optional(),
created_at: z.string(),
updated_at: z.string(),
web_url: z.string(),
duration: z.number().nullable().optional(),
started_at: z.string().nullable().optional(),
finished_at: z.string().nullable().optional(),
coverage: z.number().nullable().optional(),
user: z.object({
id: z.number(),
name: z.string(),
username: z.string(),
avatar_url: z.string().nullable().optional(),
}).optional(),
detailed_status: z.object({
icon: z.string().optional(),
text: z.string().optional(),
label: z.string().optional(),
group: z.string().optional(),
tooltip: z.string().optional(),
has_details: z.boolean().optional(),
details_path: z.string().optional(),
illustration: z.object({
image: z.string().optional(),
size: z.string().optional(),
title: z.string().optional(),
}).nullable().optional(),
favicon: z.string().optional(),
}).optional(),
});
// Pipeline job related schemas
export const GitLabPipelineJobSchema = z.object({
id: z.number(),
status: z.string(),
stage: z.string(),
name: z.string(),
ref: z.string(),
tag: z.boolean(),
coverage: z.number().nullable().optional(),
created_at: z.string(),
started_at: z.string().nullable().optional(),
finished_at: z.string().nullable().optional(),
duration: z.number().nullable().optional(),
user: z.object({
id: z.number(),
name: z.string(),
username: z.string(),
avatar_url: z.string().nullable().optional(),
}).optional(),
commit: z.object({
id: z.string(),
short_id: z.string(),
title: z.string(),
author_name: z.string(),
author_email: z.string(),
}).optional(),
pipeline: z.object({
id: z.number(),
project_id: z.number(),
status: z.string(),
ref: z.string(),
sha: z.string(),
}).optional(),
web_url: z.string().optional(),
});
// Schema for listing pipelines
export const ListPipelinesSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"),
scope: z.enum(['running', 'pending', 'finished', 'branches', 'tags']).optional().describe("The scope of pipelines"),
status: z.enum(['created', 'waiting_for_resource', 'preparing', 'pending', 'running', 'success', 'failed', 'canceled', 'skipped', 'manual', 'scheduled']).optional().describe("The status of pipelines"),
ref: z.string().optional().describe("The ref of pipelines"),
sha: z.string().optional().describe("The SHA of pipelines"),
yaml_errors: z.boolean().optional().describe("Returns pipelines with invalid configurations"),
username: z.string().optional().describe("The username of the user who triggered pipelines"),
updated_after: z.string().optional().describe("Return pipelines updated after the specified date"),
updated_before: z.string().optional().describe("Return pipelines updated before the specified date"),
order_by: z.enum(['id', 'status', 'ref', 'updated_at', 'user_id']).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)"),
});
// Schema for getting a specific pipeline
export const GetPipelineSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"),
pipeline_id: z.number().describe("The ID of the pipeline"),
});
// Schema for listing jobs in a pipeline
export const ListPipelineJobsSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"),
pipeline_id: z.number().describe("The ID of the pipeline"),
scope: z.enum(['created', 'pending', 'running', 'failed', 'success', 'canceled', 'skipped', 'manual']).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)"),
});
// 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"),
});
// Namespace related schemas
// Base schema for project-related operations
@ -220,6 +333,22 @@ export const GitLabReferenceSchema = z.object({
}),
});
// Milestones rest api output schemas
export const GitLabMilestonesSchema = z.object({
id: z.number(),
iid: z.number(),
project_id: z.number(),
title: z.string(),
description: z.string().nullable(),
due_date: z.string().nullable(),
start_date: z.string().nullable(),
state: z.string(),
updated_at: z.string(),
created_at: z.string(),
expired: z.boolean(),
web_url: z.string().optional()
});
// Input schemas for operations
export const CreateRepositoryOptionsSchema = z.object({
name: z.string(),
@ -286,7 +415,7 @@ 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(),
avatar_url: z.string().nullable(),
web_url: z.string(), // Changed from html_url to match GitLab API
});
@ -294,7 +423,7 @@ export const GitLabMilestoneSchema = z.object({
id: z.number(),
iid: z.number(), // Added to match GitLab API
title: z.string(),
description: z.string(),
description: z.string().nullable().default(""),
state: z.string(),
web_url: z.string(), // Changed from html_url to match GitLab API
});
@ -304,7 +433,7 @@ export const GitLabIssueSchema = z.object({
iid: z.number(), // Added to match GitLab API
project_id: z.number(), // Added to match GitLab API
title: z.string(),
description: z.string(), // Changed from body to match GitLab API
description: z.string().nullable().default(""), // Changed from body to match GitLab API
state: z.string(),
author: GitLabUserSchema,
assignees: z.array(GitLabUserSchema),
@ -721,6 +850,88 @@ export const ListIssuesSchema = z.object({
per_page: z.number().optional().describe("Number of items per page"),
});
// Merge Requests API operation schemas
export const ListMergeRequestsSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"),
assignee_id: z
.number()
.optional()
.describe("Returns merge requests assigned to the given user ID"),
assignee_username: z
.string()
.optional()
.describe("Returns merge requests assigned to the given username"),
author_id: z
.number()
.optional()
.describe("Returns merge requests created by the given user ID"),
author_username: z
.string()
.optional()
.describe("Returns merge requests created by the given username"),
reviewer_id: z
.number()
.optional()
.describe("Returns merge requests which have the user as a reviewer"),
reviewer_username: z
.string()
.optional()
.describe("Returns merge requests which have the user as a reviewer"),
created_after: z
.string()
.optional()
.describe("Return merge requests created after the given time"),
created_before: z
.string()
.optional()
.describe("Return merge requests created before the given time"),
updated_after: z
.string()
.optional()
.describe("Return merge requests updated after the given time"),
updated_before: z
.string()
.optional()
.describe("Return merge requests updated before the given time"),
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"])
.optional()
.describe("Return merge requests from a specific scope"),
search: z.string().optional().describe("Search for specific terms"),
state: z
.enum(["opened", "closed", "locked", "merged", "all"])
.optional()
.describe("Return merge requests with a specific state"),
order_by: z
.enum(["created_at", "updated_at", "priority", "label_priority", "milestone_due", "popularity"])
.optional()
.describe("Return merge requests ordered by the given field"),
sort: z
.enum(["asc", "desc"])
.optional()
.describe("Return merge requests sorted in ascending or descending order"),
target_branch: z
.string()
.optional()
.describe("Return merge requests targeting a specific branch"),
source_branch: z
.string()
.optional()
.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"),
});
export const GetIssueSchema = 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"),
@ -1065,6 +1276,63 @@ export const CreateMergeRequestThreadSchema = ProjectParamsSchema.extend({
created_at: z.string().optional().describe("Date the thread was created at (ISO 8601 format)"),
});
// Milestone related schemas
// Schema for listing project milestones
export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
iids: z.array(z.number()).optional().describe("Return only the milestones having the given iid"),
state: z.enum(["active", "closed"]).optional().describe("Return only active or closed milestones"),
title: z.string().optional().describe("Return only milestones with a title matching the provided string"),
search: z.string().optional().describe("Return only milestones with a title or description matching the provided string"),
include_ancestors: z.boolean().optional().describe("Include ancestor groups"),
updated_before: z.string().optional().describe("Return milestones updated before the specified date (ISO 8601 format)"),
updated_after: z.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)"),
});
// Schema for getting a single milestone
export const GetProjectMilestoneSchema = ProjectParamsSchema.extend({
milestone_id: z.number().describe("The ID of a project milestone"),
});
// Schema for creating a new milestone
export const CreateProjectMilestoneSchema = ProjectParamsSchema.extend({
title: z.string().describe("The title of the milestone"),
description: z.string().optional().describe("The description of the milestone"),
due_date: z.string().optional().describe("The due date of the milestone (YYYY-MM-DD)"),
start_date: z.string().optional().describe("The start date of the milestone (YYYY-MM-DD)"),
});
// Schema for editing a milestone
export const EditProjectMilestoneSchema = GetProjectMilestoneSchema.extend({
title: z.string().optional().describe("The title of the milestone"),
description: z.string().optional().describe("The description of the milestone"),
due_date: z.string().optional().describe("The due date of the milestone (YYYY-MM-DD)"),
start_date: z.string().optional().describe("The start date of the milestone (YYYY-MM-DD)"),
state_event: z.enum(["close", "activate"]).optional().describe("The state event of the milestone"),
});
// Schema for deleting a milestone
export const DeleteProjectMilestoneSchema = GetProjectMilestoneSchema;
// Schema for getting issues assigned to a milestone
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)"),
});
// 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 types
export type GitLabAuthor = z.infer<typeof GitLabAuthorSchema>;
export type GitLabFork = z.infer<typeof GitLabForkSchema>;
@ -1120,3 +1388,18 @@ export type GetRepositoryTreeOptions = z.infer<typeof GetRepositoryTreeSchema>;
export type MergeRequestThreadPosition = z.infer<typeof MergeRequestThreadPositionSchema>;
export type CreateMergeRequestThreadOptions = z.infer<typeof CreateMergeRequestThreadSchema>;
export type CreateMergeRequestNoteOptions = z.infer<typeof CreateMergeRequestNoteSchema>;
export type GitLabPipelineJob = z.infer<typeof GitLabPipelineJobSchema>;
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 GitLabMilestones = z.infer<typeof GitLabMilestonesSchema>;
export type ListProjectMilestonesOptions = z.infer<typeof ListProjectMilestonesSchema>;
export type GetProjectMilestoneOptions = z.infer<typeof GetProjectMilestoneSchema>;
export type CreateProjectMilestoneOptions = z.infer<typeof CreateProjectMilestoneSchema>;
export type EditProjectMilestoneOptions = z.infer<typeof EditProjectMilestoneSchema>;
export type DeleteProjectMilestoneOptions = z.infer<typeof DeleteProjectMilestoneSchema>;
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>;

18
scripts/image_push.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Error: docker user name required."
exit 1
fi
DOCKER_USER=$1
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}"