ChatGPT MCP for Self-Hosted GitLab Repositories
Provides read-only access to a self-managed GitLab instance, enabling inspection of projects, repository trees, files, code search, merge requests, pipelines, pipeline jobs, and job logs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ChatGPT MCP for Self-Hosted GitLab RepositoriesWhat's the current pipeline status for the most recent merge request in the payments repo?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ChatGPT MCP for Self-Hosted GitLab Repositories
A small, read-only MCP server that lets ChatGPT inspect repositories on a self-managed GitLab instance, including instances that are only reachable from your laptop, VPN, or private network.
The key idea is:
ChatGPT
│
│ Secure MCP Tunnel (outbound HTTPS)
▼
OpenAI tunnel service
▲
│
Your Mac / Linux host
├── tunnel-client
└── this MCP server (stdio)
│
│ GitLab REST API (HTTP or HTTPS)
▼
Self-hosted GitLabThe GitLab server does not need to be directly reachable from the public Internet. The machine running this project only needs to be able to reach both your GitLab instance and OpenAI over outbound HTTPS.
What it exposes
The current server intentionally has no write tools:
gitlab_whoamilist_projectsget_repository_treeget_filesearch_codeget_merge_requestget_merge_request_diffget_pipelinesget_pipeline_jobsget_job_log
Large files, MR diffs, and CI logs are capped to avoid flooding the model context.
Related MCP server: GitLab MCP Server
Quick start
git clone https://github.com/phoenixjyb/chatgptMCPforOwnGitlabRepos.git
cd chatgptMCPforOwnGitlabRepos
cp .env.example .env
chmod 600 .env
# edit .env with your GitLab URL and read-only token
uv sync
uv run python smoke_test.py
uv run mcp dev server.pyIf the Inspector tests work, connect the same stdio server to ChatGPT using OpenAI Secure MCP Tunnel.
Documentation
English setup guide: docs/SETUP_TUTORIAL.md
中文配置教程: docs/SETUP_TUTORIAL_CN.md
Troubleshooting: docs/TROUBLESHOOTING.md
v0.2 write-access design: docs/V0.2_WRITE_ACCESS_DESIGN.md
Changelog: CHANGELOG.md
Security defaults
.envis ignored by Git.Use a dedicated token with only
read_apiandread_repository.Prefer a project/group access token or a dedicated read-only account when practical.
Set
GITLAB_ALLOWED_PROJECTSto limit what ChatGPT can inspect.All MCP tools are declared read-only.
Host proxy variables are ignored by default for GitLab traffic (
GITLAB_TRUST_ENV=false).Never commit your GitLab token, OpenAI runtime API key, or tunnel ID unless you intentionally want the tunnel ID public.
HTTP GitLab instances
The MCP-to-GitLab hop can use HTTP if that is how your internal GitLab is currently deployed. This does not make HTTP safe: the GitLab token and response content are not TLS-protected on that network segment. Keep the MCP host and GitLab on a trusted network/VPN and migrate to HTTPS when practical.
The ChatGPT-to-MCP side still uses OpenAI Secure MCP Tunnel over outbound HTTPS.
Requirements
Python 3.10+
A self-managed GitLab token with read permissions
ChatGPT Developer Mode with custom MCP access appropriate to your plan
OpenAI
tunnel-clientfor private/local MCP servers
Roadmap
v0.1.x: read-only GitLab inspection through ChatGPT.
v0.2.0: controlled local worktrees, code edits, build/test execution, commit, push, and Merge Request creation. See the v0.2 design proposal.
License
Apache License 2.0. See LICENSE.
Status
Initial public version: 0.1.0.
This project started as a working setup for an internal self-hosted GitLab and has been generalized so the repository does not contain deployment secrets or a hard-coded private hostname.
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Read-only access to your CodeMouse accounts, repositories, and AI pull-request reviews.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables AI-powered exploration and interaction with GitLab instances through comprehensive search, code browsing, and repository management. Supports both self-hosted and GitLab.com with flexible authentication for read and write operations.6399 npm10MIT
- FlicenseNot gradedqualityNot gradedmaintenanceConnects AI assistants to GitLab projects, enabling natural language queries to view merge requests, code reviews, test reports, pipeline statuses, and respond to discussions.-
- FlicenseNot gradedqualityNot gradedmaintenanceConnects AI assistants to GitLab, enabling natural language queries for merge requests, code reviews, pipeline tests, job logs, and commit discussions directly from chat.-
- FlicenseNot gradedqualityNot gradedmaintenanceConnects AI assistants to GitLab projects, enabling users to query merge requests, review discussions, view test results and pipelines, search by branch, and respond to comments through natural language commands.-