Skip to main content
Glama
garc33

Bitbucket Server MCP

by garc33

list_projects

Discover and list all accessible Bitbucket projects to explore available options, find project keys, or identify specific projects when keys are unknown.

Instructions

Discover and list all Bitbucket projects you have access to. Use this first to explore available projects, find project keys, or when you need to work with a specific project but don't know its exact key. Returns project keys, names, descriptions and visibility settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of projects to return (default: 25, max: 1000)
startNoStart index for pagination (default: 0)

Implementation Reference

  • Core handler function that executes the list_projects tool: fetches projects from Bitbucket API endpoint '/projects' with pagination (limit, start), processes the response into a summary with project details (key, name, description, public, type), and returns formatted JSON text content.
    private async listProjects(options: ListOptions = {}) { const { limit = 25, start = 0 } = options; const response = await this.api.get('/projects', { params: { limit, start } }); const projects = response.data.values || []; const summary = { total: response.data.size || projects.length, showing: projects.length, projects: projects.map((project: { key: string; name: string; description?: string; public: boolean; type: string }) => ({ key: project.key, name: project.name, description: project.description, public: project.public, type: project.type })) }; return { content: [{ type: 'text', text: JSON.stringify(summary, null, 2) }] }; }
  • src/index.ts:166-176 (registration)
    Tool registration definition in the ListToolsRequestSchema handler, including name, detailed description, and input schema for pagination parameters.
    { name: 'list_projects', description: 'Discover and list all Bitbucket projects you have access to. Use this first to explore available projects, find project keys, or when you need to work with a specific project but don\'t know its exact key. Returns project keys, names, descriptions and visibility settings.', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of projects to return (default: 25, max: 1000)' }, start: { type: 'number', description: 'Start index for pagination (default: 0)' } } } },
  • Input schema definition for the list_projects tool, specifying optional pagination parameters limit and start.
    inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of projects to return (default: 25, max: 1000)' }, start: { type: 'number', description: 'Start index for pagination (default: 0)' } } }
  • src/index.ts:423-428 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that handles tool calls by extracting arguments and invoking the listProjects handler method.
    case 'list_projects': { return await this.listProjects({ limit: args.limit as number, start: args.start as number }); }
  • list_projects is listed in the readOnlyTools array, allowing it to be used even in read-only configuration mode.
    const readOnlyTools = ['list_projects', 'list_repositories', 'get_pull_request', 'get_diff', 'get_reviews', 'get_activities', 'get_comments', 'search', 'get_file_content', 'browse_repository'];

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

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