@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
637 lines (636 loc) • 22.4 kB
TypeScript
import { z } from 'zod';
/**
* Repository SCM type
*/
export declare const RepositorySCMSchema: z.ZodEnum<{
git: "git";
hg: "hg";
}>;
/**
* Repository fork policy
*/
export declare const RepositoryForkPolicySchema: z.ZodEnum<{
allow_forks: "allow_forks";
no_public_forks: "no_public_forks";
no_forks: "no_forks";
}>;
/**
* Repository links object
*/
export declare const RepositoryLinksSchema: z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
pullrequests: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
commits: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
forks: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
watchers: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
downloads: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
clone: z.ZodOptional<z.ZodArray<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
hooks: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
issues: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
/**
* Repository owner object
*/
export declare const RepositoryOwnerSchema: z.ZodObject<{
type: z.ZodEnum<{
user: "user";
team: "team";
}>;
username: z.ZodOptional<z.ZodString>;
display_name: z.ZodOptional<z.ZodString>;
uuid: z.ZodOptional<z.ZodString>;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
/**
* Repository branch object
*/
export declare const RepositoryBranchSchema: z.ZodObject<{
type: z.ZodLiteral<"branch">;
name: z.ZodString;
}, z.core.$strip>;
/**
* Repository project object
*/
export declare const RepositoryProjectSchema: z.ZodObject<{
type: z.ZodLiteral<"project">;
key: z.ZodString;
uuid: z.ZodString;
name: z.ZodString;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
/**
* Repository object returned from the API
*/
export declare const RepositorySchema: z.ZodObject<{
type: z.ZodLiteral<"repository">;
uuid: z.ZodString;
full_name: z.ZodString;
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
is_private: z.ZodBoolean;
fork_policy: z.ZodOptional<z.ZodEnum<{
allow_forks: "allow_forks";
no_public_forks: "no_public_forks";
no_forks: "no_forks";
}>>;
created_on: z.ZodOptional<z.ZodString>;
updated_on: z.ZodOptional<z.ZodString>;
size: z.ZodOptional<z.ZodNumber>;
language: z.ZodOptional<z.ZodString>;
has_issues: z.ZodOptional<z.ZodBoolean>;
has_wiki: z.ZodOptional<z.ZodBoolean>;
scm: z.ZodEnum<{
git: "git";
hg: "hg";
}>;
owner: z.ZodObject<{
type: z.ZodEnum<{
user: "user";
team: "team";
}>;
username: z.ZodOptional<z.ZodString>;
display_name: z.ZodOptional<z.ZodString>;
uuid: z.ZodOptional<z.ZodString>;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
mainbranch: z.ZodOptional<z.ZodObject<{
type: z.ZodLiteral<"branch">;
name: z.ZodString;
}, z.core.$strip>>;
project: z.ZodOptional<z.ZodObject<{
type: z.ZodLiteral<"project">;
key: z.ZodString;
uuid: z.ZodString;
name: z.ZodString;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>>;
links: z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
pullrequests: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
commits: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
forks: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
watchers: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
downloads: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
clone: z.ZodOptional<z.ZodArray<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
hooks: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
issues: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
}, z.core.$strip>;
export type Repository = z.infer<typeof RepositorySchema>;
/**
* Parameters for listing repositories
*/
export declare const ListRepositoriesParamsSchema: z.ZodObject<{
workspace: z.ZodString;
q: z.ZodOptional<z.ZodString>;
sort: z.ZodOptional<z.ZodString>;
page: z.ZodOptional<z.ZodNumber>;
pagelen: z.ZodOptional<z.ZodNumber>;
role: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ListRepositoriesParams = z.infer<typeof ListRepositoriesParamsSchema>;
/**
* Parameters for getting a repository by identifier
*/
export declare const GetRepositoryParamsSchema: z.ZodObject<{
workspace: z.ZodString;
repo_slug: z.ZodString;
}, z.core.$strip>;
export type GetRepositoryParams = z.infer<typeof GetRepositoryParamsSchema>;
/**
* API response for listing repositories
*/
export declare const RepositoriesResponseSchema: z.ZodObject<{
pagelen: z.ZodNumber;
page: z.ZodNumber;
size: z.ZodNumber;
next: z.ZodOptional<z.ZodString>;
previous: z.ZodOptional<z.ZodString>;
values: z.ZodArray<z.ZodObject<{
type: z.ZodLiteral<"repository">;
uuid: z.ZodString;
full_name: z.ZodString;
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
is_private: z.ZodBoolean;
fork_policy: z.ZodOptional<z.ZodEnum<{
allow_forks: "allow_forks";
no_public_forks: "no_public_forks";
no_forks: "no_forks";
}>>;
created_on: z.ZodOptional<z.ZodString>;
updated_on: z.ZodOptional<z.ZodString>;
size: z.ZodOptional<z.ZodNumber>;
language: z.ZodOptional<z.ZodString>;
has_issues: z.ZodOptional<z.ZodBoolean>;
has_wiki: z.ZodOptional<z.ZodBoolean>;
scm: z.ZodEnum<{
git: "git";
hg: "hg";
}>;
owner: z.ZodObject<{
type: z.ZodEnum<{
user: "user";
team: "team";
}>;
username: z.ZodOptional<z.ZodString>;
display_name: z.ZodOptional<z.ZodString>;
uuid: z.ZodOptional<z.ZodString>;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
mainbranch: z.ZodOptional<z.ZodObject<{
type: z.ZodLiteral<"branch">;
name: z.ZodString;
}, z.core.$strip>>;
project: z.ZodOptional<z.ZodObject<{
type: z.ZodLiteral<"project">;
key: z.ZodString;
uuid: z.ZodString;
name: z.ZodString;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>>;
links: z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
pullrequests: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
commits: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
forks: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
watchers: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
downloads: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
clone: z.ZodOptional<z.ZodArray<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
hooks: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
issues: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
}, z.core.$strip>>;
}, z.core.$strip>;
export type RepositoriesResponse = z.infer<typeof RepositoriesResponseSchema>;
/**
* Parameters for listing commits.
*/
export declare const ListCommitsParamsSchema: z.ZodObject<{
workspace: z.ZodString;
repo_slug: z.ZodString;
include: z.ZodOptional<z.ZodString>;
exclude: z.ZodOptional<z.ZodString>;
path: z.ZodOptional<z.ZodString>;
page: z.ZodOptional<z.ZodNumber>;
pagelen: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type ListCommitsParams = z.infer<typeof ListCommitsParamsSchema>;
/**
* Commit author schema
*/
export declare const CommitAuthorSchema: z.ZodObject<{
raw: z.ZodString;
type: z.ZodString;
user: z.ZodOptional<z.ZodObject<{
display_name: z.ZodOptional<z.ZodString>;
nickname: z.ZodOptional<z.ZodString>;
account_id: z.ZodOptional<z.ZodString>;
uuid: z.ZodOptional<z.ZodString>;
type: z.ZodString;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
/**
* Represents a single commit in the history.
*/
export declare const CommitSchema: z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
author: z.ZodObject<{
raw: z.ZodString;
type: z.ZodString;
user: z.ZodOptional<z.ZodObject<{
display_name: z.ZodOptional<z.ZodString>;
nickname: z.ZodOptional<z.ZodString>;
account_id: z.ZodOptional<z.ZodString>;
uuid: z.ZodOptional<z.ZodString>;
type: z.ZodString;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
date: z.ZodString;
message: z.ZodString;
links: z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
diff: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
approve: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
comments: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
summary: z.ZodOptional<z.ZodObject<{
raw: z.ZodOptional<z.ZodString>;
markup: z.ZodOptional<z.ZodString>;
html: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
parents: z.ZodArray<z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
links: z.ZodUnknown;
}, z.core.$strip>>;
}, z.core.$strip>;
export type Commit = z.infer<typeof CommitSchema>;
/**
* API response for listing commits (paginated).
*/
export declare const PaginatedCommitsSchema: z.ZodObject<{
pagelen: z.ZodNumber;
page: z.ZodOptional<z.ZodNumber>;
size: z.ZodOptional<z.ZodNumber>;
next: z.ZodOptional<z.ZodString>;
previous: z.ZodOptional<z.ZodString>;
values: z.ZodArray<z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
author: z.ZodObject<{
raw: z.ZodString;
type: z.ZodString;
user: z.ZodOptional<z.ZodObject<{
display_name: z.ZodOptional<z.ZodString>;
nickname: z.ZodOptional<z.ZodString>;
account_id: z.ZodOptional<z.ZodString>;
uuid: z.ZodOptional<z.ZodString>;
type: z.ZodString;
links: z.ZodOptional<z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
avatar: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
date: z.ZodString;
message: z.ZodString;
links: z.ZodObject<{
self: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
html: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
diff: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
approve: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
comments: z.ZodOptional<z.ZodObject<{
href: z.ZodString;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
summary: z.ZodOptional<z.ZodObject<{
raw: z.ZodOptional<z.ZodString>;
markup: z.ZodOptional<z.ZodString>;
html: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
parents: z.ZodArray<z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
links: z.ZodUnknown;
}, z.core.$strip>>;
}, z.core.$strip>>;
}, z.core.$strip>;
export type PaginatedCommits = z.infer<typeof PaginatedCommitsSchema>;
/**
* Parameters for creating a branch.
*/
export declare const CreateBranchParamsSchema: z.ZodObject<{
workspace: z.ZodString;
repo_slug: z.ZodString;
name: z.ZodString;
target: z.ZodObject<{
hash: z.ZodString;
}, z.core.$strip>;
}, z.core.$strip>;
export type CreateBranchParams = z.infer<typeof CreateBranchParamsSchema>;
/**
* Response object when creating a branch.
* Contains details about the newly created branch reference.
*/
export declare const BranchRefSchema: z.ZodObject<{
type: z.ZodLiteral<"branch">;
name: z.ZodString;
target: z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
}, z.core.$strip>;
}, z.core.$strip>;
export type BranchRef = z.infer<typeof BranchRefSchema>;
/**
* Parameters for getting a file's content from a repository.
*/
export declare const GetFileContentParamsSchema: z.ZodObject<{
workspace: z.ZodString;
repo_slug: z.ZodString;
commit: z.ZodString;
path: z.ZodString;
}, z.core.$strip>;
export type GetFileContentParams = z.infer<typeof GetFileContentParamsSchema>;
/**
* Represents a branch target (usually a commit).
*/
export declare const BranchTargetSchema: z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
}, z.core.$strip>;
/**
* Represents a branch in a Bitbucket repository.
*/
export declare const BranchSchema: z.ZodObject<{
name: z.ZodString;
type: z.ZodLiteral<"branch">;
target: z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
}, z.core.$strip>;
merge_strategies: z.ZodOptional<z.ZodArray<z.ZodString>>;
default_merge_strategy: z.ZodOptional<z.ZodString>;
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
/**
* Parameters for listing branches in a repository.
*/
export declare const ListBranchesParamsSchema: z.ZodObject<{
workspace: z.ZodString;
repo_slug: z.ZodString;
page: z.ZodOptional<z.ZodNumber>;
pagelen: z.ZodOptional<z.ZodNumber>;
q: z.ZodOptional<z.ZodString>;
sort: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ListBranchesParams = z.infer<typeof ListBranchesParamsSchema>;
/**
* API response for listing branches (paginated).
*/
export declare const BranchesResponseSchema: z.ZodObject<{
pagelen: z.ZodNumber;
page: z.ZodOptional<z.ZodNumber>;
size: z.ZodOptional<z.ZodNumber>;
next: z.ZodOptional<z.ZodString>;
previous: z.ZodOptional<z.ZodString>;
values: z.ZodArray<z.ZodObject<{
name: z.ZodString;
type: z.ZodLiteral<"branch">;
target: z.ZodObject<{
hash: z.ZodString;
type: z.ZodString;
}, z.core.$strip>;
merge_strategies: z.ZodOptional<z.ZodArray<z.ZodString>>;
default_merge_strategy: z.ZodOptional<z.ZodString>;
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>>;
}, z.core.$strip>;
export type BranchesResponse = z.infer<typeof BranchesResponseSchema>;