Check if the repository is private and requires authentication
"Invalid URL"
Use HTTPS URLs only (not SSH)
Ensure the URL format is correct
Claude Code headless calls failing completely
This can occur when GitLab API keys for the Claude Code MCP server are incorrect or expired
Symptoms: Claude CLI commands hang, timeout, or fail with cryptic errors
Solution: Verify your GitLab API key configuration in the Claude Code MCP server settings
The Claude Code MCP server requires a valid GitLab API key even for basic operations
Claude Code MCP Server Issues
If you're experiencing issues with Claude CLI headless execution (commands hanging, timeouts, or failing to respond), the problem may be related to Claude Code MCP server configuration:
Symptoms:
claude --version works fine
claude -p "question" hangs indefinitely or fails
Headless Claude calls timeout without clear error messages
Claude CLI appears to connect but never returns responses
Root Cause:
The Claude Code MCP server may be configured with an invalid or expired GitLab API key, causing all headless operations to fail silently.
Recommended Solution (Current Project State):🚨 IMPORTANT: For this project, it is recommended to NOT use the GitLab MCP server at all.
The current implementation handles all git operations manually:
Before Claude Code: Application prepares git workspace, branches, and context
After Claude Code (edit requests with createMR: true): Application handles change detection, commit, push, and optional merge request creation as part of the same queue job.
Why avoid GitLab MCP server:
Prevents API key configuration issues entirely
Eliminates silent failures in headless operations
Application's manual git handling provides better control and error handling
Reduces complexity and potential points of failure
Alternative Solutions (if MCP server is needed):
Check your Claude Code MCP server configuration
Verify the GitLab API key is valid and has proper permissions
Update the API key if it has been rotated or expired
Restart the Claude Code MCP server after updating credentials
Prevention:
Recommended: Configure Claude Code without GitLab MCP server integration
If using MCP server: Monitor GitLab API key expiration dates
Use tokens with appropriate long-term validity
Set up monitoring/alerts for API key expiration
Test Claude CLI functionality after any credential changes
Best Practices
Test with a simple public repository first
Use tokens with minimal required permissions
Keep tokens secure and rotate them regularly
Use repository-specific deploy keys when possible for production environments
Test Claude CLI functionality after any API key changes