A Model Context Protocol (MCP) server running natively on Atlassian infrastructure with admin controls, audit logging and OAuth.
AI coding assistants (like Claude Code) connect via Streamable HTTP transport through a Forge web trigger, with OAuth 2.0 with PKCE authentication backed by Bitbucket.
Security:
- audit logging
- read only mode
- tool whitelisting
Tools:
- Repositories — list, search, and browse repositories in a workspace
- Pull Requests — list, view, create, approve, merge PRs; view diffs and comments
- Pipelines — list pipeline runs, view step logs, trigger runs
- Source — browse files and directories, read file contents
- Branches — list and search branches
See SETUP.md for detailed installation and configuration instructions.
| Tool Name | Description |
|---|---|
list_repositories |
List repositories in the workspace with filtering/sorting |
get_repository |
Get detailed information about a specific repository |
| Tool Name | Description |
|---|---|
list_pull_requests |
List PRs in a repository with optional state filtering |
list_workspace_pull_requests |
List PRs across all repositories in the workspace |
get_pull_request |
Get detailed PR information including commits |
create_pull_request |
Create a new pull request |
get_pull_request_diff |
Get the diff content for a PR |
list_pull_request_comments |
List comments on a PR (including inline) |
create_pull_request_comment |
Create a general or inline comment on a PR |
approve_pull_request |
Approve a pull request |
unapprove_pull_request |
Remove approval from a PR |
merge_pull_request |
Merge a PR with configurable strategy |
| Tool Name | Description |
|---|---|
list_pipelines |
List pipeline runs in a repository |
list_workspace_pipelines |
List pipelines across all repositories |
list_pipeline_steps |
List steps for a pipeline run |
get_pipeline_step_log |
Get logs for a pipeline step |
trigger_pipeline |
Trigger a custom pipeline on a branch |
| Tool Name | Description |
|---|---|
get_file_content |
Read file content at a specific ref (branch/tag/commit) |
list_directory |
List files and directories at a path |
list_branches |
List branches in a repository with optional filtering |
| Tool Name | Description |
|---|---|
search_code |
Search for code in repositories across the workspace |
Claude Code ──HTTP POST──▶ Forge Web Trigger ──▶ MCP Handler ──▶ Bitbucket REST API
│
OAuth 2.0 (Bitbucket)
Sessions (Forge KVS)- Transport: Streamable HTTP via a Forge web trigger (dynamic response)
- Auth: OAuth 2.0 with PKCE — users authenticate via Bitbucket, tokens stored in Forge KVS
- Sessions: KVS-backed with 30-minute TTL
pnpm install # install dependencies
pnpm test # run tests (vitest)
forge tunnel # local dev with hot-reload tunnel
forge deploy # deploy to Forge
forge install --upgrade # apply manifest changes (new scopes, egress URLs)src/
admin/ Admin panel resolver and validation (OAuth config management)
audit/ Audit logging (fire-and-forget tool usage tracking)
bitbucket/ Bitbucket API client wrapper
db/ Forge SQL database service
kvs/ Forge KVS service wrapper
mcp/ MCP protocol layer (handler, auth, sessions, protocol helpers)
oauth/ OAuth 2.0 flow (metadata, registration, authorize, callback, token)
posthog/ PostHog analytics client
tools/ Tool implementations (repos, PRs, pipelines, source, branches)
utils/ Shared utilities and validation
bin/ Development scripts (deploy-dev, install-dev)
test/ Tests (vitest)
manifest.yml Forge app manifest
src/index.ts— Main entry point, exports Forge web trigger handlers
src/mcp/handler.ts— Main MCP request handler (JSON-RPC routing, tool execution)src/mcp/session.ts— Session management via KVS (30-min TTL)src/mcp/auth.ts— OAuth token extraction and validationsrc/mcp/protocol.ts— JSON-RPC helpers and HTTP response buildingsrc/mcp/errors.ts— JSON-RPC 2.0 error code constantssrc/mcp/types.ts— Protocol type definitionssrc/mcp/resources.ts— MCP resource registration
src/oauth/router.ts— OAuth endpoint request routersrc/oauth/handlers.ts— OAuth endpoint implementations (metadata, register, authorize, callback, token)src/oauth/config.ts— OAuth configuration and utilities (endpoints, scopes, KVS keys)src/oauth/tokens.ts— Token minting, validation, and refresh logicsrc/oauth/clients.ts— Dynamic client registration (RFC 7591)src/oauth/atlassian.ts— Bitbucket OAuth integration (authorize, token exchange, user lookup)src/oauth/types.ts— OAuth type definitionssrc/oauth/pkce.ts— PKCE verification (RFC 7636)
src/tools/index.ts— Re-exports all tools for convenient importingsrc/tools/registry.ts— Tool registry, execution dispatcher, and dynamic key/label generationsrc/tools/types.ts— Tool context types and result helpers
list-repositories.ts— List repositories in the workspace with filtering/sortingget-repository.ts— Get detailed repository information
list-pull-requests.ts— List PRs in a repository with optional state filteringlist-workspace-pull-requests.ts— List PRs across all repositories in the workspaceget-pull-request.ts— Get detailed PR information including commitscreate-pull-request.ts— Create a new pull requestget-pull-request-diff.ts— Get the diff content for a PRlist-pull-request-comments.ts— List comments on a PR (including inline)create-pull-request-comment.ts— Create a general or inline comment on a PRapprove-pull-request.ts— Approve a pull requestunapprove-pull-request.ts— Remove approval from a PRmerge-pull-request.ts— Merge a PR with configurable strategy
list-pipelines.ts— List pipeline runs in a repositorylist-workspace-pipelines.ts— List pipelines across all repositories in the workspacelist-pipeline-steps.ts— List steps for a pipeline runget-pipeline-step-log.ts— Get logs for a pipeline steptrigger-pipeline.ts— Trigger a custom pipeline on a branch
get-file-content.ts— Read file content at a specific ref (branch/tag/commit)list-directory.ts— List files and directories at a path
list-branches.ts— List branches in a repository with optional filtering
search-code.ts— Search for code in repositories across the workspace
src/bitbucket/client.ts— HTTP client for Bitbucket REST APIsrc/bitbucket/types.ts— Bitbucket API type definitions
src/admin/resolver.ts— Forge Resolver for admin panel UIsrc/admin/api.ts— Web trigger handlers for admin configuration
src/db/migrations.ts— Forge SQL migrations for audit_log tablesrc/audit/log.ts— Audit logging (fire-and-forget tool usage tracking)src/audit/types.ts— Audit type definitions
This project is Fair Source under the FSL (Functional Source License). It is free to use and deploy — including inside enterprise environments — but you may not offer it as a competing commercial service. After two years, the code becomes open source under Apache 2.0.