Repo Sources endpoints

Pull migration scripts from Git providers and cloud storage. Paths are relative to the address of your Simcha DB Studio server.

Through the MCP server these endpoints are the Repo Sources tool group, off until an admin turns it on.

While this group is on, the MCP server also offers the lookups its tools need: environments_list (List environments, from Environments and Groupings).

MethodPathWhat it does
GET/api/db-devops/repo-connectionsList repo sources
GET/api/db-devops/repo-connections/:idGet a repo source
POST/api/db-devops/repo-connectionsAdd a repo source
PUT/api/db-devops/repo-connections/:idChange a repo source
DELETE/api/db-devops/repo-connections/:idDelete a repo source
POST/api/db-devops/repo-connections/test-configTest repo source settings
POST/api/db-devops/repo-connections/:id/testTest a repo source
POST/api/db-devops/repo-connections/:id/pullPull scripts from a repo source
POST/api/db-devops/repo-connections/:id/browseBrowse the files in a repo source

GET /api/db-devops/repo-connections

Lists every repo source sorted by name, with its provider, paths, file pattern and the result of its last pull. Secrets in the settings come back as ********.

Reads only · Role: Any signed-in user · MCP tool: repo_sources_list

No inputs.

GET /api/db-devops/repo-connections/:id

Returns one repo source with its settings and the result of its last pull. Secrets come back as ********.

Reads only · Role: Any signed-in user · MCP tool: repo_sources_get

InputTypeDescription
id (path)string (uuid), requiredThe repo source ID

POST /api/db-devops/repo-connections

Adds a repo source with its secrets stored encrypted, without testing it. A name already used is refused with 409.

Changes data · Role: Admin · MCP tool: repo_sources_create

InputTypeDescription
name (body)string, requiredThe source name, up to 255 characters and unique (case does not matter)
provider (body)one of github, gitlab, bitbucket, azure_devops, s3, azure_blob, gcs, dropbox, requiredWhere the scripts are kept
config (body)object, optionalThe provider settings and credentials. Other keys are kept as given
config.token (body)string, optionalGitHub, GitLab, Azure DevOps: the access token. Stored encrypted; reads show ********
config.base_url (body)string, optionalGitHub or GitLab: the API address of a self-hosted server. Left out, github.com or gitlab.com
config.owner (body)string, optionalGitHub: the repository owner
config.repo (body)string, optionalGitHub: the repository name
config.project_id (body)string, optionalGitLab: the numeric project ID or the group/project path
config.workspace (body)string, optionalBitbucket: the workspace
config.repo_slug (body)string, optionalBitbucket: the repository slug
config.username (body)string, optionalBitbucket: the user name or account email
config.app_password (body)string, optionalBitbucket: the app password or API token. Stored encrypted; reads show ********
config.organization (body)string, optionalAzure DevOps: the organization
config.project (body)string, optionalAzure DevOps: the project
config.repository (body)string, optionalAzure DevOps: the repository
config.bucket (body)string, optionalS3 or Google Cloud Storage: the bucket name
config.region (body)string, optionalS3: the bucket region, such as us-east-1
config.access_key_id (body)string, optionalS3: the access key ID. Left out, the server's own AWS identity is used
config.secret_access_key (body)string, optionalS3: the secret access key. Stored encrypted; reads show ********
config.session_token (body)string, optionalS3: a session token for temporary keys. Stored encrypted; reads show ********
config.role_arn (body)string, optionalS3: an IAM role to assume for reading the bucket
config.external_id (body)string, optionalS3: the external ID the role requires. Stored encrypted; reads show ********
config.role_session_name (body)string, optionalS3: the session name used when assuming the role, up to 64 characters
config.role_duration_seconds (body)integer, 1 or more, optionalS3: how long the assumed role lasts, in seconds. Left out, 3600
config.connection_string (body)string, optionalAzure Blob Storage: the storage account connection string. Stored encrypted; reads show ********
config.container (body)string, optionalAzure Blob Storage: the container name
config.credentials_json (body)string, optionalGoogle Cloud Storage: the service account key JSON. Stored encrypted; reads show ********
config.access_token (body)string, optionalDropbox: an access token, used when no refresh token is given. Stored encrypted; reads show ********
config.refresh_token (body)string, optionalDropbox: the refresh token, sent with app_key and app_secret. Stored encrypted; reads show ********
config.app_key (body)string, optionalDropbox: the app key
config.app_secret (body)string, optionalDropbox: the app secret. Stored encrypted; reads show ********
config.root_folder (body)string, optionalDropbox: the folder every path is under
default_branch (body)string, optionalThe branch to read for Git providers, up to 255 characters. Left out, main
release_path (body)string, optionalThe folder release scripts are pulled from, up to 500 characters
adhoc_path (body)string, optionalThe folder ad-hoc scripts are pulled from, up to 500 characters
file_pattern (body)string, optionalThe file names to pull, up to 255 characters: glob patterns separated by commas, semicolons or spaces, such as *.sql or migrations/**/*.sql. Left out, *.sql
is_active (body)boolean, optionalWhether scripts can be pulled from it. Left out, true

