@zereight/mcp-gitlab 2.3.20 → 2.3.21-next.202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -77,8 +77,8 @@ MCP 없는 동등 경로: npx skills add zereight/gitlab-mcp --skill gitlab-mcp-
77
77
  }
78
78
  ```
79
79
 
80
- - 호스팅 / Claude.ai: 서버에서 `GITLAB_MCP_OAUTH=true` ([MCP OAuth](#mcp-oauth-프록시-사용하기-gitlab_mcp_oauth) 참고)
81
- - 사용자별 PAT 헤더: `REMOTE_AUTHORIZATION=true` ([원격 인증](#원격-인증-사용하기-remote_authorization) 참고)
80
+ - 호스팅 / Claude.ai: 서버에서 `GITLAB_MCP_OAUTH=true` ([MCP OAuth](#mcp-oauth-프록시-사용하기gitlab_mcp_oauth) 참고)
81
+ - 사용자별 PAT 헤더: `REMOTE_AUTHORIZATION=true` ([원격 인증](#원격-인증-사용하기remote_authorization) 참고)
82
82
  - 로컬 Docker 예시는 [사용법](#사용법)에 있습니다
83
83
 
84
84
  ### Skill + CLI (MCP 불필요)
package/build/index.js CHANGED
@@ -6224,7 +6224,7 @@ async function cancelPipelineJob(projectId, jobId, force) {
6224
6224
  /**
6225
6225
  * Get the repository tree for a project
6226
6226
  * @param {GetRepositoryTreeOptions} options - Options for the tree
6227
- * @returns Parsed tree items plus optional keyset pagination metadata.
6227
+ * @returns Parsed tree items plus optional keyset and offset pagination metadata.
6228
6228
  */
6229
6229
  async function getRepositoryTree(options) {
6230
6230
  options.project_id = decodeURIComponent(options.project_id); // Decode project_id within options
@@ -6237,6 +6237,8 @@ async function getRepositoryTree(options) {
6237
6237
  queryParams.append("recursive", "true");
6238
6238
  if (options.per_page)
6239
6239
  queryParams.append("per_page", options.per_page.toString());
6240
+ if (options.page)
6241
+ queryParams.append("page", options.page.toString());
6240
6242
  if (options.page_token)
6241
6243
  queryParams.append("page_token", options.page_token);
6242
6244
  if (options.pagination)
@@ -6250,10 +6252,10 @@ async function getRepositoryTree(options) {
6250
6252
  }
6251
6253
  const data = await response.json();
6252
6254
  const items = z.array(GitLabTreeItemSchema).parse(data);
6253
- const next_page_token = response.headers.get("x-next-page-token") ||
6254
- (options.pagination === "keyset" ? response.headers.get("x-next-page") : null) ||
6255
- undefined;
6256
- return { items, next_page_token };
6255
+ const next_page_token = response.headers.get("x-next-page-token") || undefined;
6256
+ // x-next-page is a page number, not a keyset token: never send it as page_token.
6257
+ const next_page = response.headers.get("x-next-page") || undefined;
6258
+ return { items, next_page_token, next_page };
6257
6259
  }
6258
6260
  /**
6259
6261
  * List project milestones in a GitLab project
@@ -9576,14 +9578,31 @@ async function handleToolCall(params) {
9576
9578
  return await handleWikiToolCall(params);
9577
9579
  case "get_repository_tree": {
9578
9580
  const args = GetRepositoryTreeSchema.parse(params.arguments);
9579
- const { items, next_page_token } = await getRepositoryTree(args);
9580
- const result = args.pagination === "keyset" || next_page_token
9581
+ const { items, next_page_token, next_page } = await getRepositoryTree(args);
9582
+ let pagination_note;
9583
+ if (next_page_token) {
9584
+ pagination_note =
9585
+ "Pass next_page_token as page_token with pagination=keyset to retrieve the next page.";
9586
+ }
9587
+ else if (next_page) {
9588
+ pagination_note =
9589
+ args.pagination === "keyset"
9590
+ ? "GitLab returned offset pagination for this request; pass next_page as page to retrieve the next page."
9591
+ : "Pass next_page as page to retrieve the next page.";
9592
+ }
9593
+ else if (args.pagination === "keyset") {
9594
+ pagination_note = "No next_page_token was returned; this is the final keyset page.";
9595
+ }
9596
+ else {
9597
+ pagination_note = "No next_page was returned; this is the final page.";
9598
+ }
9599
+ // Calls that do not opt in to pagination keep the legacy array response.
9600
+ const result = args.pagination === "keyset" || args.page !== undefined || next_page_token
9581
9601
  ? {
9582
9602
  items,
9583
9603
  ...(next_page_token ? { next_page_token } : {}),
9584
- pagination_note: next_page_token
9585
- ? "Pass next_page_token as page_token with pagination=keyset to retrieve the next page."
9586
- : "No next_page_token was returned; this is the final keyset page.",
9604
+ ...(next_page ? { next_page } : {}),
9605
+ pagination_note,
9587
9606
  }
9588
9607
  : items;
9589
9608
  return {
package/build/schemas.js CHANGED
@@ -1296,6 +1296,12 @@ export const GetRepositoryTreeSchema = z.object({
1296
1296
  .describe("The name of a repository branch or tag. Defaults to the default branch."),
1297
1297
  recursive: coerceBooleanString.optional().describe("Boolean value to get a recursive tree"),
1298
1298
  per_page: z.coerce.number().optional().describe("Number of results to show per page"),
1299
+ page: z.coerce
1300
+ .number()
1301
+ .int()
1302
+ .positive()
1303
+ .optional()
1304
+ .describe("Page number for offset pagination, starting at 1. Passing it returns a structured response with items and, when more pages are available, next_page."),
1299
1305
  page_token: z
1300
1306
  .string()
1301
1307
  .optional()
@@ -1303,7 +1309,7 @@ export const GetRepositoryTreeSchema = z.object({
1303
1309
  pagination: z
1304
1310
  .string()
1305
1311
  .optional()
1306
- .describe("Pagination method. Use 'keyset' for keyset-based pagination (required for repositories with many files). Non-keyset calls keep the legacy array response for backward compatibility; that legacy response shape is deprecated and may be removed in a future major release. Keyset calls return a structured response with items and next_page_token when more pages are available."),
1312
+ .describe("Pagination method. Use 'keyset' for keyset-based pagination (required for repositories with many files). Calls without page or pagination keep the legacy array response for backward compatibility; that legacy response shape is deprecated and may be removed in a future major release. Keyset calls return a structured response with items and next_page_token when more pages are available."),
1307
1313
  });
1308
1314
  export const GitLabTreeSchema = z.object({
1309
1315
  id: z.string(), // Changed from sha to match GitLab API
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "2.3.20",
3
+ "version": "2.3.21-next.202",
4
4
  "mcpName": "io.github.zereight/gitlab-mcp",
5
5
  "description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
6
6
  "keywords": [