@zereight/mcp-gitlab 1.0.15 → 1.0.16

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/build/index.js CHANGED
@@ -638,11 +638,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
638
638
  }
639
639
  switch (request.params.name) {
640
640
  case "fork_repository": {
641
- const args = ForkRepositorySchema.parse(request.params.arguments);
642
- const fork = await forkProject(args.project_id, args.namespace);
643
- return {
644
- content: [{ type: "text", text: JSON.stringify(fork, null, 2) }],
645
- };
641
+ const forkArgs = ForkRepositorySchema.parse(request.params.arguments);
642
+ try {
643
+ const forkedProject = await forkProject(forkArgs.project_id, forkArgs.namespace);
644
+ return {
645
+ content: [{ type: "text", text: JSON.stringify(forkedProject, null, 2) }],
646
+ };
647
+ }
648
+ catch (forkError) {
649
+ console.error("Error forking repository:", forkError);
650
+ let forkErrorMessage = "Failed to fork repository";
651
+ if (forkError instanceof Error) {
652
+ forkErrorMessage = `${forkErrorMessage}: ${forkError.message}`;
653
+ }
654
+ return {
655
+ content: [{ type: "text", text: JSON.stringify({ error: forkErrorMessage }, null, 2) }],
656
+ };
657
+ }
646
658
  }
647
659
  case "create_branch": {
648
660
  const args = CreateBranchSchema.parse(request.params.arguments);
package/build/schemas.js CHANGED
@@ -141,11 +141,11 @@ export const GitLabForkParentSchema = z.object({
141
141
  username: z.string(), // Changed from login to match GitLab API
142
142
  id: z.number(),
143
143
  avatar_url: z.string(),
144
- }),
144
+ }).optional(), // Made optional to handle cases where GitLab API doesn't include it
145
145
  web_url: z.string(), // Changed from html_url to match GitLab API
146
146
  });
147
147
  export const GitLabForkSchema = GitLabRepositorySchema.extend({
148
- forked_from_project: GitLabForkParentSchema, // Changed from parent to match GitLab API
148
+ forked_from_project: GitLabForkParentSchema.optional(), // Made optional to handle cases where GitLab API doesn't include it
149
149
  });
150
150
  // Issue related schemas
151
151
  export const GitLabLabelSchema = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "MCP server for using the GitLab API",
5
5
  "license": "MIT",
6
6
  "author": "zereight",