PUT /api/db-devops/repo-connections/:id

Changes the fields sent. Secrets left out, empty or sent as ******** keep their stored values, and a name already used is refused with 409.

Changes data · Role: Admin · MCP tool: repo_sources_update

InputTypeDescription
id (path)string (uuid), requiredThe repo source ID
name (body)string, optionalThe source name, up to 255 characters and unique (case does not matter)
provider (body)one of github, gitlab, bitbucket, azure_devops, s3, azure_blob, gcs, dropbox, optionalWhere the scripts are kept
config (body)object, optionalThe provider settings and credentials. A secret left out, empty or sent as ******** keeps the stored one
config.token (body)string, optionalGitHub, GitLab, Azure DevOps: the access token. Stored encrypted; reads show ********
config.base_url (body)string, optionalGitHub or GitLab: the API address of a self-hosted server. Left out, github.com or gitlab.com
config.owner (body)string, optionalGitHub: the repository owner
config.repo (body)string, optionalGitHub: the repository name
config.project_id (body)string, optionalGitLab: the numeric project ID or the group/project path
config.workspace (body)string, optionalBitbucket: the workspace
config.repo_slug (body)string, optionalBitbucket: the repository slug
config.username (body)string, optionalBitbucket: the user name or account email
config.app_password (body)string, optionalBitbucket: the app password or API token. Stored encrypted; reads show ********
config.organization (body)string, optionalAzure DevOps: the organization
config.project (body)string, optionalAzure DevOps: the project
config.repository (body)string, optionalAzure DevOps: the repository
config.bucket (body)string, optionalS3 or Google Cloud Storage: the bucket name
config.region (body)string, optionalS3: the bucket region, such as us-east-1
config.access_key_id (body)string, optionalS3: the access key ID. Left out, the server's own AWS identity is used
config.secret_access_key (body)string, optionalS3: the secret access key. Stored encrypted; reads show ********
config.session_token (body)string, optionalS3: a session token for temporary keys. Stored encrypted; reads show ********
config.role_arn (body)string, optionalS3: an IAM role to assume for reading the bucket
config.external_id (body)string, optionalS3: the external ID the role requires. Stored encrypted; reads show ********
config.role_session_name (body)string, optionalS3: the session name used when assuming the role, up to 64 characters
config.role_duration_seconds (body)integer, 1 or more, optionalS3: how long the assumed role lasts, in seconds. Left out, 3600
config.connection_string (body)string, optionalAzure Blob Storage: the storage account connection string. Stored encrypted; reads show ********
config.container (body)string, optionalAzure Blob Storage: the container name
config.credentials_json (body)string, optionalGoogle Cloud Storage: the service account key JSON. Stored encrypted; reads show ********
config.access_token (body)string, optionalDropbox: an access token, used when no refresh token is given. Stored encrypted; reads show ********
config.refresh_token (body)string, optionalDropbox: the refresh token, sent with app_key and app_secret. Stored encrypted; reads show ********
config.app_key (body)string, optionalDropbox: the app key
config.app_secret (body)string, optionalDropbox: the app secret. Stored encrypted; reads show ********
config.root_folder (body)string, optionalDropbox: the folder every path is under
default_branch (body)string, optionalThe branch to read for Git providers, up to 255 characters
release_path (body)string, optionalThe folder release scripts are pulled from, up to 500 characters
adhoc_path (body)string, optionalThe folder ad-hoc scripts are pulled from, up to 500 characters
file_pattern (body)string, optionalThe file names to pull, up to 255 characters: glob patterns separated by commas, semicolons or spaces, such as *.sql or migrations/**/*.sql
is_active (body)boolean, optionalWhether scripts can be pulled from it

DELETE /api/db-devops/repo-connections/:id

Deletes a repo source. Scripts already pulled from it are kept.

Changes data and can remove or overwrite it · Role: Admin · MCP tool: repo_sources_delete

InputTypeDescription
id (path)string (uuid), requiredThe repo source ID

POST /api/db-devops/repo-connections/test-config

Tries the provider with the settings given, without saving anything, and returns success and a message. With the ID of a saved source, its stored secrets fill in any secret left out, empty or sent as ********. A caller who is not an admin needs the Configuration section in one of their roles.

Reads only · Role: Any signed-in user · MCP tool: repo_sources_test_settings

