mcp

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManageCommitsHandler

ManageCommitsHandler handles the consolidated commit operations.

func ManageIssuesHandler

ManageIssuesHandler handles the consolidated issue operations.

func ManagePRCommentsHandler

ManagePRCommentsHandler handles the consolidated PR comments operations.

func ManagePipelinesHandler

ManagePipelinesHandler handles the consolidated pipeline operations.

func ManagePullRequestsHandler

ManagePullRequestsHandler handles the consolidated pull request operations.

func ManageRefsHandler

ManageRefsHandler handles the consolidated branch and tag operations.

func ManageRepositoriesHandler

ManageRepositoriesHandler handles the consolidated repository operations.

func ManageSourceHandler

ManageSourceHandler handles the consolidated source file and directory operations.

func ManageWorkspacesHandler

ManageWorkspacesHandler handles list and get operations for workspaces.

func New

func New(username, password, token string) *mcp.Server

New creates and configures the Bitbucket MCP server with all tools registered.

func NewFromCredentials

func NewFromCredentials(creds *bitbucket.Credentials) *mcp.Server

NewFromCredentials creates the MCP server from stored credentials, mapping cached scopes.

func NewUnauthenticated added in v0.1.3

func NewUnauthenticated() *mcp.Server

NewUnauthenticated creates an MCP server with all tools registered but no working client. Every tool call returns an auth-required message. Used for server inspection (e.g., Glama).

func ToolResultError

func ToolResultError(text string) *mcp.CallToolResult

ToolResultError creates a strictly typed error *mcp.CallToolResult.

func ToolResultText

func ToolResultText(text string) *mcp.CallToolResult

ToolResultText creates a strictly typed success *mcp.CallToolResult with text content.

Types

type ManageCommitsArgs

type ManageCommitsArgs struct {
	Action    string `json:"action" jsonschema:"Action to perform: 'list', 'get', 'diff', 'diffstat'" jsonschema_enum:"list,get,diff,diffstat"`
	Workspace string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug  string `json:"repo_slug" jsonschema:"Repository slug"`
	Revision  string `json:"revision,omitempty" jsonschema:"Branch name or commit hash to list commits for"`
	Commit    string `json:"commit,omitempty" jsonschema:"Commit hash (required for 'get')"`
	Spec      string `json:"spec,omitempty" jsonschema:"Diff spec: single commit hash or 'hash1..hash2' (required for 'diff', 'diffstat')"`
	Path      string `json:"path,omitempty" jsonschema:"Filter diff/commits to this file path"`
	Include   string `json:"include,omitempty" jsonschema:"Include commits reachable from this ref (for 'list')"`
	Exclude   string `json:"exclude,omitempty" jsonschema:"Exclude commits reachable from this ref (for 'list')"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number"`
	Pagelen   int    `json:"pagelen,omitempty" jsonschema:"Results per page"`
}

type ManageIssuesArgs

type ManageIssuesArgs struct {
	Action    string `json:"action" jsonschema:"Action to perform: 'list', 'get', 'create', 'update'" jsonschema_enum:"list,get,create,update"`
	Workspace string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug  string `json:"repo_slug" jsonschema:"Repository slug"`
	IssueID   int    `json:"issue_id,omitempty" jsonschema:"Issue ID (for 'get', 'update')"`
	Title     string `json:"title,omitempty" jsonschema:"Issue title (for 'create', 'update')"`
	Content   string `json:"content,omitempty" jsonschema:"Issue description content (for 'create', 'update')"`
	State     string `` /* 147-byte string literal not displayed */
	Kind      string `json:"kind,omitempty" jsonschema:"Issue kind: bug, enhancement, proposal, task (for 'create', 'update')"`
	Priority  string `json:"priority,omitempty" jsonschema:"Issue priority: trivial, minor, major, critical, blocker (for 'create', 'update')"`
	Assignee  string `json:"assignee,omitempty" jsonschema:"Account ID of the user assigned to the issue (for 'create', 'update')"`
	Query     string `json:"query,omitempty" jsonschema:"Filter query (for 'list')"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number"`
	Pagelen   int    `json:"pagelen,omitempty" jsonschema:"Results per page"`
}

