Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

search_code

Search for code across Bitbucket repositories using natural language queries to locate specific files, functions, or patterns within a workspace.

Instructions

Search for code in a workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
queryYesThe search query

Implementation Reference

  • The actual implementation of the search_code tool in the BitbucketClient class.
    async searchCode(workspace: string, query: string): Promise<any[]> {
      const response = await this.api.get(`/workspaces/${workspace}/search/code`, {
        params: { search_query: query }
      });
      return response.data.values;
    }
  • The definition and input schema for the search_code tool.
    {
      name: 'search_code',
      description: 'Search for code in a workspace',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          query: {
            type: 'string',
            description: 'The search query',
          },
        },
        required: ['workspace', 'query'],
      },
    },
  • src/index.ts:633-645 (registration)
    The tool execution handler in index.ts which calls the client method.
    case 'search_code': {
      const { workspace, query } = args as {
        workspace: string;
        query: string;
      };
      const results = await client.searchCode(workspace, query);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(results, 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