Skip to main content
Glama

Bitbucket MCP Server

by pdogra1299

add_comment

Add comments to Bitbucket pull requests with options for general feedback, replies, inline code comments, and code suggestions. Supports line numbers, code snippets, and multi-line replacements for precise feedback.

Instructions

Add a comment to a pull request. Supports: 1) General PR comments, 2) Replies to existing comments, 3) Inline comments on specific code lines (using line_number OR code_snippet), 4) Code suggestions for single or multi-line replacements. For inline comments, you can either provide exact line_number or use code_snippet to auto-detect the line.

Input Schema

NameRequiredDescriptionDefault
code_snippetNoExact code text from the diff to find and comment on. Use this instead of line_number for auto-detection. Must match exactly including whitespace (optional)
comment_textYesThe main comment text. For suggestions, this is the explanation before the code suggestion.
file_pathNoFile path for inline comment. Required for inline comments. Example: "src/components/Button.js" (optional)
line_numberNoExact line number in the file. Use this OR code_snippet, not both. Required with file_path unless using code_snippet (optional)
line_typeNoType of line: ADDED (green/new lines), REMOVED (red/deleted lines), or CONTEXT (unchanged lines). Default: CONTEXT
match_strategyNoHow to handle multiple matches when using code_snippet. "strict": fail with detailed error showing all matches. "best": automatically pick the highest confidence match. Default: "strict"
parent_comment_idNoID of comment to reply to. Use this to create threaded conversations (optional)
pull_request_idYesPull request ID
repositoryYesRepository slug (e.g., "my-repo")
search_contextNoAdditional context lines to help locate the exact position when using code_snippet. Useful when the same code appears multiple times (optional)
suggestionNoReplacement code for a suggestion. Creates a suggestion block that can be applied in Bitbucket UI. Requires file_path and line_number. For multi-line, include newlines in the string (optional)
suggestion_end_lineNoFor multi-line suggestions: the last line number to replace. If not provided, only replaces the single line at line_number (optional)
workspaceYesBitbucket workspace/project key (e.g., "PROJ")

Input Schema (JSON Schema)

{ "properties": { "code_snippet": { "description": "Exact code text from the diff to find and comment on. Use this instead of line_number for auto-detection. Must match exactly including whitespace (optional)", "type": "string" }, "comment_text": { "description": "The main comment text. For suggestions, this is the explanation before the code suggestion.", "type": "string" }, "file_path": { "description": "File path for inline comment. Required for inline comments. Example: \"src/components/Button.js\" (optional)", "type": "string" }, "line_number": { "description": "Exact line number in the file. Use this OR code_snippet, not both. Required with file_path unless using code_snippet (optional)", "type": "number" }, "line_type": { "description": "Type of line: ADDED (green/new lines), REMOVED (red/deleted lines), or CONTEXT (unchanged lines). Default: CONTEXT", "enum": [ "ADDED", "REMOVED", "CONTEXT" ], "type": "string" }, "match_strategy": { "description": "How to handle multiple matches when using code_snippet. \"strict\": fail with detailed error showing all matches. \"best\": automatically pick the highest confidence match. Default: \"strict\"", "enum": [ "strict", "best" ], "type": "string" }, "parent_comment_id": { "description": "ID of comment to reply to. Use this to create threaded conversations (optional)", "type": "number" }, "pull_request_id": { "description": "Pull request ID", "type": "number" }, "repository": { "description": "Repository slug (e.g., \"my-repo\")", "type": "string" }, "search_context": { "description": "Additional context lines to help locate the exact position when using code_snippet. Useful when the same code appears multiple times (optional)", "properties": { "after": { "description": "Array of code lines that appear AFTER the target line. Helps disambiguate when code_snippet appears multiple times", "items": { "type": "string" }, "type": "array" }, "before": { "description": "Array of code lines that appear BEFORE the target line. Helps disambiguate when code_snippet appears multiple times", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "suggestion": { "description": "Replacement code for a suggestion. Creates a suggestion block that can be applied in Bitbucket UI. Requires file_path and line_number. For multi-line, include newlines in the string (optional)", "type": "string" }, "suggestion_end_line": { "description": "For multi-line suggestions: the last line number to replace. If not provided, only replaces the single line at line_number (optional)", "type": "number" }, "workspace": { "description": "Bitbucket workspace/project key (e.g., \"PROJ\")", "type": "string" } }, "required": [ "workspace", "repository", "pull_request_id", "comment_text" ], "type": "object" }

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/pdogra1299/bitbucket-mcp-server'

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