@stubbedev/atlassian-mcp 0.1.10 → 0.1.12

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/dist/bitbucket.js CHANGED
@@ -267,8 +267,10 @@ export class BitbucketClient {
267
267
  const { projectKey, repoSlug } = this.resolveProjectAndRepo(args.projectKey, args.repoSlug);
268
268
  const { state = 'OPEN', fromBranch, text: searchText, limit = 25, start = 0 } = args;
269
269
  const qs = new URLSearchParams({ state, limit: String(limit), start: String(start) });
270
- if (fromBranch)
270
+ if (fromBranch) {
271
271
  qs.set('at', toBranchRef(fromBranch));
272
+ qs.set('direction', 'OUTGOING');
273
+ }
272
274
  if (searchText)
273
275
  qs.set('filterText', searchText);
274
276
  const path = `/projects/${projectKey}/repos/${repoSlug}/pull-requests?${qs}`;
@@ -680,16 +682,40 @@ export class BitbucketClient {
680
682
  }
681
683
  async addPrComment(args) {
682
684
  const { projectKey, repoSlug } = this.resolveProjectAndRepo(args.projectKey, args.repoSlug);
683
- const body = { text: validateCommentText(args.text) };
685
+ let commentText = args.text;
686
+ if (args.suggestion !== undefined) {
687
+ const suggestionBlock = `\`\`\`suggestion\n${args.suggestion}\n\`\`\``;
688
+ commentText = args.text ? `${args.text}\n\n${suggestionBlock}` : suggestionBlock;
689
+ }
690
+ const body = { text: validateCommentText(commentText) };
684
691
  if (args.parentCommentId)
685
692
  body.parent = { id: args.parentCommentId };
693
+ if (args.filePath !== undefined && args.line !== undefined) {
694
+ const pr = await this.request('GET', `/projects/${projectKey}/repos/${repoSlug}/pull-requests/${args.prId}`);
695
+ const anchor = {
696
+ diffType: 'EFFECTIVE',
697
+ fileType: args.fileType ?? 'TO',
698
+ fromHash: pr?.fromRef.latestCommit ?? '',
699
+ toHash: pr?.toRef.latestCommit ?? '',
700
+ line: args.line,
701
+ lineType: args.lineType ?? 'ADDED',
702
+ path: args.filePath,
703
+ srcPath: args.srcPath ?? args.filePath,
704
+ };
705
+ if (args.multilineStartLine !== undefined) {
706
+ anchor.multilineStartLine = args.multilineStartLine;
707
+ anchor.multilineStartLineType = args.multilineStartLineType ?? args.lineType ?? 'ADDED';
708
+ }
709
+ body.anchor = anchor;
710
+ }
686
711
  const created = await this.request('POST', `/projects/${projectKey}/repos/${repoSlug}/pull-requests/${args.prId}/comments`, body);
687
712
  if (!created)
688
713
  return text(`Comment added to PR #${args.prId}.`);
689
714
  if (args.parentCommentId) {
690
715
  return text(`Reply #${created.id} added to comment #${args.parentCommentId} on PR #${args.prId}.`);
691
716
  }
692
- return text(`Comment #${created.id} added to PR #${args.prId}.`);
717
+ const location = args.filePath && args.line ? ` on ${args.filePath}:${args.line}` : '';
718
+ return text(`Comment #${created.id} added to PR #${args.prId}${location}.`);
693
719
  }
694
720
  async updatePrComment(args) {
695
721
  const { projectKey, repoSlug } = this.resolveProjectAndRepo(args.projectKey, args.repoSlug);
package/dist/index.js CHANGED
@@ -569,7 +569,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
569
569
  },
570
570
  {
571
571
  name: 'bitbucket_add_pr_comment',
572
- description: 'Use when you want to add a PR review comment or reply to an existing thread. Keep comments concise, plain text, and free of filler. Never include emojis. You can pass projectKey/repoSlug or project/repo.',
572
+ description: `Add a PR review comment or reply to an existing thread.
573
+
574
+ INLINE COMMENTS ARE STRONGLY PREFERRED: Whenever your comment refers to a specific line or block of code, you MUST provide filePath and line to anchor it as an inline comment on the diff. General top-level comments (no filePath/line) should only be used for overall PR feedback that does not relate to any particular line.
575
+
576
+ SUGGESTIONS ARE STRONGLY PREFERRED OVER PLAIN COMMENTS: When you are pointing out something that should be changed, always provide a suggestion (the corrected code) rather than describing the change in words. A suggestion lets the author apply the fix with one click. Only omit suggestion if you are asking a question or raising a concern that has no clear single answer.
577
+
578
+ Keep comments concise, plain text, and free of filler. Never include emojis. You can pass projectKey/repoSlug or project/repo.`,
573
579
  inputSchema: {
574
580
  type: 'object',
575
581
  properties: {
@@ -579,7 +585,15 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
579
585
  repo: { type: 'string', description: 'Alias for repoSlug' },
580
586
  prId: { type: 'number', description: 'Pull request number (PR ID)' },
581
587
  parentCommentId: { type: 'number', description: 'Parent comment ID for reply mode (optional)' },
582
- text: { type: 'string', description: 'Concise comment text only. No filler. Do not include emojis.' },
588
+ text: { type: 'string', description: 'Concise comment text. No filler. Do not include emojis. If suggestion is also provided, this text appears above the suggestion block.' },
589
+ filePath: { type: 'string', description: 'Destination file path for inline comment, e.g. "src/index.ts". Must be provided together with line.' },
590
+ srcPath: { type: 'string', description: 'Source file path. Only needed when the file was renamed; otherwise omit (defaults to filePath).' },
591
+ line: { type: 'number', description: 'Line number in the file to anchor the comment to. Must be provided together with filePath.' },
592
+ lineType: { type: 'string', enum: ['ADDED', 'REMOVED', 'CONTEXT'], description: 'The type of the anchored line in the diff. Defaults to ADDED. Use CONTEXT for unchanged lines, REMOVED for deleted lines.' },
593
+ fileType: { type: 'string', enum: ['TO', 'FROM'], description: 'Which side of the diff the anchor refers to: TO (destination/new file, default) or FROM (source/old file).' },
594
+ multilineStartLine: { type: 'number', description: 'First line of a multiline anchor. Set together with line (last line) to span multiple lines.' },
595
+ multilineStartLineType: { type: 'string', enum: ['ADDED', 'REMOVED', 'CONTEXT'], description: 'Line type for the multilineStartLine. Defaults to lineType.' },
596
+ suggestion: { type: 'string', description: 'Replacement code to suggest. Rendered as a suggestion block the author can apply with one click. STRONGLY PREFERRED whenever you are proposing a code change. Must be used with filePath and line.' },
583
597
  },
584
598
  required: ['prId', 'text'],
585
599
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stubbedev/atlassian-mcp",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "MCP server for self-hosted Jira and Bitbucket",
5
5
  "license": "MIT",
6
6
  "type": "module",