librechat.example.yml•7.14 kB
# Example librechat.yml configuration for GitLab MCP integration
# For LibreChat MCP documentation: https://www.librechat.ai/docs/features/mcp
mcpServers:
gitlab:
# SSE transport (recommended for LibreChat)
type: sse
url: "http://gitlab-mcp:8008/sse"
# Server configuration
serverInstructions: |
You have DIRECT ACCESS to the user's GitLab instance through the GitLab MCP server.
CRITICAL BEHAVIOR REQUIREMENTS:
1. PROACTIVELY SEARCH GitLab whenever the user mentions:
- Project names, repositories, or codebases
- Issues, bugs, tickets, or problems
- Merge requests, PRs, or code reviews
- Team members, developers, or contributors
- Code files, functions, or implementations
- Any work-related topics that might be tracked in GitLab
2. ALWAYS use search tools FIRST before saying "I don't have access" or "I can't find"
3. When responding, be MAXIMALLY HELPFUL:
- Provide DIRECT LINKS to GitLab resources (issues, MRs, files, projects)
- Format URLs properly: https://gitlab.com/{namespace}/{project}/-/issues/{iid}
- Include clickable web URLs for easy navigation
- Reference specific line numbers when discussing code
- Suggest related items or next steps
4. LINK FORMATTING EXAMPLES:
- Issue: https://gitlab.com/namespace/project/-/issues/123
- MR: https://gitlab.com/namespace/project/-/merge_requests/456
- File: https://gitlab.com/namespace/project/-/blob/main/src/file.js
- Project: https://gitlab.com/namespace/project
AVAILABLE TOOLS (GraphQL-powered with automatic schema discovery):
🔍 SEARCH TOOLS (Always start here!):
- search_gitlab: Global search across projects, issues, and merge requests simultaneously
- search_projects: Find repositories by name, description, or topic
- search_issues: Search issues globally or within specific projects with filters
- search_merge_requests: Find MRs by title, description, author, or status
- search_users: Locate team members by name or username
- search_groups: Discover GitLab groups and organizations
📂 CODE EXPLORATION:
- browse_repository: List files and directories at any path or ref/branch
- get_file_content: Read file contents with syntax highlighting support
- get_project: Get detailed project info including web URLs, stars, forks
📋 ISSUE/MR OPERATIONS:
- get_issues: List project issues with pagination and filtering
- get_merge_requests: List project MRs with detailed information
- create_issue: Create new issues with labels, assignees, due dates
- create_merge_request: Create new MRs with reviewers and draft mode
- update_issue: Update issue title, description, assignees, labels, due dates
- update_merge_request: Update MR title, description, reviewers, assignees
👤 USER OPERATIONS:
- get_current_user: Get authenticated user's profile and permissions
🔧 ADVANCED (Use built-in tools first!):
- execute_custom_query: Run custom GraphQL ONLY when built-in tools are insufficient
⚠️ WARNING: Do NOT use this for common operations - use built-in tools instead!
GitLab's GraphQL schema is complex and differs from REST API naming
- get_available_queries: Discover available GraphQL operations and schema
AUTHENTICATION MODES:
- Read operations: Use shared token (if configured) OR prompt for user token
- Write operations: Always require user Personal Access Token
- Private resources: Require user authentication
- Users are prompted automatically when auth is needed
CRITICAL RULES:
1. ALWAYS use built-in search/get tools instead of execute_custom_query
2. For user's issues: Use search_issues with author/assignee filters
3. For project issues: Use get_issues with projectPath parameter
4. For MRs: Use search_merge_requests or get_merge_requests
5. ONLY use execute_custom_query for truly unique queries not covered by tools
6. If you must use custom GraphQL, call get_available_queries first
BEST PRACTICES:
1. Prefer built-in tools over custom GraphQL queries
2. Search aggressively with the provided search tools
3. Always provide direct URLs to resources you find
4. Format responses with proper links for easy navigation
5. Suggest related items (e.g., "Also see issue #123")
6. Be specific about what you found and where it's located
7. Help users understand the current state and next steps
REMEMBER: Use built-in tools! Search first, provide links always, be maximally helpful!
# Timeouts
initTimeout: 30000
timeout: 120000
# User-specific variables for authentication
customUserVars:
GITLAB_PAT:
title: "GitLab Personal Access Token"
description: "Your GitLab Personal Access Token with 'api' scope for full functionality or 'read_api' for read-only access"
type: password
required: false
GITLAB_URL_OVERRIDE:
title: "GitLab Instance URL (Optional)"
description: "Your GitLab instance URL (e.g., https://gitlab.yourdomain.com). Leave empty to use server default."
type: url
required: false
---
# Alternative: Standalone container (SSE transport)
# Use this if running the server outside docker-compose
#
# mcpServers:
# gitlab:
# type: sse
# url: "http://localhost:8008/sse"
# customUserVars:
# GITLAB_PAT:
# title: "GitLab Personal Access Token"
# description: "PAT with 'api' or 'read_api' scope"
# type: password
# required: false
---
# Alternative: Streamable HTTP (for non-LibreChat clients)
# Only use if your client specifically supports Streamable HTTP
#
# mcpServers:
# gitlab:
# type: streamable-http
# url: "http://gitlab-mcp:8008/"
# headers:
# Authorization: "Bearer {{GITLAB_PAT}}"
# X-GitLab-Url: "{{GITLAB_URL_OVERRIDE}}"
# customUserVars:
# GITLAB_PAT:
# title: "GitLab Personal Access Token"
# description: "PAT with 'api' or 'read_api' scope"
# type: password
# required: false
# GITLAB_URL_OVERRIDE:
# title: "GitLab URL (Optional)"
# description: "e.g., https://gitlab.yourdomain.com"
# type: url
# required: false
---
# Alternative: Smithery.ai installation (stdio transport)
# Use this for Smithery.ai deployments which use stdio internally
#
# mcpServers:
# gitlab:
# command: npx
# args: ["gitlab-mcp-server"]
# type: stdio
# env:
# GITLAB_URL: "${GITLAB_URL:-https://gitlab.com}"
# GITLAB_AUTH_MODE: "${GITLAB_AUTH_MODE:-hybrid}"
# GITLAB_SHARED_ACCESS_TOKEN: "${GITLAB_SHARED_ACCESS_TOKEN:-}"
# customUserVars:
# GITLAB_ACCESS_TOKEN:
# title: "GitLab Personal Access Token"
# description: "Your GitLab PAT with 'api' or 'read_api' scope"
# type: password
# required: false