InputTypeDescription
id (body)string (uuid), optionalA saved repo source whose stored secrets fill in missing ones
provider (body)one of github, gitlab, bitbucket, azure_devops, s3, azure_blob, gcs, dropbox, requiredWhere the scripts are kept
config (body)object, optionalThe provider settings and credentials to test
config.token (body)string, optionalGitHub, GitLab, Azure DevOps: the access token. Stored encrypted; reads show ********
config.base_url (body)string, optionalGitHub or GitLab: the API address of a self-hosted server. Left out, github.com or gitlab.com
config.owner (body)string, optionalGitHub: the repository owner
config.repo (body)string, optionalGitHub: the repository name
config.project_id (body)string, optionalGitLab: the numeric project ID or the group/project path
config.workspace (body)string, optionalBitbucket: the workspace
config.repo_slug (body)string, optionalBitbucket: the repository slug
config.username (body)string, optionalBitbucket: the user name or account email
config.app_password (body)string, optionalBitbucket: the app password or API token. Stored encrypted; reads show ********
config.organization (body)string, optionalAzure DevOps: the organization
config.project (body)string, optionalAzure DevOps: the project
config.repository (body)string, optionalAzure DevOps: the repository
config.bucket (body)string, optionalS3 or Google Cloud Storage: the bucket name
config.region (body)string, optionalS3: the bucket region, such as us-east-1
config.access_key_id (body)string, optionalS3: the access key ID. Left out, the server's own AWS identity is used
config.secret_access_key (body)string, optionalS3: the secret access key. Stored encrypted; reads show ********
config.session_token (body)string, optionalS3: a session token for temporary keys. Stored encrypted; reads show ********
config.role_arn (body)string, optionalS3: an IAM role to assume for reading the bucket
config.external_id (body)string, optionalS3: the external ID the role requires. Stored encrypted; reads show ********
config.role_session_name (body)string, optionalS3: the session name used when assuming the role, up to 64 characters
config.role_duration_seconds (body)integer, 1 or more, optionalS3: how long the assumed role lasts, in seconds. Left out, 3600
config.connection_string (body)string, optionalAzure Blob Storage: the storage account connection string. Stored encrypted; reads show ********
config.container (body)string, optionalAzure Blob Storage: the container name
config.credentials_json (body)string, optionalGoogle Cloud Storage: the service account key JSON. Stored encrypted; reads show ********
config.access_token (body)string, optionalDropbox: an access token, used when no refresh token is given. Stored encrypted; reads show ********
config.refresh_token (body)string, optionalDropbox: the refresh token, sent with app_key and app_secret. Stored encrypted; reads show ********
config.app_key (body)string, optionalDropbox: the app key
config.app_secret (body)string, optionalDropbox: the app secret. Stored encrypted; reads show ********
config.root_folder (body)string, optionalDropbox: the folder every path is under

POST /api/db-devops/repo-connections/:id/test

Tries the provider with the source's stored settings and returns success and a message. Nothing is saved. A caller who is not an admin needs the Configuration section in one of their roles.

Reads only · Role: Any signed-in user · MCP tool: repo_sources_test

InputTypeDescription
id (path)string (uuid), requiredThe repo source ID

POST /api/db-devops/repo-connections/:id/pull

Reads the files matching the source's file pattern under its release or ad-hoc path, or the path given, and saves each new file as a migration script pending approval. A file pulled before is updated only when its content changed, which sets the script back to pending approval and any signed-off release containing it back to pending sign-off. Returns imported, updated, unchanged and failed counts; an inactive source is refused with 409, a provider error with 502, and a caller who is not an admin needs the Configuration section.

Changes data · Role: Any signed-in user · MCP tool: repo_sources_pull

InputTypeDescription
id (path)string (uuid), requiredThe repo source ID
mode (body)one of release, adhoc, optionalrelease (the default) reads the release path and saves release scripts; adhoc reads the ad-hoc path and saves ad-hoc scripts
environment (body)string, requiredThe environment new scripts are for. It must be an existing environment
targetConnectionId (body)string (uuid), optionalThe connection new scripts target. It must be in the environment
targetDatabase (body)string, optionalThe database on that connection new scripts target. Used only with targetConnectionId
branch (body)string, optionalThe branch to read, for Git providers. Left out, the source's default branch
path (body)string, optionalThe folder to read instead of the source's release or ad-hoc path

POST /api/db-devops/repo-connections/:id/browse

Lists the files and folders directly under a path, each with its name, full path, type and size where known. A provider error is refused with 502, and a caller who is not an admin needs the Configuration section in one of their roles.

Reads only · Role: Any signed-in user · MCP tool: repo_sources_browse

InputTypeDescription
id (path)string (uuid), requiredThe repo source ID
branch (body)string, optionalThe branch to read, for Git providers. Left out, the source's default branch
path (body)string, optionalThe folder to list. Left out, the top level