Git Connections
Git Connections lets you link your HasMCP organization to a GitHub or GitLab account, so that any configuration change to an MCP server is automatically committed and pushed to a repository of your choice. This gives you a full infrastructure-as-code workflow for your AI tooling — every change is versioned, auditable, and shareable.How It Works
When a Git Connection is configured for a server, saving any change to that server’s configuration triggers a background push to the assigned repository. HasMCP generates a structured directory layout representing the full server configuration and commits it in one operation. The generated layout looks like this:Setting Up a Git Connection
Step 1: Connect Your Account
- Navigate to Git Connections in your organization settings.
- Click Add Connection and select either GitHub or GitLab.
- You will be redirected to the provider to authorize HasMCP. After authorization, you are returned to HasMCP and your account appears in the connections list with a Connected status.
Step 2: Assign a Repository to a Server
- Open the server you want to sync.
- Go to the General settings tab.
- Under Git Push Sync, choose a repository from the Assigned Repository dropdown. The dropdown lists all repositories accessible through your connected accounts.
- Save the server. From this point on, every configuration save will trigger an automatic push.
Managing Connections
From the Git Connections page you can:- View all connected accounts, their provider, avatar, and current status.
- Reconnect an account (re-runs the OAuth flow) if the status shows Disconnected or Error.
- Delete a connection to revoke HasMCP’s access. Any servers that reference the deleted connection will stop syncing.
Connection Statuses
| Status | Meaning |
|---|---|
| Connected | Token is valid and pushes will succeed. |
| Disconnected | The connection was manually disconnected or the token expired. |
| Error | An error occurred during authorization. Reconnect to resolve. |
Security
- Access tokens are encrypted using AES encryption before storage. The encryption nonce is stored separately.
- For GitHub App connections, a short-lived installation token (1-hour expiry) is generated on each push — the long-term credential stored is only the installation ID, not an OAuth token.
- OAuth2 client secrets are never persisted; they are only used transiently during the callback flow.
- Each Git Connection is scoped to a specific user and organization. A server can only be assigned to a repository that belongs to a connection within the same organization.