type ManagePRCommentsArgs

type ManagePRCommentsArgs struct {
	Action    string `` /* 168-byte string literal not displayed */
	Workspace string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug  string `json:"repo_slug" jsonschema:"Repository slug"`
	PRID      int    `json:"pr_id" jsonschema:"Pull request ID"`
	CommentID int    `json:"comment_id,omitempty" jsonschema:"Comment ID (for 'update', 'delete', 'resolve', 'unresolve')"`
	Content   string `json:"content,omitempty" jsonschema:"Markdown content (for 'create', 'update')"`
	ParentID  int    `json:"parent_id,omitempty" jsonschema:"Parent comment ID to reply to (for 'create')"`
	FilePath  string `json:"file_path,omitempty" jsonschema:"File path for inline comments (for 'create')"`
	LineFrom  int    `json:"line_from,omitempty" jsonschema:"Line number the comment applies to for deleted lines (for 'create')"`
	LineTo    int    `json:"line_to,omitempty" jsonschema:"Line number the comment applies to for new/modified lines (for 'create')"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number"`
	Pagelen   int    `json:"pagelen,omitempty" jsonschema:"Results per page (default 50)"`
}

type ManagePipelinesArgs

type ManagePipelinesArgs struct {
	Action       string `` /* 172-byte string literal not displayed */
	Workspace    string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug     string `json:"repo_slug" jsonschema:"Repository slug"`
	PipelineUUID string `json:"pipeline_uuid,omitempty" jsonschema:"Pipeline UUID"`
	StepUUID     string `json:"step_uuid,omitempty" jsonschema:"Step UUID (for 'get-step-log')"`
	RefType      string `json:"ref_type,omitempty" jsonschema:"Reference type: branch or tag (default branch) (for 'trigger')"`
	RefName      string `json:"ref_name,omitempty" jsonschema:"Branch or tag name to run pipeline on (for 'trigger')"`
	Pattern      string `json:"pattern,omitempty" jsonschema:"Custom pipeline pattern name to trigger (for 'trigger')"`
	Page         int    `json:"page,omitempty" jsonschema:"Page number"`
	Pagelen      int    `json:"pagelen,omitempty" jsonschema:"Results per page"`
	Sort         string `json:"sort,omitempty" jsonschema:"Sort field"`
	Status       string `json:"status,omitempty" jsonschema:"Filter by status"`
}

type ManagePullRequestsArgs

type ManagePullRequestsArgs struct {
	Action            string `` /* 273-byte string literal not displayed */
	Workspace         string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug          string `json:"repo_slug" jsonschema:"Repository slug"`
	PRID              int    `json:"pr_id,omitempty" jsonschema:"Pull request ID"`
	Title             string `json:"title,omitempty" jsonschema:"Title of the pull request (for 'create', 'update')"`
	Description       string `json:"description,omitempty" jsonschema:"Description of the pull request (for 'create', 'update')"`
	SourceBranch      string `json:"source_branch,omitempty" jsonschema:"Source branch name (for 'create')"`
	DestinationBranch string `json:"destination_branch,omitempty" jsonschema:"Destination branch name (for 'create')"`
	CloseSourceBranch bool   `json:"close_source_branch,omitempty" jsonschema:"Close source branch (for 'create', 'merge')"`
	Draft             bool   `json:"draft,omitempty" jsonschema:"Create as a draft PR (for 'create')"`
	Message           string `json:"message,omitempty" jsonschema:"Commit message (for 'merge')"`
	MergeStrategy     string `json:"merge_strategy,omitempty" jsonschema:"Merge strategy (e.g. merge_commit, squash, fast_forward) (for 'merge')"`
	State             string `json:"state,omitempty" jsonschema:"Filter by state (MERGED, SUPERSEDED, OPEN, DECLINED) (for 'list')"`
	Query             string `json:"query,omitempty" jsonschema:"Filter query (for 'list')"`
	Page              int    `json:"page,omitempty" jsonschema:"Page number"`
	Pagelen           int    `json:"pagelen,omitempty" jsonschema:"Results per page"`
}

