Content
# gitlab-extended-mcp
MCP server that adds GitLab member management tools missing from the standard `@zereight/mcp-gitlab` server. Exposes four tools for adding, removing, updating, and collecting members across an entire GitLab group hierarchy.
## Tools
| Tool | Description |
|---|---|
| `add_gitlab_member` | Add a user to a group or project (single or recursive BFS through hierarchy) |
| `remove_gitlab_member` | Remove a user from an entire group hierarchy (BFS, direct memberships only) |
| `update_member_role` | Downgrade/upgrade a user's access level across a group hierarchy |
| `collect_group_members` | Collect all members from a group hierarchy, deduplicated with source tracking |
All tools support `dry_run: true` to preview changes without applying them.
## Requirements
```
python >= 3.11
mcp[cli]
requests
```
Install dependencies:
```bash
pip install "mcp[cli]" requests
```
## Configuration
Set two environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
| `GITLAB_PERSONAL_ACCESS_TOKEN` | Yes | — | GitLab PAT with `api` scope |
| `GITLAB_URL` | No | `https://gitlab.com` | Self-hosted GitLab URL |
### Claude Code (MCP config)
Add to your `.mcp.json`:
```json
{
"mcpServers": {
"gitlab-extended": {
"command": "python",
"args": ["/path/to/gitlab-extended-mcp/server.py"],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-YOUR_TOKEN_HERE",
"GITLAB_URL": "https://gitlab.com"
}
}
}
}
```
## Usage examples
```
# Add a user as developer to a group and all its subgroups/projects
add_gitlab_member(username="alice", target_path="myorg/backend", access_level="developer", recursive=True)
# Preview removal before applying
remove_gitlab_member(username="bob", group_path="myorg", dry_run=True)
# Downgrade all maintainers to developer across a group hierarchy
update_member_role(username="carol", group_path="myorg", from_level=40, to_level=30)
# List all members in a group hierarchy
collect_group_members(group_path="myorg", include_projects=True)
```
## License
MIT — see [LICENSE](LICENSE)