> ## Documentation Index
> Fetch the complete documentation index at: https://modem.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GitLab

> Sync merge requests and issues, and let the agent act on them

export const Prompt = ({text, variant = 'accent'}) => {
  const [copied, setCopied] = useState(false);
  const handleCopy = async () => {
    try {
      await navigator.clipboard.writeText(text);
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    } catch {}
  };
  const clipboardIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copy</title>
            <rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
            <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
        </svg>;
  const checkIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copied</title>
            <polyline points="20 6 9 17 4 12" />
        </svg>;
  const promptIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style={{
    flexShrink: 0,
    opacity: 0.4
  }}>
            <title>Prompt</title>
            <path d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2zM6 7h12v2H6zm8 4H6v2h8z" />
        </svg>;
  return <div className={`prompt prompt-${variant}`} style={{
    marginTop: '12px',
    marginBottom: '12px'
  }}>
            {promptIcon}
            <span className="prompt-text">{text}</span>
            <button className="prompt-copy" onClick={handleCopy} title="Copy to clipboard" type="button">
                {copied ? checkIcon : clipboardIcon}
            </button>
        </div>;
};

The GitLab integration connects your GitLab projects to Modem. It captures merge request, issue, and comment activity from the projects you choose, and it gives the Modem Agent the ability to search, create, update, and comment on merge requests and issues directly from chat.

<Warning>
  GitLab is currently in **beta** and enabled per organization. If you don't see it under **Settings** → **Integrations**, email
  [support@modem.dev](mailto:support@modem.dev) to request access.
</Warning>

<Info>
  Modem does not read your source code. It syncs metadata only: merge request and issue titles, descriptions, comments, labels, and state.
  No file contents, no diffs, no repository browsing. Works with both GitLab.com and self-managed GitLab.
</Info>

## Prerequisites

* Admin access in the Modem organization where you want to connect GitLab
* A GitLab account with at least **Maintainer** access on the projects you want to monitor (required to install project webhooks)
* The GitLab beta enabled for your organization

## Setup

