Compare commits

...

7 Commits

Author SHA1 Message Date
0930ce3636 [version-update] feat: bump version to 1.0.59 🎉
🚀 Breaking Changes:
- Updated package version from 1.0.58 to 1.0.59
2025-06-04 21:37:59 +09:00
061e19d861 Fix for null error (#85)
Co-authored-by: Jean Paul Gatt <jeanpaul.gatt@ballys.com>
2025-06-04 21:37:28 +09:00
511d2d9c06 FIX: bug get issues (#83) 2025-06-04 21:37:14 +09:00
8cb7703aa1 [feat] update: bump version to 1.0.58
🚀 Breaking Changes:
- Updated package version from 1.0.57 to 1.0.58
2025-06-03 19:34:00 +09:00
5e254836e8 Add support for retrieving wiki page content in list_wiki_pages (#82)
Co-authored-by: Vince Liao <vince.liao@nextbank.com.tw>
2025-06-03 19:33:36 +09:00
93710f2846 Merge pull request #81 from zereight/doc/readme
DOC: readme docker image
2025-06-03 14:58:18 +09:00
f3854126ac DOC: readme docker image 2025-06-03 14:40:34 +09:00
4 changed files with 27 additions and 16 deletions

View File

@ -84,7 +84,7 @@ docker run -i --rm \
-e USE_PIPELINE=true \ -e USE_PIPELINE=true \
-e SSE=true \ -e SSE=true \
-p 3333:3002 \ -p 3333:3002 \
gitlab-mcp iwakitakuma/gitlab-mcp
``` ```
```json ```json

View File

@ -171,6 +171,7 @@ import {
GitLabCompareResult, GitLabCompareResult,
GitLabCompareResultSchema, GitLabCompareResultSchema,
GetBranchDiffsSchema, GetBranchDiffsSchema,
ListWikiPagesOptions,
} from "./schemas.js"; } from "./schemas.js";
/** /**
@ -906,13 +907,17 @@ async function listIssues(
// Add all query parameters // Add all query parameters
Object.entries(options).forEach(([key, value]) => { Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) { if (value !== undefined) {
if (key === "labels" && Array.isArray(value)) { if (key === "labels" ) {
// Handle array of labels if (Array.isArray(value)) {
value.forEach(label => { // Handle array of labels
url.searchParams.append("labels[]", label.toString()); value.forEach(label => {
}); url.searchParams.append("labels[]", label.toString());
});
} else {
url.searchParams.append("labels[]", value.toString());
}
} else { } else {
url.searchParams.append("labels[]", value.toString()); url.searchParams.append(key, value.toString());
} }
} }
}); });
@ -2376,12 +2381,14 @@ async function listGroupProjects(
*/ */
async function listWikiPages( async function listWikiPages(
projectId: string, projectId: string,
options: Omit<z.infer<typeof ListWikiPagesSchema>, "project_id"> = {} options: Omit<ListWikiPagesOptions, "project_id"> = {}
): Promise<GitLabWikiPage[]> { ): Promise<GitLabWikiPage[]> {
projectId = decodeURIComponent(projectId); // Decode project ID projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/wikis`); const url = new URL(`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/wikis`);
if (options.page) url.searchParams.append("page", options.page.toString()); if (options.page) url.searchParams.append("page", options.page.toString());
if (options.per_page) url.searchParams.append("per_page", options.per_page.toString()); if (options.per_page) url.searchParams.append("per_page", options.per_page.toString());
if (options.with_content)
url.searchParams.append("with_content", options.with_content.toString());
const response = await fetch(url.toString(), { const response = await fetch(url.toString(), {
...DEFAULT_FETCH_CONFIG, ...DEFAULT_FETCH_CONFIG,
}); });
@ -3597,8 +3604,10 @@ server.setRequestHandler(CallToolRequestSchema, async request => {
} }
case "list_wiki_pages": { case "list_wiki_pages": {
const { project_id, page, per_page } = ListWikiPagesSchema.parse(request.params.arguments); const { project_id, page, per_page, with_content } = ListWikiPagesSchema.parse(
const wikiPages = await listWikiPages(project_id, { page, per_page }); request.params.arguments
);
const wikiPages = await listWikiPages(project_id, { page, per_page, with_content });
return { return {
content: [{ type: "text", text: JSON.stringify(wikiPages, null, 2) }], content: [{ type: "text", text: JSON.stringify(wikiPages, null, 2) }],
}; };

View File

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

View File

@ -212,7 +212,7 @@ export const GitLabUsersResponseSchema = z.record(
id: z.number(), id: z.number(),
username: z.string(), username: z.string(),
name: z.string(), name: z.string(),
avatar_url: z.string(), avatar_url: z.string().nullable(),
web_url: z.string(), web_url: z.string(),
}).nullable() }).nullable()
); );
@ -253,7 +253,7 @@ export const GitLabNamespaceExistsResponseSchema = z.object({
export const GitLabOwnerSchema = z.object({ export const GitLabOwnerSchema = z.object({
username: z.string(), // Changed from login to match GitLab API username: z.string(), // Changed from login to match GitLab API
id: z.number(), id: z.number(),
avatar_url: z.string(), avatar_url: z.string().nullable(),
web_url: z.string(), // Changed from html_url to match GitLab API web_url: z.string(), // Changed from html_url to match GitLab API
name: z.string(), // Added as GitLab includes full name name: z.string(), // Added as GitLab includes full name
state: z.string(), // Added as GitLab includes user state state: z.string(), // Added as GitLab includes user state
@ -593,7 +593,7 @@ export const GitLabForkParentSchema = z.object({
.object({ .object({
username: z.string(), // Changed from login to match GitLab API username: z.string(), // Changed from login to match GitLab API
id: z.number(), 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 .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 web_url: z.string(), // Changed from html_url to match GitLab API
@ -916,7 +916,7 @@ export const CreateNoteSchema = z.object({
export const ListIssuesSchema = z.object({ export const ListIssuesSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"), 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_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_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"), author_username: z.string().optional().describe("Return issues created by the given username"),
confidential: z.boolean().optional().describe("Filter confidential or public issues"), confidential: z.boolean().optional().describe("Filter confidential or public issues"),
@ -1197,7 +1197,9 @@ export const ListGroupProjectsSchema = z.object({
// Add wiki operation schemas // Add wiki operation schemas
export const ListWikiPagesSchema = z.object({ export const ListWikiPagesSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"), project_id: z.string().describe("Project ID or URL-encoded path"),
with_content: z.boolean().optional().describe("Include content of the wiki pages"),
}).merge(PaginationOptionsSchema); }).merge(PaginationOptionsSchema);
export const GetWikiPageSchema = z.object({ export const GetWikiPageSchema = z.object({
project_id: z.string().describe("Project ID or URL-encoded path"), project_id: z.string().describe("Project ID or URL-encoded path"),
slug: z.string().describe("URL-encoded slug of the wiki page"), slug: z.string().describe("URL-encoded slug of the wiki page"),
@ -1226,7 +1228,7 @@ export const GitLabWikiPageSchema = z.object({
title: z.string(), title: z.string(),
slug: z.string(), slug: z.string(),
format: z.string(), format: z.string(),
content: z.string(), content: z.string().optional(),
created_at: z.string().optional(), created_at: z.string().optional(),
updated_at: z.string().optional(), updated_at: z.string().optional(),
}); });