Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

list_pull_requests

Retrieve pull requests from a Bitbucket repository with filtering options by state (OPEN, MERGED, DECLINED) to manage code review workflows.

Instructions

List pull requests in a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
stateNoFilter by PR state (OPEN, MERGED, DECLINED)

Implementation Reference

  • The implementation of `listPullRequests` in the `BitbucketClient` class, which makes the API call to Bitbucket.
    async listPullRequests(workspace: string, repoSlug: string, state?: string): Promise<PullRequest[]> {
      const params = state ? { state } : {};
      const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/pullrequests`, { params });
      return response.data.values;
    }
  • The MCP tool handler for 'list_pull_requests' in `src/index.ts`.
    case 'list_pull_requests': {
      const { workspace, repo_slug, state } = args as {
        workspace: string;
        repo_slug: string;
        state?: string;
      };
      const pullRequests = await client.listPullRequests(workspace, repo_slug, state);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(pullRequests, null, 2),
          },
        ],
      };
    }

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

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