type ManageRefsArgs

type ManageRefsArgs struct {
	Action    string `` /* 203-byte string literal not displayed */
	Workspace string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug  string `json:"repo_slug" jsonschema:"Repository slug"`
	Name      string `json:"name,omitempty" jsonschema:"Branch or tag name (required for create/delete)"`
	Target    string `json:"target,omitempty" jsonschema:"Target commit hash (required for create-tag)"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number (for list)"`
	Pagelen   int    `json:"pagelen,omitempty" jsonschema:"Results per page (for list)"`
	Query     string `json:"query,omitempty" jsonschema:"Filter query (for list-branches)"`
	Sort      string `json:"sort,omitempty" jsonschema:"Sort field (for list-branches)"`
}

type ManageRepositoriesArgs

type ManageRepositoriesArgs struct {
	Action      string `json:"action" jsonschema:"Action to perform: 'list', 'get', 'create', 'delete'" jsonschema_enum:"list,get,create,delete"`
	Workspace   string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug    string `json:"repo_slug,omitempty" jsonschema:"Repository slug (required for 'get', 'create', 'delete')"`
	Description string `json:"description,omitempty" jsonschema:"Repository description (for 'create')"`
	Language    string `json:"language,omitempty" jsonschema:"Primary programming language (for 'create')"`
	IsPrivate   *bool  `json:"is_private,omitempty" jsonschema:"Whether the repo is private (default true, for 'create')"`
	ProjectKey  string `json:"project_key,omitempty" jsonschema:"Project key to assign the repo to (for 'create')"`
	Pagelen     int    `json:"pagelen,omitempty" jsonschema:"Results per page (default 25)"`
	Page        int    `json:"page,omitempty" jsonschema:"Page number"`
	Query       string `json:"query,omitempty" jsonschema:"Bitbucket query filter (e.g. name~'myrepo')"`
	Role        string `json:"role,omitempty" jsonschema:"Filter by role: owner, admin, contributor, member"`
	Sort        string `json:"sort,omitempty" jsonschema:"Sort field (e.g. -updated_on)"`
}

type ManageSourceArgs

type ManageSourceArgs struct {
	Action    string `` /* 214-byte string literal not displayed */
	Workspace string `json:"workspace" jsonschema:"Workspace slug"`
	RepoSlug  string `json:"repo_slug" jsonschema:"Repository slug"`
	Path      string `json:"path,omitempty" jsonschema:"Path to the file or directory"`
	Ref       string `json:"ref,omitempty" jsonschema:"Commit hash, branch, or tag (default: HEAD)"`
	Query     string `json:"query,omitempty" jsonschema:"Search query"`
	Content   string `json:"content,omitempty" jsonschema:"Content to write to the file"`
	Message   string `json:"message,omitempty" jsonschema:"Commit message"`
	Branch    string `json:"branch,omitempty" jsonschema:"Branch to commit to"`
	Author    string `json:"author,omitempty" jsonschema:"Commit author in 'Name <email>' format"`
	MaxDepth  int    `json:"max_depth,omitempty" jsonschema:"Maximum depth of recursion (for list_directory)"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number"`
	Pagelen   int    `json:"pagelen,omitempty" jsonschema:"Results per page"`
}

type ManageWorkspacesArgs

type ManageWorkspacesArgs struct {
	Action    string `json:"action" jsonschema:"Action to perform: 'list', 'get'" jsonschema_enum:"list,get"`
	Workspace string `json:"workspace,omitempty" jsonschema:"Workspace slug or UUID (required for 'get')"`
	Pagelen   int    `json:"pagelen,omitempty" jsonschema:"Number of results per page (default 25)"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL