stash-mcp
v1.0.0
Published
MCP server for Bitbucket Server (Stash) REST API
Maintainers
Readme
stash-mcp
A Model Context Protocol (MCP) server for Bitbucket Server / Data Center (formerly Atlassian Stash). Enables AI assistants (GitHub Copilot, Claude, Cursor, etc.) to interact with your self-hosted Bitbucket repositories, pull requests, branches, and more.
Features
- 📁 List projects and repositories
- 🔍 Get repository details
- 🔀 List, view, create, and comment on pull requests
- 🌿 List branches and commits
- 📄 Read file contents
Prerequisites
- Node.js 18+
- A Bitbucket Server / Data Center instance
- A personal access token (PAT) from your Bitbucket Server
Generating a Personal Access Token
- Log in to your Bitbucket Server instance
- Go to Profile → Manage account → Personal access tokens
- Create a token with read permissions (add write if you want to create PRs or add comments)
Installation & Usage
Via npx (recommended)
No installation needed:
STASH_URL=https://your-bitbucket-server.com \
STASH_TOKEN=your-personal-access-token \
npx stash-mcpGlobal install
npm install -g stash-mcp
STASH_URL=https://your-bitbucket-server.com STASH_TOKEN=your-token stash-mcpConfiguration
| Environment Variable | Required | Description |
|----------------------|----------|-------------|
| STASH_URL | ✅ Yes | Base URL of your Bitbucket Server (e.g. https://bitbucket.example.com) |
| STASH_TOKEN | ✅ Yes | Personal access token for authentication |
MCP Client Configuration
Add to your MCP client config (e.g. ~/.copilot/mcp-config.json for GitHub Copilot CLI):
{
"mcpServers": {
"stash": {
"type": "stdio",
"command": "npx",
"args": ["-y", "stash-mcp@latest"],
"env": {
"STASH_URL": "https://your-bitbucket-server.com",
"STASH_TOKEN": "your-personal-access-token"
}
}
}
}Cursor / Claude Desktop
{
"mcpServers": {
"stash": {
"command": "npx",
"args": ["-y", "stash-mcp@latest"],
"env": {
"STASH_URL": "https://your-bitbucket-server.com",
"STASH_TOKEN": "your-personal-access-token"
}
}
}
}Available Tools
| Tool | Description |
|------|-------------|
| list_projects | List all Bitbucket Server projects |
| list_repositories | List repos in a project (or all repos) |
| get_repository | Get details of a specific repository |
| list_pull_requests | List PRs (filter by state: OPEN/MERGED/DECLINED/ALL, or author) |
| get_pull_request | Get details of a specific pull request |
| get_pull_request_diff | Get the diff for a pull request |
| list_pr_comments | List comments on a pull request |
| add_pr_comment | Add a comment to a pull request |
| create_pull_request | Create a new pull request |
| list_branches | List branches in a repository |
| list_commits | List commits in a repository or branch |
| get_file_content | Get the content of a file |
Example Usage
Once configured, you can ask your AI assistant things like:
- "List all projects in Bitbucket"
- "Show me the open pull requests in project CF, repo alert-management-system"
- "What branches exist in the pinapps_aws_tp repo?"
- "Get the content of README.md from the main branch of repo X"
- "Create a pull request from feature/my-branch to main"
Contributing
This package is published for public use but does not accept external contributions. Pull requests and issues will not be reviewed or merged.
License
MIT
