mcp-gitlab 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. mcp_gitlab-0.3.0/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
  2. mcp_gitlab-0.3.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  3. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/.gitignore +3 -0
  4. mcp_gitlab-0.3.0/AGENTS.md +74 -0
  5. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/PKG-INFO +28 -14
  6. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/README.md +26 -13
  7. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/pyproject.toml +2 -1
  8. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/servers/gitlab.py +246 -83
  9. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/uv.lock +1 -1
  10. mcp_gitlab-0.2.0/AGENTS.md +0 -34
  11. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/.env.example +0 -0
  12. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/.github/workflows/lint.yml +0 -0
  13. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/.github/workflows/publish.yml +0 -0
  14. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/.github/workflows/release.yml +0 -0
  15. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/.github/workflows/tests.yml +0 -0
  16. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/LICENSE +0 -0
  17. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/__init__.py +0 -0
  18. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/__main__.py +0 -0
  19. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/client.py +0 -0
  20. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/config.py +0 -0
  21. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/exceptions.py +0 -0
  22. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/__init__.py +0 -0
  23. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/approvals.py +0 -0
  24. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/base.py +0 -0
  25. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/ci.py +0 -0
  26. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/common.py +0 -0
  27. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/issues.py +0 -0
  28. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/merge_requests.py +0 -0
  29. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/pipelines.py +0 -0
  30. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/projects.py +0 -0
  31. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/models/repositories.py +0 -0
  32. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/py.typed +0 -0
  33. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/servers/__init__.py +0 -0
  34. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/src/mcp_gitlab/utils/__init__.py +0 -0
  35. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/tests/__init__.py +0 -0
  36. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/tests/conftest.py +0 -0
  37. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/tests/unit/__init__.py +0 -0
  38. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/tests/unit/test_client.py +0 -0
  39. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/tests/unit/test_config.py +0 -0
  40. {mcp_gitlab-0.2.0 → mcp_gitlab-0.3.0}/tests/unit/test_exceptions.py +0 -0
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug or unexpected behavior
4
+ title: ""
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ **Tool name**
10
+ Which tool(s) are affected? (e.g. `gitlab_create_mr`, `gitlab_list_pipelines`)
11
+
12
+ **Describe the bug**
13
+ A clear description of what happened.
14
+
15
+ **Expected behavior**
16
+ What should have happened instead.
17
+
18
+ **Error output**
19
+ ```
20
+ Paste the error JSON or traceback here
21
+ ```
22
+
23
+ **Environment**
24
+ - mcp-gitlab version: (e.g. 0.2.0)
25
+ - Python version:
26
+ - MCP client: (e.g. Claude Code, Cursor, VS Code)
27
+ - GitLab version: (e.g. 17.x, gitlab.com)
28
+
29
+ **Additional context**
30
+ Any other relevant details.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest a new tool or enhancement
4
+ title: ""
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ **Is this a new tool or an enhancement to an existing one?**
10
+ New tool / Enhancement
11
+
12
+ **Describe the feature**
13
+ What GitLab API endpoint or workflow should be supported?
14
+
15
+ **GitLab API reference**
16
+ Link to the relevant [GitLab REST API docs](https://docs.gitlab.com/api/).
17
+
18
+ **Use case**
19
+ How would you use this feature?
@@ -32,3 +32,6 @@ Thumbs.db
32
32
  .idea/
33
33
  .vscode/
34
34
  *.iml
35
+ .claude/
36
+ .cursorrules
37
+ .cursor/
@@ -0,0 +1,74 @@
1
+ # mcp-gitlab — Agent Context
2
+
3
+ MCP server providing 76 tools for the GitLab REST API v4.
4
+
5
+ ## Architecture
6
+
7
+ - **Entry point**: `src/mcp_gitlab/__init__.py` — click CLI, loads env, runs FastMCP server
8
+ - **Client**: `src/mcp_gitlab/client.py` — async httpx client with all GitLab API methods
9
+ - **Tools**: `src/mcp_gitlab/servers/gitlab.py` — all FastMCP tool registrations
10
+ - **Models**: `src/mcp_gitlab/models/` — Pydantic models for typed API responses (unused by tools)
11
+ - **Config**: `src/mcp_gitlab/config.py` — `GitLabConfig` dataclass from env vars
12
+ - **Exceptions**: `src/mcp_gitlab/exceptions.py` — `GitLabApiError`, `GitLabAuthError`, etc.
13
+
14
+ ## Patterns
15
+
16
+ - All tools are `async def` returning JSON strings
17
+ - Error handling: try/except wrapping every tool, returning `{"error": ...}` JSON
18
+ - Write access control: `_check_write(ctx)` raises `GitLabWriteDisabledError` when `GITLAB_READ_ONLY=true`
19
+ - Tags: every tool tagged with `{"gitlab", "<category>", "read"|"write"}`
20
+ - Parameters use `Annotated[type, Field(description=...)]`
21
+ - Client uses httpx with `PRIVATE-TOKEN` header auth
22
+ - Project/group IDs can be numeric or URL-encoded paths
23
+
24
+ ## MCP Compliance Rules
25
+
26
+ ### Tool Annotations (MANDATORY)
27
+ Every tool MUST have `annotations={}` with at minimum `readOnlyHint`.
28
+ - Read tools: `annotations={"readOnlyHint": True, "idempotentHint": True}`
29
+ - Non-destructive write tools: `annotations={"readOnlyHint": False}`
30
+ - Destructive write tools: `annotations={"destructiveHint": True, "readOnlyHint": False}`
31
+ - Idempotent writes (PUT/update): add `idempotentHint: True`
32
+
33
+ ### Tool Descriptions
34
+ - 1-2 sentences. Front-load what it does AND what it returns.
35
+ - Bad: "This tool gets a merge request."
36
+ - Good: "Get merge request details. Returns title, state, branches, author, diff_refs."
37
+
38
+ ### Error Handling
39
+ - Every tool MUST wrap in try/except and return `_err(e)` — never raise.
40
+ - Error text MUST be actionable: include what went wrong and suggest a fix.
41
+ - Never return concatenated JSON strings — always a single valid JSON object.
42
+ - Never expose stack traces, tokens, or internal paths.
43
+
44
+ ### Parameter Design
45
+ - Use `Annotated[type, Field(description="...")]` on every parameter.
46
+ - Use `Literal[...]` for known value sets instead of plain `str`.
47
+ - Every optional parameter must have a default.
48
+ - Flatten — no nested dicts unless truly necessary.
49
+
50
+ ### Read-Only Mode
51
+ - Every write tool MUST call `_check_write(ctx)` before any mutation.
52
+
53
+ ### Naming Convention
54
+ - Pattern: `gitlab_{verb}_{resource}` (snake_case)
55
+ - Verbs: create, get, list, search, update, delete, merge, rebase, retry, play, cancel, award, remove, share, unshare, compare, add, reply, resolve
56
+
57
+ ## Tool Categories
58
+
59
+ Projects (4), Approvals (10), Groups (6), Branches (3), Commits (4), Merge Requests (8), MR Notes (6), MR Discussions (4), Pipelines (5), Jobs (4), Tags (4), Releases (5), CI/CD Variables (8), Issues (5)
60
+
61
+ ## Environment Variables
62
+
63
+ - `GITLAB_URL` (required) — GitLab instance base URL
64
+ - `GITLAB_TOKEN` or `GITLAB_PAT` (required) — Personal access token
65
+ - `GITLAB_READ_ONLY` — disable mutations
66
+ - `GITLAB_TIMEOUT` — request timeout seconds
67
+ - `GITLAB_SSL_VERIFY` — SSL verification toggle
68
+
69
+ ## Known Limitations / Future Work
70
+
71
+ - 76 tools in one server file (exceeds 5-15 guideline). Consider splitting by category in a future refactor.
72
+ - Pydantic models in `models/` are defined but unused — tools work with raw dicts. Consider removing or wiring up.
73
+ - No tool-level tests. Client tests exist but the MCP registration layer (`servers/gitlab.py`) is untested.
74
+ - Errors are returned as successful tool results with `{"error": ...}` (soft-error pattern). Callers must inspect JSON content.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-gitlab
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: MCP server for GitLab API — projects, MRs, pipelines, CI/CD variables, approvals, and more
5
5
  Project-URL: Homepage, https://github.com/vish288/mcp-gitlab
6
6
  Project-URL: Repository, https://github.com/vish288/mcp-gitlab
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
21
  Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
22
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
25
  Classifier: Topic :: Software Development :: Version Control :: Git
@@ -43,11 +44,19 @@ Description-Content-Type: text/markdown
43
44
 
44
45
  Built with [FastMCP](https://github.com/jlowin/fastmcp), [httpx](https://www.python-httpx.org/), and [Pydantic](https://docs.pydantic.dev/).
45
46
 
46
- ## Quick Install
47
+ ## 1-Click Installation
47
48
 
48
- ### Cursor
49
+ [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://vish288.github.io/mcp-gitlab-cursor-redirect.html?install=cursor)
49
50
 
50
- [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=mcp-gitlab&config=eyJtY3BTZXJ2ZXJzIjogeyJnaXRsYWIiOiB7ImNvbW1hbmQiOiAidXZ4IiwgImFyZ3MiOiBbIm1jcC1naXRsYWIiXSwgImVudiI6IHsiR0lUTEFCX1VSTCI6ICJodHRwczovL2dpdGxhYi5leGFtcGxlLmNvbSIsICJHSVRMQUJfVE9LRU4iOiAieW91ci10b2tlbiJ9fX19)
51
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vish288.github.io/mcp-gitlab-cursor-redirect.html?install=vscode) [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vish288.github.io/mcp-gitlab-cursor-redirect.html?install=vscode-insiders)
52
+
53
+ > **💡 Tip:** For other AI assistants (Claude Code, Windsurf, IntelliJ), visit the **[GitLab MCP Installation Gateway](https://vish288.github.io/mcp-gitlab-cursor-redirect.html)**.
54
+
55
+ <details>
56
+ <summary><b>Manual Setup Guides (Click to expand)</b></summary>
57
+ <br/>
58
+
59
+ > Prerequisite: Install `uv` first (required for all `uvx` install flows). [Install uv](https://docs.astral.sh/uv/getting-started/installation/).
51
60
 
52
61
  ### Claude Code
53
62
 
@@ -55,9 +64,12 @@ Built with [FastMCP](https://github.com/jlowin/fastmcp), [httpx](https://www.pyt
55
64
  claude mcp add gitlab -- uvx mcp-gitlab
56
65
  ```
57
66
 
58
- ### Windsurf / VS Code
67
+ ### Windsurf & IntelliJ
59
68
 
60
- Add to your MCP config file:
69
+ **Windsurf:** Add to `~/.codeium/windsurf/mcp_config.json`
70
+ **IntelliJ:** Add to `Settings | Tools | MCP Servers`
71
+
72
+ > **Note:** The actual server config starts at `gitlab` inside the `mcpServers` object.
61
73
 
62
74
  ```json
63
75
  {
@@ -80,15 +92,17 @@ Add to your MCP config file:
80
92
  uv pip install mcp-gitlab
81
93
  ```
82
94
 
95
+ </details>
96
+
83
97
  ## Configuration
84
98
 
85
- | Variable | Required | Description |
86
- |----------|----------|-------------|
87
- | `GITLAB_URL` | Yes | GitLab instance URL (e.g. `https://gitlab.example.com`) |
88
- | `GITLAB_TOKEN` | Yes | Authentication token (see below) |
89
- | `GITLAB_READ_ONLY` | No | Set to `true` to disable write operations |
90
- | `GITLAB_TIMEOUT` | No | Request timeout in seconds (default: 30) |
91
- | `GITLAB_SSL_VERIFY` | No | Set to `false` to skip SSL verification |
99
+ | Variable | Required | Default | Description |
100
+ |----------|----------|---------|-------------|
101
+ | `GITLAB_URL` | **Yes** | - | GitLab instance URL (e.g. `https://gitlab.example.com`) |
102
+ | `GITLAB_TOKEN` | **Yes** | - | Authentication token (see below) |
103
+ | `GITLAB_READ_ONLY` | No | `false` | Set to `true` to disable write operations |
104
+ | `GITLAB_TIMEOUT` | No | `30` | Request timeout in seconds |
105
+ | `GITLAB_SSL_VERIFY` | No | `true` | Set to `false` to skip SSL verification |
92
106
 
93
107
  ### Supported Token Types
94
108
 
@@ -107,8 +121,8 @@ uv pip install mcp-gitlab
107
121
  | Claude Desktop | Yes | `claude_desktop_config.json` |
108
122
  | Claude Code | Yes | `claude mcp add` |
109
123
  | Cursor | Yes | One-click deeplink or `.cursor/mcp.json` |
124
+ | VS Code Copilot | Yes | One-click deeplink or `.vscode/mcp.json` |
110
125
  | Windsurf | Yes | `~/.codeium/windsurf/mcp_config.json` |
111
- | VS Code Copilot | Yes | `.vscode/mcp.json` |
112
126
  | Any MCP client | Yes | stdio or HTTP transport |
113
127
 
114
128
  ## Tools (76)
@@ -10,11 +10,19 @@
10
10
 
11
11
  Built with [FastMCP](https://github.com/jlowin/fastmcp), [httpx](https://www.python-httpx.org/), and [Pydantic](https://docs.pydantic.dev/).
12
12
 
13
- ## Quick Install
13
+ ## 1-Click Installation
14
14
 
15
- ### Cursor
15
+ [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://vish288.github.io/mcp-gitlab-cursor-redirect.html?install=cursor)
16
16
 
17
- [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=mcp-gitlab&config=eyJtY3BTZXJ2ZXJzIjogeyJnaXRsYWIiOiB7ImNvbW1hbmQiOiAidXZ4IiwgImFyZ3MiOiBbIm1jcC1naXRsYWIiXSwgImVudiI6IHsiR0lUTEFCX1VSTCI6ICJodHRwczovL2dpdGxhYi5leGFtcGxlLmNvbSIsICJHSVRMQUJfVE9LRU4iOiAieW91ci10b2tlbiJ9fX19)
17
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vish288.github.io/mcp-gitlab-cursor-redirect.html?install=vscode) [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vish288.github.io/mcp-gitlab-cursor-redirect.html?install=vscode-insiders)
18
+
19
+ > **💡 Tip:** For other AI assistants (Claude Code, Windsurf, IntelliJ), visit the **[GitLab MCP Installation Gateway](https://vish288.github.io/mcp-gitlab-cursor-redirect.html)**.
20
+
21
+ <details>
22
+ <summary><b>Manual Setup Guides (Click to expand)</b></summary>
23
+ <br/>
24
+
25
+ > Prerequisite: Install `uv` first (required for all `uvx` install flows). [Install uv](https://docs.astral.sh/uv/getting-started/installation/).
18
26
 
19
27
  ### Claude Code
20
28
 
@@ -22,9 +30,12 @@ Built with [FastMCP](https://github.com/jlowin/fastmcp), [httpx](https://www.pyt
22
30
  claude mcp add gitlab -- uvx mcp-gitlab
23
31
  ```
24
32
 
25
- ### Windsurf / VS Code
33
+ ### Windsurf & IntelliJ
26
34
 
27
- Add to your MCP config file:
35
+ **Windsurf:** Add to `~/.codeium/windsurf/mcp_config.json`
36
+ **IntelliJ:** Add to `Settings | Tools | MCP Servers`
37
+
38
+ > **Note:** The actual server config starts at `gitlab` inside the `mcpServers` object.
28
39
 
29
40
  ```json
30
41
  {
@@ -47,15 +58,17 @@ Add to your MCP config file:
47
58
  uv pip install mcp-gitlab
48
59
  ```
49
60
 
61
+ </details>
62
+
50
63
  ## Configuration
51
64
 
52
- | Variable | Required | Description |
53
- |----------|----------|-------------|
54
- | `GITLAB_URL` | Yes | GitLab instance URL (e.g. `https://gitlab.example.com`) |
55
- | `GITLAB_TOKEN` | Yes | Authentication token (see below) |
56
- | `GITLAB_READ_ONLY` | No | Set to `true` to disable write operations |
57
- | `GITLAB_TIMEOUT` | No | Request timeout in seconds (default: 30) |
58
- | `GITLAB_SSL_VERIFY` | No | Set to `false` to skip SSL verification |
65
+ | Variable | Required | Default | Description |
66
+ |----------|----------|---------|-------------|
67
+ | `GITLAB_URL` | **Yes** | - | GitLab instance URL (e.g. `https://gitlab.example.com`) |
68
+ | `GITLAB_TOKEN` | **Yes** | - | Authentication token (see below) |
69
+ | `GITLAB_READ_ONLY` | No | `false` | Set to `true` to disable write operations |
70
+ | `GITLAB_TIMEOUT` | No | `30` | Request timeout in seconds |
71
+ | `GITLAB_SSL_VERIFY` | No | `true` | Set to `false` to skip SSL verification |
59
72
 
60
73
  ### Supported Token Types
61
74
 
@@ -74,8 +87,8 @@ uv pip install mcp-gitlab
74
87
  | Claude Desktop | Yes | `claude_desktop_config.json` |
75
88
  | Claude Code | Yes | `claude mcp add` |
76
89
  | Cursor | Yes | One-click deeplink or `.cursor/mcp.json` |
90
+ | VS Code Copilot | Yes | One-click deeplink or `.vscode/mcp.json` |
77
91
  | Windsurf | Yes | `~/.codeium/windsurf/mcp_config.json` |
78
- | VS Code Copilot | Yes | `.vscode/mcp.json` |
79
92
  | Any MCP client | Yes | stdio or HTTP transport |
80
93
 
81
94
  ## Tools (76)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mcp-gitlab"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "MCP server for GitLab API — projects, MRs, pipelines, CI/CD variables, approvals, and more"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -34,6 +34,7 @@ classifiers = [
34
34
  "Programming Language :: Python :: 3.11",
35
35
  "Programming Language :: Python :: 3.12",
36
36
  "Programming Language :: Python :: 3.13",
37
+ "Programming Language :: Python :: 3.14",
37
38
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
38
39
  "Topic :: Software Development :: Libraries :: Python Modules",
39
40
  "Topic :: Software Development :: Version Control :: Git",