tanuki-mcp
A high-performance GitLab MCP (Model Context Protocol) server written in Rust with fine-grained access control.
Inspired by zereight/gitlab-mcp.
Features
- 121 GitLab Tools across 20 categories
- Built-in Prompts for issue analysis and MR review workflows
- Resource Access via
gitlab://URI scheme for file reading - Fine-Grained Access Control with hierarchical overrides
- Two Transport Modes: stdio (Claude Code) and HTTP (Streamable HTTP)
- Real-Time Dashboard for monitoring usage
- Project-Specific Permissions for granular control
- Pattern-Based Rules using regex for allow/deny lists
MCP Capabilities
tanuki-mcp implements the full MCP specification with tools, prompts, and resources.
Prompts
Built-in workflow prompts for common GitLab tasks:
| Prompt | Description | Arguments |
|---|---|---|
analyze_issue |
Analyze an issue with discussions and related MRs | project, issue_iid |
review_merge_request |
Review an MR with changes and discussions | project, mr_iid |
Usage in Claude Code:
Use the analyze_issue prompt for project "group/repo" issue 42
Resources
Read GitLab repository files using the gitlab:// URI scheme:
gitlab://{project}/{file_path}?ref={branch}
Examples:
gitlab://group%2Fproject/README.md- Default branchgitlab://group%2Fproject/src/main.rs?ref=develop- Specific branch
Note: Project path must be URL-encoded (/ → %2F)
Quick Start
Using Docker
# Run with stdio transport
# Run with HTTP transport
Using Pre-Built Binary
# Download from releases
# Set token and run
Using cargo-binstall (Recommended)
# Install cargo-binstall if needed
# Install tanuki-mcp (downloads pre-built binary)
From crates.io
Building from Source
Configuration
Create tanuki-mcp.toml:
[]
= "https://gitlab.com"
= "glpat-xxxxxxxxxxxxxxxxxxxx"
[]
= "read"
[]
= "full"
[]
= "full"
= ["merge_merge_request"]
See docs/CONFIGURATION.md for complete reference.
Access Control
tanuki-mcp provides hierarchical access control:
Global Base → Category → Action → Project-Specific
Access Levels
| Level | Description |
|---|---|
none |
No access decision at this level |
deny |
Explicitly deny all operations |
read |
Read-only (list, get, search) |
full |
Full access (create, update, delete, execute) |
Example: Production-Safe Setup
[]
= "read"
= ["delete_.*"]
[]
= "full"
[]
= "read"
= [".*"]
= ["list_.*", "get_.*"]
See docs/ACCESS_CONTROL.md for detailed documentation.
Tool Categories
| Category | Tools | Description |
|---|---|---|
| issues | 8 | Issue management |
| issue_notes | 5 | Issue comments |
| issue_links | 3 | Issue relationships |
| merge_requests | 8 | MR management |
| mr_discussions | 7 | MR threads |
| mr_drafts | 7 | Draft notes |
| repository | 7 | Files and search |
| branches | 2 | Branch operations |
| commits | 3 | Commit operations |
| projects | 6 | Project management |
| namespaces | 3 | Namespaces |
| labels | 5 | Labels |
| wiki | 5 | Wiki pages |
| pipelines | 12 | CI/CD |
| milestones | 9 | Milestones |
| releases | 6 | Releases |
| users | 2 | Users |
| groups | 2 | Groups |
| tags | 9 | Git tags |
| search | 5 | Search |
Transport Modes
stdio (Default)
For integration with Claude Code:
HTTP (Streamable HTTP)
For web clients and programmatic access:
Endpoints:
/mcp- MCP protocol (Streamable HTTP)/health- Health check ({"status": "ok"})
Dashboard
Access the monitoring dashboard at http://localhost:19892:
- Configuration summary
- Project access statistics
- Tool usage metrics
- Recent request log
# Disable dashboard
# Custom port
Environment Variables
TANUKI_MCP__GITLAB_URL=https://gitlab.com
TANUKI_MCP__GITLAB_TOKEN=glpat-xxx
TANUKI_MCP__SERVER_TRANSPORT=http
TANUKI_MCP__ACCESS_CONTROL_ALL=read
TANUKI_MCP__DASHBOARD_ENABLED=true
CLI Arguments
| Argument | Description | Default |
|---|---|---|
--config, -c |
Configuration file path | Auto-detected |
--http |
Use HTTP transport instead of stdio | false |
--host |
HTTP server bind address | 127.0.0.1 |
--port |
HTTP server port | 20289 |
--log-level |
Log level (trace, debug, info, warn, error) | info |
--no-dashboard |
Disable the monitoring dashboard | false |
--dashboard-port |
Dashboard server port | 19892 |
Requirements
- Rust 1.83+ (for building from source)
- GitLab Personal Access Token with appropriate scopes:
read_apifor read operationsapifor full functionality
Development
Dependencies
# Task runner (https://taskfile.dev)
# For release management (cargo set-version --bump)
Available Tasks
Creating a Release
# Tag current version, bump minor (runs check + e2e)
# Skip E2E tests
# Custom version
License
MIT