Skip to main content
Glama
Alosies

GitLab MCP Server

by Alosies

create_mr_note

Add a comment to a GitLab merge request to provide feedback, ask questions, or document decisions during code review.

Instructions

Add a new top-level comment to a merge request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or path
merge_request_iidYesMerge request internal ID
bodyYesThe content of the comment (supports Markdown)

Implementation Reference

  • The main handler function that implements the create_mr_note tool by posting a new note to the GitLab merge request API endpoint and returning the response.
    async createMRNote(args: CreateMRNoteParams) {
      const requestData = {
        body: args.body,
      };
    
      const data = await this.client.post(
        `/projects/${encodeURIComponent(args.project_id)}/merge_requests/${
          args.merge_request_iid
        }/notes`,
        requestData
      );
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • MCP tool registration defining the name, description, and input schema for the create_mr_note tool.
    name: 'create_mr_note',
    description: 'Add a new top-level comment to a merge request',
    inputSchema: {
      type: 'object',
      properties: {
        project_id: {
          type: 'string',
          description: 'Project ID or path',
        },
        merge_request_iid: {
          type: 'number',
          description: 'Merge request internal ID',
        },
        body: {
          type: 'string',
          description: 'The content of the comment (supports Markdown)',
        },
      },
      required: ['project_id', 'merge_request_iid', 'body'],
    },
  • TypeScript interface defining the input parameters for the create_mr_note tool.
    export interface CreateMRNoteParams {
      project_id: string;
      merge_request_iid: number;
      body: string;
    }
  • src/server.ts:215-218 (registration)
    Server-side dispatch that routes calls to the create_mr_note tool to the appropriate handler method.
    case "create_mr_note":
      return await this.mergeRequestHandlers.createMRNote(
        args as unknown as CreateMRNoteParams
      );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Alosies/gitlab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server