Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to GitLab

Scalekit connector
Open markdown

The GitLab connector lets your AI agent act in each user's GitLab account. Each user signs in to GitLab once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 189 tools.

Tools
189
What they doRead · write · destructive
87 · 76 · 2687 read76 write26 destructive
Users sign in with
OAuth app
Your own GitLab app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the GitLab connection

    In AgentKit > Connections, create a GitLab connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    GitLab connections use your own OAuth app. Register one with GitLab and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the GitLab connection.

    Console steps with screenshots

    Register your Scalekit environment with the GitLab connector so Scalekit handles the OAuth 2.0 flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. Then complete the configuration in your application as follows:

    1. Set up auth redirects

      • In Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find GitLab and click Create.

      • Copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

        Copy redirect URI from Scalekit dashboard

      • Go to GitLab Applications settings (User Settings → Applications) and open or create your OAuth application.

      • Paste the copied URI into the Redirect URI field and click Save application.

        Add redirect URI and scopes in GitLab OAuth app

      • Under Scopes, select the permissions your agent needs:

        ScopeAccess grantedUse when
        apiFull read/write access to all API endpointsMost tools — recommended for full access
        read_userCurrent user’s profilegitlab_current_user_get only
        read_apiRead-only access to all API endpointsRead-only agents
        read_repositoryRead access to repositoriesFile and commit reads only
        write_repositoryPush access to repositoriesgitlab_file_create, gitlab_file_update, gitlab_branch_create
    2. Get client credentials

      After saving the application, GitLab shows the Application ID and Secret on the application detail page:

      GitLab application detail page with Application ID and Secret

      • Application ID — listed on the app’s main settings page
      • Secret — shown only once after creation; if you lose it, regenerate it from the same page
    3. Add credentials in Scalekit

      • In Scalekit dashboard, go to AgentKit > Connections and open the connection you created.

      • Enter your credentials:

        • Client ID — paste your GitLab Application ID
        • Client Secret — paste your GitLab Secret

        Add GitLab credentials in Scalekit dashboard

      • Click Save.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'gitlab'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize GitLab:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'gitlab_current_user_get',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • gitlab_branch_getGet details of a specific branch in a GitLab repository.Read-only

    Get Branch

    Get details of a specific branch in a GitLab repository.

    Inputs

    branchstringrequired
    The name of the branch.
    idstringrequired
    The project ID (numeric) or URL-encoded path.
  • gitlab_branches_listList repository branches for a GitLab project.Read-only

    List Branches

    List repository branches for a GitLab project.

    Inputs

    idstringrequired
    The project ID (numeric) or URL-encoded path.
    pageinteger
    Page number for pagination.
    per_pageinteger
    Number of results per page (max 100).
    searchstring
    Filter branches by name.
  • gitlab_commit_comments_listList comments on a specific commit.Read-only

    List Commit Comments

    List comments on a specific commit.

    Inputs

    idstringrequired
    The project ID (numeric) or URL-encoded path.
    shastringrequired
    The commit SHA.
  • gitlab_commit_diff_getGet the diff of a specific commit.Read-only

    Get Commit Diff

    Get the diff of a specific commit.

    Inputs

    idstringrequired
    The project ID (numeric) or URL-encoded path.
    shastringrequired
    The commit SHA.
  • gitlab_commit_getGet details of a specific commit by its SHA.Read-only

    Get Commit

    Get details of a specific commit by its SHA.

    Inputs

    idstringrequired
    The project ID (numeric) or URL-encoded path.
    shastringrequired
    The commit SHA.
  • gitlab_commit_merge_requests_listLists all merge requests associated with a specific commit SHA.Read-only

    List Merge Requests For Commit

    Lists all merge requests associated with a specific commit SHA.

    Inputs

    idstringrequired
    The project ID (numeric) or URL-encoded path.
    shastringrequired
    The commit SHA, or a branch/tag name, to find merge requests for.
    pageinteger
    Page number for pagination.
    per_pageinteger
    Number of results per page (max 100).
  • gitlab_commits_listList repository commits for a GitLab project.Read-only

    List Commits

    List repository commits for a GitLab project.

    Inputs

    idstringrequired
    The project ID (numeric) or URL-encoded path.
    authorstring
    Filter commits by author name or email.
    pageinteger
    Page number for pagination.
    pathstring
    Filter commits by file path.
    per_pageinteger
    Number of results per page (max 100).
    ref_namestring
    The branch or tag name to list commits from.
    sincestring
    Only commits after this date are returned (ISO 8601 format).
    untilstring
    Only commits before this date are returned (ISO 8601 format).
  • gitlab_compare_refsCompare two refs (branches, tags, or commits) in a GitLab repository.Read-only

    Compare Refs

    Compare two refs (branches, tags, or commits) in a GitLab repository.

    Inputs

    fromstringrequired
    The source branch, tag, or commit SHA to compare from.
    idstringrequired
    The project ID (numeric) or URL-encoded path.
    tostringrequired
    The target branch, tag, or commit SHA to compare to.
    straightstring
    Comparison method: 'true' for straight diff, 'false' for merge base.