UNPKG

@aashari/mcp-server-atlassian-bitbucket

Version:

Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MC

111 lines (110 loc) 4.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SearchToolArgsSchema = exports.SearchToolArgs = exports.SearchToolArgsBase = void 0; const zod_1 = require("zod"); /** * Pagination arguments * Used for pagination of search results */ const PaginationArgs = zod_1.z.object({ /** * Maximum number of items to return (1-100). * Use this to control the response size. * Useful for pagination or when you only need a few results. */ limit: zod_1.z .number() .min(1) .max(100) .optional() .describe('Maximum number of results to return (1-100). Use this to control the response size. Useful for pagination or when you only need a few results.'), /** * Pagination cursor for retrieving the next set of results. * For repositories and pull requests, this is a cursor string. * For code search, this is a page number. * Use this to navigate through large result sets. */ cursor: zod_1.z .string() .optional() .describe('Pagination cursor for retrieving the next set of results. For repositories and pull requests, this is a cursor string. For code search, this is a page number. Use this to navigate through large result sets.'), }); /** * Bitbucket search tool arguments schema base */ exports.SearchToolArgsBase = zod_1.z .object({ /** * Workspace slug to search in. Example: "myteam" * This maps to the CLI's "--workspace" parameter. */ workspaceSlug: zod_1.z .string() .optional() .describe('Workspace slug to search in. If not provided, the system will use your default workspace. Example: "myteam". Equivalent to --workspace in CLI.'), /** * Optional: Repository slug to limit search scope. Required for `pullrequests` scope. Example: "project-api" * This maps to the CLI's "--repo" parameter. */ repoSlug: zod_1.z .string() .optional() .describe('Optional: Repository slug to limit search scope. Required for `pullrequests` scope. Example: "project-api". Equivalent to --repo in CLI.'), /** * Search query text. Required. Will match against content based on the selected search scope. * This maps to the CLI's "--query" parameter. */ query: zod_1.z .string() .min(1) .describe('Search query text. Required. Will match against content based on the selected search scope. Equivalent to --query in CLI.'), /** * Search scope: "code", "content", "repositories", "pullrequests". Default: "code" * This maps to the CLI's "--type" parameter. */ scope: zod_1.z .enum(['code', 'content', 'repositories', 'pullrequests']) .optional() .default('code') .describe('Search scope: "code", "content", "repositories", "pullrequests". Default: "code". Equivalent to --type in CLI.'), /** * Content type for content search (e.g., "wiki", "issue") * This maps to the CLI's "--content-type" parameter. */ contentType: zod_1.z .string() .optional() .describe('Content type for content search (e.g., "wiki", "issue"). Equivalent to --content-type in CLI.'), /** * Filter code search by language. * This maps to the CLI's "--language" parameter. */ language: zod_1.z .string() .optional() .describe('Filter code search by language. Equivalent to --language in CLI.'), /** * Filter code search by file extension. * This maps to the CLI's "--extension" parameter. */ extension: zod_1.z .string() .optional() .describe('Filter code search by file extension. Equivalent to --extension in CLI.'), }) .merge(PaginationArgs); /** * Bitbucket search tool arguments schema with validation */ exports.SearchToolArgs = exports.SearchToolArgsBase.superRefine((data, ctx) => { // Make repoSlug required when scope is 'pullrequests' if (data.scope === 'pullrequests' && !data.repoSlug) { ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: 'repoSlug is required when scope is "pullrequests"', path: ['repoSlug'], }); } }); // Export both the schema and its shape for use with the MCP server exports.SearchToolArgsSchema = exports.SearchToolArgsBase;