<Steps>
  <Step title="Start the connection">
    Go to **Settings** → **Integrations** → **GitLab** in your Modem dashboard and click **Connect GitLab**.
  </Step>

  <Step title="Authorize Modem">
    You'll be redirected to GitLab to authorize Modem. Review the requested access (`api` and `read_user`) and approve. Modem connects
    as the GitLab account you authorize with.
  </Step>

  <Step title="Enable projects">
    Back in Modem, you'll see the projects your account can access. Toggle on the ones you want Modem to monitor. See [Enabling
    Projects](#enabling-projects) below for what happens when you do.
  </Step>
</Steps>

## Enabling Projects

GitLab ingestion is **opt-in per project**. Nothing is captured until you enable a project from the project list in **Settings** → **Integrations** → **GitLab**.

Enabling a project **installs a webhook** on that project for merge request, issue, and comment events, so new activity flows into Modem in real time.

Toggle a project off at any time to remove its webhook and stop ingestion. You can filter the project list by visibility (public, internal, private) to find what you're looking for.

<Tip>
  Start with the projects where users file issues or where shipping activity matters most, then expand. Each project is an explicit
  choice, so there's no risk of pulling in repositories you didn't intend to.
</Tip>

## What Gets Captured

For each enabled project, Modem captures:

### Merge requests

Merge request titles, descriptions, source and target branches, author, labels, and state. Modem tracks the full lifecycle: opened, updated, merged, and closed-without-merge.

### Issues

Issue titles, descriptions, author, labels, and state (open or closed), captured as they're created and updated.

### Comments

Comments (GitLab calls them **notes**) on both merge requests and issues, with their author and body.

<Note>
  Modem skips GitLab **system notes** — the automated entries GitLab adds for things like label changes, assignments, and milestone
  updates. Only real human comments are captured.
</Note>

## What the Agent Can Do

With GitLab connected, you can ask the Modem Agent to work with your merge requests and issues. Read operations run on demand; write operations require your approval before they execute.

* **Search and list** merge requests and issues across your enabled projects
* **Read full details** of a merge request or issue, including its recent comments
* **Update issues**: title, description, labels, open/close (requires approval)
* **Comment** on a merge request or issue (requires approval)
* **Create issues** from feedback conversations (requires approval)

The agent works through GitLab's GraphQL API, so it isn't limited to the operations above — if GitLab's API can express it, you can ask for it.

<Info>
  Write actions (creating issues, updating issues, adding comments) always ask for your approval before they run. Read actions like search
  and lookups run without a prompt.
</Info>

### Example Prompts

These work from the dashboard, Slack DMs, or by mentioning `@modem` in a channel.

Simple:

<Prompt text="What merge requests merged in the api project this week?" />

<Prompt text="Show me issue #42 in web/storefront and summarize the discussion" />

<Prompt text="Create a GitLab issue for the login timeout complaints in the backend project" />

Advanced:

<Prompt text="Find the open issues in our GitLab projects with the most related user complaints and rank them by feedback volume" />

<Prompt text="Summarize all Slack and Discord feedback about search performance and add it as a comment on the relevant GitLab issue" />

<Tip>
  With the [Slack integration](/docs/integrations/slack) installed, you can do all of this directly from Slack by messaging the Modem bot, no
  need to leave your conversation.
</Tip>

## Automations

GitLab merge request events can trigger [automations](/docs/features/automations) in Modem. After GitLab is connected, you can create event automations for:

| Trigger               | Fires when                                     |
| --------------------- | ---------------------------------------------- |
| **GitLab MR Created** | A new merge request is synced                  |
| **GitLab MR Merged**  | A merge request is merged                      |
| **GitLab MR Closed**  | A merge request is closed without being merged |

These are useful for posting shipping updates to Slack, summarizing merged work, or connecting merged changes back to the feedback that prompted them.

## Self-Managed GitLab

The integration works with self-managed GitLab instances as well as GitLab.com. The connection records your instance URL and routes all API calls and webhooks accordingly. Reach out to [support@modem.dev](mailto:support@modem.dev) if you're connecting a self-managed instance so we can confirm your OAuth application is configured correctly.

## Troubleshooting

<AccordionGroup>
  <Accordion title="A project isn't appearing in the list">
    The project list reflects what your connected GitLab account can access at **Maintainer** level or above. If a project is missing,
    verify your access in GitLab, then reload the GitLab settings page in Modem.
  </Accordion>

  <Accordion title="Merge requests, issues, or comments aren't showing up">
    Work through these in order:

    * Confirm the project is toggled **on** in **Settings** → **Integrations** → **GitLab**
    * Allow a few minutes for webhook delivery and processing
    * In GitLab, check the project's **Settings → Webhooks** and look at the recent delivery log for the Modem hook
    * Note that GitLab system notes (automated label/assignment entries) are intentionally skipped
  </Accordion>

  <Accordion title="Connection shows an error">
    Open **Settings** → **Integrations** → **GitLab** to see the error detail. If the access has expired or permissions changed,
    reconnect from the same page. If the error persists, contact [support@modem.dev](mailto:support@modem.dev).
  </Accordion>

  <Accordion title="The agent can't find or act on a merge request or issue">
    Work through these in order:

    * Verify GitLab is connected and the relevant project is enabled
    * Be specific with the project path and the merge request or issue number
    * Remember that creating issues, updating issues, and adding comments require approval, so check for a pending approval prompt
  </Accordion>
</AccordionGroup>

## Disconnecting

To disconnect GitLab:

1. Go to **Settings** → **Integrations** → **GitLab**
2. Click **Disconnect**

This removes the webhooks from your enabled projects, so new activity is no longer synced and the agent can no longer act on GitLab. Historical data remains in Modem after disconnecting.

## Related

<CardGroup cols={2}>
  <Card title="GitHub" icon="https://mintcdn.com/modem-844d7a4a/Wr2r4IRr97lNQiQb/icons/github.svg?fit=max&auto=format&n=Wr2r4IRr97lNQiQb&q=85&s=1241c26b449c582e802cf990e2f41703" href="/docs/integrations/github" width="24" height="24" data-path="icons/github.svg">
    Sync issues and pull requests from your GitHub repositories.
  </Card>

  <Card title="Integrations Overview" icon="https://mintcdn.com/modem-844d7a4a/Wr2r4IRr97lNQiQb/icons/link.svg?fit=max&auto=format&n=Wr2r4IRr97lNQiQb&q=85&s=e774d33588635d44c6c935b78ed55f13" href="/docs/integrations/overview" width="24" height="24" data-path="icons/link.svg">
    Compare GitLab with other data sources and agent tools.
  </Card>
</CardGroup>
