GitLab MCP Server provides robust integration with the GitLab API, enabling developers to interact with repositories, issues, merge requests, and project events through natural language commands via stdio and Server-Sent Events (SSE) transports.
Log in to your GitLab account
- Go to GitLab and sign in with your credentials.
Navigate to your GitLab User Settings
- Click on your avatar (top-right corner) and select "Edit profile" or "Preferences".
Access the Access Tokens page
- In the left sidebar, find and click on "Access Tokens" (sometimes under "User Settings" → "Access Tokens" or simply "Access Tokens").
Create a new Personal Access Token
- Name: Enter a descriptive name (e.g., "MCP Server Access").
- Scopes: Select the required scopes for your usage. At minimum, you typically want
api
for full API access (but you may restrict to only the needed scopes).
- Expiration date: Optionally set an expiration date.
- Click the "Create personal access token" button.
Copy the generated token
- Important: The token will be shown only once. Copy it immediately as you will use this value in the FastMCP interface.
Fill in the values in the FastMCP connection interface
- Click the "Install Now" button to open the form in FastMCP.
- For
GITLAB_PERSONAL_ACCESS_TOKEN
, paste the token you just copied.
- (Optional) For
GITLAB_API_URL
, enter a different API URL if you use a self-hosted GitLab instance; otherwise, leave as default (https://gitlab.com/api/v4
).
- (Optional) For read-only mode, add or set
GITLAB_READ_ONLY_MODE
to true
if you want to restrict all operations to read-only.
Save or confirm the connection in FastMCP
- Complete the installation process as required by the FastMCP interface.
You have now configured the necessary environment values for the GitLab MCP server integration!