KosmoKrator

productivity

Bitbucket MCP Integration for LangChain

Connect Bitbucket to LangChain through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

15 functions 9 read 6 write API key auth

Connect Bitbucket to LangChain

Bridge LangChain agents to local KosmoKrator integration tools through MCP or headless CLI calls.

Use the MCP gateway when the agent should discover tools, or wrap kosmo integrations:call for fixed chains. The gateway is local, scoped to this integration, and starts with --write=deny so LangChain can inspect read-capable tools without receiving write access by default.

Bitbucket MCP Config for LangChain

Keep the gateway scoped to the integration and operation class needed by the chain.

{
  "mcpServers": {
    "kosmokrator-bitbucket": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=bitbucket",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=bitbucket --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Bitbucket instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Bitbucket Tools Visible to LangChain

LangChain sees stable MCP tool names generated from the Bitbucket integration catalog.

MCP toolSource functionTypeDescription
integration__bitbucket__bitbucket_list_repos bitbucket.bitbucket_list_repos Read List repositories in a Bitbucket workspace. Supports sorting and pagination.
integration__bitbucket__bitbucket_get_repo bitbucket.bitbucket_get_repo Read Get details for a specific Bitbucket repository by workspace and repo slug.
integration__bitbucket__bitbucket_create_repo bitbucket.bitbucket_create_repo Write Create a new repository in a Bitbucket workspace. Optionally set description, visibility, and language.
integration__bitbucket__bitbucket_list_issues bitbucket.bitbucket_list_issues Read List issues in a Bitbucket repository. Supports filtering by state, kind, and priority.
integration__bitbucket__bitbucket_get_issue bitbucket.bitbucket_get_issue Read Get details for a specific issue in a Bitbucket repository.
integration__bitbucket__bitbucket_create_issue bitbucket.bitbucket_create_issue Write Create a new issue in a Bitbucket repository. Requires a title; optionally set content, kind, priority, and assignee.
integration__bitbucket__bitbucket_update_issue bitbucket.bitbucket_update_issue Write Update an existing issue in a Bitbucket repository. Can change title, content, state, priority, and assignee.
integration__bitbucket__bitbucket_list_pull_requests bitbucket.bitbucket_list_pull_requests Read List pull requests in a Bitbucket repository. Supports filtering by state and pagination.
integration__bitbucket__bitbucket_get_pull_request bitbucket.bitbucket_get_pull_request Read Get details for a specific pull request in a Bitbucket repository.
integration__bitbucket__bitbucket_create_pull_request bitbucket.bitbucket_create_pull_request Write Create a new pull request in a Bitbucket repository. Requires a title, source branch, and destination branch.
integration__bitbucket__bitbucket_merge_pull_request bitbucket.bitbucket_merge_pull_request Write Merge a Bitbucket pull request. Optionally provide a merge commit message.
integration__bitbucket__bitbucket_list_branches bitbucket.bitbucket_list_branches Read List branches in a Bitbucket repository. Supports pagination.
integration__bitbucket__bitbucket_create_branch bitbucket.bitbucket_create_branch Write Create a new branch in a Bitbucket repository. Requires a branch name and the target commit hash.
integration__bitbucket__bitbucket_list_commits bitbucket.bitbucket_list_commits Read List commits in a Bitbucket repository. Supports filtering by revision and path.
integration__bitbucket__bitbucket_get_file bitbucket.bitbucket_get_file Read Get the raw content of a file from a Bitbucket repository at a specific revision.

Related Bitbucket Pages