summaryrefslogtreecommitdiff
path: root/servers/gitlab_python/README.md
blob: bbd85f701f793b07cd590441f8d81fd91cfde79c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# GitLab Python MCP Server

This MCP server provides integration with GitLab through the python-gitlab library. It allows LLM agents to interact with GitLab repositories and resources using the GitLab API directly (no CLI required).

## Features

- Find GitLab projects by name and retrieve their IDs
- Search for GitLab issues with various filters
- Create new GitLab issues
- (More features to be added in the future)

## Prerequisites

- Python 3.11 or higher
- GitLab account and personal access token

## Configuration

The server will attempt to discover GitLab settings in the following order:

- **Server URL**: Parsed from the current git remote, or from the `GITLAB_URL` environment variable.
- **Token**: Parsed from `~/.config/glab-cli/config.yml` (YAML), or from the `GITLAB_TOKEN` environment variable.

## Installation

```bash
# Clone the repository
cd dawids-mcp-servers
```

## Usage

### Running from repository root (recommended)

```bash
uv --directory /path-to-repo/dawids-mcp-servers/servers/gitlab_python run mcp-gitlab-python --transport stdio

uv --directory /path-to-repo/dawids-mcp-servers/servers/gitlab_python run mcp-gitlab-python --transport remote --host 0.0.0.0 --port 8080
```

### Alternative: Running from server directory

```bash
cd servers/gitlab_python
uv run mcp-gitlab-python --transport stdio
uv run mcp-gitlab-python --transport remote --host 0.0.0.0 --port 8080
```

## Available Tools

### find_project
Finds GitLab projects by name and returns their details.

### search_issues
Search for GitLab issues with various filters.

### create_issue
Creates a new GitLab issue and returns its URL.

## Development

### Running Tests

```bash
cd /path/to/servers/gitlab_python
uv run pytest
```

## License

MIT