MCP Tools Reference: developerconnect.googleapis.com

工具:list-connections

列出指定專案和位置中的連線。

下列程式碼範例說明如何使用 curl 呼叫 list-connections MCP 工具。

Curl 要求
curl --location 'https://developerconnect.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "list-connections",
    "arguments": {
      // Provide these details according to the MCP tool specification.
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

輸入內容的結構定義

要求連線清單的訊息

ListConnectionsRequest

JSON 表示法
{
  "parent": string,
  "pageSize": integer,
  "pageToken": string,
  "filter": string,
  "orderBy": string
}
欄位
parent

string

這是必要旗標,ListConnectionsRequest 的父項值

pageSize

integer

選用。要求的頁面大小。伺服器傳回的項目數量可能少於要求數量。如未指定,伺服器會選擇適當的預設值。

pageToken

string

選用。用來識別伺服器應傳回哪一頁結果的權杖。

filter

string

選用。篩選結果。

orderBy

string

選用。結果排序方式的提示。

輸出內容的結構定義

回覆列出連結訊息

ListConnectionsResponse

JSON 表示法
{
  "connections": [
    {
      object (Connection)
    }
  ],
  "nextPageToken": string,
  "unreachable": [
    string
  ]
}
欄位
connections[]

object (Connection)

連線清單。

nextPageToken

string

用來識別伺服器應傳回哪一頁結果的權杖。

unreachable[]

string

無法連線的位置。

連線

JSON 表示法
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "deleteTime": string,
  "labels": {
    string: string,
    ...
  },
  "installationState": {
    object (InstallationState)
  },
  "disabled": boolean,
  "reconciling": boolean,
  "annotations": {
    string: string,
    ...
  },
  "etag": string,
  "uid": string,
  "cryptoKeyConfig": {
    object (CryptoKeyConfig)
  },
  "gitProxyConfig": {
    object (GitProxyConfig)
  },

  // Union field connection_config can be only one of the following:
  "githubConfig": {
    object (GitHubConfig)
  },
  "githubEnterpriseConfig": {
    object (GitHubEnterpriseConfig)
  },
  "gitlabConfig": {
    object (GitLabConfig)
  },
  "gitlabEnterpriseConfig": {
    object (GitLabEnterpriseConfig)
  },
  "bitbucketDataCenterConfig": {
    object (BitbucketDataCenterConfig)
  },
  "bitbucketCloudConfig": {
    object (BitbucketCloudConfig)
  },
  "secureSourceManagerInstanceConfig": {
    object (SecureSourceManagerInstanceConfig)
  },
  "httpConfig": {
    object (GenericHTTPEndpointConfig)
  }
  // End of list of possible types for union field connection_config.
}
欄位
name

string

ID。連線的資源名稱,格式為 projects/{project}/locations/{location}/connections/{connection_id}。

createTime

string (Timestamp format)

僅供輸出。建立時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

updateTime

string (Timestamp format)

僅供輸出。更新時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

deleteTime

string (Timestamp format)

僅供輸出。刪除時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

labels

map (key: string, value: string)

選用。標籤 (鍵/值組合)

包含 "key": value 組合清單的物件,例如 { "name": "wrench", "mass": "1.3kg", "count": "3" }。

installationState

object (InstallationState)

僅供輸出。連線的安裝狀態。

disabled

boolean

選用。如果將 disabled 設為 true,系統會停用這項連線的功能。這個連線中存放區的存放區型 API 方法和 Webhook 處理作業將會停用。

reconciling

boolean

僅供輸出。在背景設定或更新連線時,請設為 true。

annotations

map (key: string, value: string)

選用。可讓用戶端儲存少量任意資料。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

etag

string

選用。這個核對和是由伺服器根據其他欄位的值計算得出,可能會在更新和刪除要求中傳送,確保用戶端在繼續操作前取得最新值。

uid

string

僅供輸出。系統指派給連線的專屬 ID。

cryptoKeyConfig

object (CryptoKeyConfig)

選用。加密編譯金鑰設定。這個欄位用於客戶自行管理的加密金鑰 (CMEK) 功能。

gitProxyConfig

object (GitProxyConfig)

選用。Git Proxy 功能的設定。啟用 Git Proxy 後,用戶端就能對連結中的存放區執行 Git 作業。瞭解詳情。

聯集欄位 connection_config。連線設定,視供應商類型而定。connection_config 只能是下列其中一個設定:
githubConfig

object (GitHubConfig)

連線至 github.com 的設定。

githubEnterpriseConfig

object (GitHubEnterpriseConfig)

GitHub Enterprise 執行個體連線設定。

gitlabConfig

object (GitLabConfig)

連至 gitlab.com 的設定。

gitlabEnterpriseConfig

object (GitLabEnterpriseConfig)

連線至 GitLab Enterprise 執行個體的設定。

bitbucketDataCenterConfig

object (BitbucketDataCenterConfig)

Bitbucket Data Center 執行個體的連線設定。

bitbucketCloudConfig

object (BitbucketCloudConfig)

Bitbucket Cloud 執行個體連線設定。

secureSourceManagerInstanceConfig

object (SecureSourceManagerInstanceConfig)

Secure Source Manager 執行個體連線設定。

httpConfig

object (GenericHTTPEndpointConfig)

選用。HTTP 服務供應商連線設定。

GitHubConfig

JSON 表示法
{
  "githubApp": enum (GitHubApp),
  "authorizerCredential": {
    object (OAuthCredential)
  },
  "appInstallationId": string,
  "installationUri": string
}
欄位
githubApp

enum (GitHubApp)

這是必要旗標,不可變動。安裝至 GitHub 使用者或組織的 GitHub 應用程式。

authorizerCredential

object (OAuthCredential)

選用。授權 GitHub 應用程式的帳戶 OAuth 憑證。建議使用機器人帳戶,而非真人使用者帳戶。OAuth 權杖必須與這項設定的 GitHub 應用程式連結。

appInstallationId

string (int64 format)

選用。GitHub 應用程式安裝 ID。

installationUri

string

僅供輸出。要前往的 URI,以便管理與這個 GitHubConfig 相關聯的安裝作業。

OAuthCredential

JSON 表示法
{
  "oauthTokenSecretVersion": string,
  "username": string
}
欄位
oauthTokenSecretVersion

string

這是必要旗標,SecretManager 資源,內含授權連線的 OAuth 權杖。格式:projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域密鑰)。

username

string

僅供輸出。與這個權杖相關聯的使用者名稱。

GitHubEnterpriseConfig

JSON 表示法
{
  "hostUri": string,
  "appId": string,
  "appSlug": string,
  "privateKeySecretVersion": string,
  "webhookSecretSecretVersion": string,
  "appInstallationId": string,
  "installationUri": string,
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "serverVersion": string,
  "sslCaCertificate": string,
  "organization": string
}
欄位
hostUri

string

這是必要旗標,這個連線的 GitHub Enterprise 主機 URI。

appId

string (int64 format)

選用。從資訊清單建立的 GitHub 應用程式 ID。

appSlug

string

僅供輸出。GitHub 應用程式的網址易記名稱。

privateKeySecretVersion

string

選用。SecretManager 資源,包含 GitHub 應用程式的私密金鑰,格式為 projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域性 Secret)。

webhookSecretSecretVersion

string

選用。SecretManager 資源,包含 GitHub 應用程式的 Webhook 密鑰,格式為 projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域密鑰)。

appInstallationId

string (int64 format)

選用。GitHub 應用程式安裝 ID。

installationUri

string

僅供輸出。前往這個 URI,即可管理與這個 GithubEnterpriseConfig 相關聯的安裝作業。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。設定使用 Service Directory 私下連線至 GitHub Enterprise 伺服器。只有在地端部署託管 GitHub Enterprise 伺服器,且無法透過公開網際網路連線時,才應設定這個項目。如果這個欄位留空,系統會透過公開網際網路呼叫 GitHub Enterprise 伺服器。

serverVersion

string

僅供輸出。安裝在 host_uri 的 GitHub Enterprise 版本。

sslCaCertificate

string

選用。用於向 GitHub Enterprise 提出要求的 SSL 憑證。

organization

string

選用。不可變動。建立 GitHub 應用程式的 GitHub Enterprise 組織。

ServiceDirectoryConfig

JSON 表示法
{
  "service": string
}
欄位
service

string

這是必要旗標,Service Directory 服務名稱。格式:projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}。

GitLabConfig

JSON 表示法
{
  "webhookSecretSecretVersion": string,
  "readAuthorizerCredential": {
    object (UserCredential)
  },
  "authorizerCredential": {
    object (UserCredential)
  }
}
欄位
webhookSecretSecretVersion

string

這是必要旗標,不可變動。SecretManager 資源,包含 GitLab 專案的 Webhook 密鑰,格式為 projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域性密鑰)。用於驗證 Webhook。

readAuthorizerCredential

object (UserCredential)

這是必要旗標,GitLab 個人存取權杖,至少具備 read_api 範圍權限和 reporter 角色。這個個人存取權杖可查看的 GitLab 專案,會控管 Developer Connect 可存取的專案。

authorizerCredential

object (UserCredential)

這是必要旗標,GitLab 個人存取權杖,至少具備 api 範圍權限和 maintainer 角色。這個個人存取權杖可查看的 GitLab 專案,會控管 Developer Connect 可存取的專案。

UserCredential

JSON 表示法
{
  "userTokenSecretVersion": string,
  "username": string
}
欄位
userTokenSecretVersion

string

這是必要旗標,SecretManager 資源,內含授權 Developer Connect 連線的使用者權杖。格式:projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域密鑰)。

username

string

僅供輸出。與這個權杖相關聯的使用者名稱。

GitLabEnterpriseConfig

JSON 表示法
{
  "hostUri": string,
  "webhookSecretSecretVersion": string,
  "readAuthorizerCredential": {
    object (UserCredential)
  },
  "authorizerCredential": {
    object (UserCredential)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "sslCaCertificate": string,
  "serverVersion": string
}
欄位
hostUri

string

這是必要旗標,這項連線的 GitLab Enterprise 主機 URI。

webhookSecretSecretVersion

string

這是必要旗標,不可變動。SecretManager 資源,包含 GitLab 專案的 Webhook 密鑰,格式為 projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域性密鑰)。用於驗證 Webhook。

readAuthorizerCredential

object (UserCredential)

這是必要旗標,GitLab 個人存取權杖,至少具備 read_api 範圍權限和 reporter 角色。這個個人存取權杖可查看的 GitLab 專案,會控管 Developer Connect 可存取的專案。

authorizerCredential

object (UserCredential)

這是必要旗標,GitLab 個人存取權杖,至少具備 api 範圍權限和 maintainer 角色。這個個人存取權杖可查看的 GitLab 專案,會控管 Developer Connect 可存取的專案。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。設定使用 Service Directory 私下連線至 GitLab Enterprise 執行個體。只有在 GitLab Enterprise 伺服器託管於地端部署環境,且無法透過公開網際網路連線時,才應設定這個選項。如果這個欄位留空,系統會透過公開網際網路呼叫 GitLab Enterprise 伺服器。

sslCaCertificate

string

選用。SSL 憑證授權單位憑證,用於向 GitLab Enterprise 執行個體發出要求。

serverVersion

string

僅供輸出。在 host_uri 執行的 GitLab Enterprise 伺服器版本。

BitbucketDataCenterConfig

JSON 表示法
{
  "hostUri": string,
  "webhookSecretSecretVersion": string,
  "readAuthorizerCredential": {
    object (UserCredential)
  },
  "authorizerCredential": {
    object (UserCredential)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "sslCaCertificate": string,
  "serverVersion": string
}
欄位
hostUri

string

這是必要旗標,這個連線所屬 Bitbucket 資料中心主機的 URI。

webhookSecretSecretVersion

string

這是必要旗標,不可變動。SecretManager 資源,包含用於驗證 Webhook 事件的 Webhook 密鑰,格式為 projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域性密鑰)。用於驗證 Webhook。

readAuthorizerCredential

object (UserCredential)

這是必要旗標,具有最低 Repository read 存取權的 HTTP 存取權杖。建議使用系統帳戶產生憑證。

authorizerCredential

object (UserCredential)

這是必要旗標,具有最低 Repository admin 範圍權限的 HTTP 存取權杖。必須具備這項權限,才能建立 Webhook。建議使用系統帳戶產生這些憑證。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。設定使用 Service Directory 私下連線至 Bitbucket 資料中心執行個體。只有在 Bitbucket 資料中心是地端部署,且無法透過公開網際網路連線時,才應設定這個值。如果這個欄位留空,系統會透過公開網際網路呼叫 Bitbucket Data Center。

sslCaCertificate

string

選用。向 Bitbucket Data Center 提出要求時,要信任的 SSL 憑證授權單位。

serverVersion

string

僅供輸出。在 host_uri 執行的 Bitbucket Data Center 伺服器版本。

BitbucketCloudConfig

JSON 表示法
{
  "workspace": string,
  "webhookSecretSecretVersion": string,
  "readAuthorizerCredential": {
    object (UserCredential)
  },
  "authorizerCredential": {
    object (UserCredential)
  }
}
欄位
workspace

string

這是必要旗標,要連結至 Google Cloud Platform 的 Bitbucket Cloud 工作區 ID。

webhookSecretSecretVersion

string

這是必要旗標,不可變動。SecretManager 資源,包含用於驗證 Webhook 事件的 Webhook 密鑰,格式為 projects/*/secrets/*/versions/* 或 projects/*/locations/*/secrets/*/versions/* (如果該位置支援區域性密鑰)。這個值會用於驗證及建立 Webhook。

readAuthorizerCredential

object (UserCredential)

這是必要旗標,具備最低 repository 存取權的存取權杖。可以是工作區、專案或存放區存取權杖。建議使用系統帳戶產生憑證。

authorizerCredential

object (UserCredential)

這是必要旗標,具有最低 repository、pullrequest 和 webhook 範圍權限的存取權杖。可以是工作區、專案或存放區存取權杖。必須具備這項權限,才能建立 Webhook。建議使用系統帳戶產生這些憑證。

SecureSourceManagerInstanceConfig

JSON 表示法
{
  "instance": string
}
欄位
instance

string

這是必要旗標,不可變動。Secure Source Manager 執行個體資源,格式為 projects/*/locations/*/instances/*

GenericHTTPEndpointConfig

JSON 表示法
{
  "hostUri": string,
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "sslCaCertificate": string,

  // Union field authentication can be only one of the following:
  "basicAuthentication": {
    object (BasicAuthentication)
  },
  "bearerTokenAuthentication": {
    object (BearerTokenAuthentication)
  }
  // End of list of possible types for union field authentication.
}
欄位
hostUri

string

這是必要旗標,不可變動。服務供應商的 HTTPS 端點。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。設定使用 Service Directory 私下連線至 HTTP 服務供應商。只有在 HTTP 服務供應商託管於地端部署環境,且無法透過公開網際網路連線時,才應設定這項屬性。如果這個欄位留空,系統會透過公開網際網路呼叫 HTTP 服務供應商。

sslCaCertificate

string

選用。向 HTTP 服務供應商提出要求時,要使用的 SSL 憑證。

聯集欄位 authentication。向 HTTP 服務供應商提出要求時,要使用的驗證機制。authentication 只能是下列其中一個設定:
basicAuthentication

object (BasicAuthentication)

選用。使用使用者名稱和密碼的基本驗證。

bearerTokenAuthentication

object (BearerTokenAuthentication)

選用。使用權杖進行不記名權杖驗證。

BasicAuthentication

JSON 表示法
{
  "username": string,

  // Union field password can be only one of the following:
  "passwordSecretVersion": string
  // End of list of possible types for union field password.
}
欄位
username

string

這是必要旗標,要驗證的使用者名稱。

聯集欄位 password。驗證時使用的密碼。password 只能是下列其中一個設定:
passwordSecretVersion

string

用於驗證的密碼 SecretManager 密鑰版本。

BearerTokenAuthentication

JSON 表示法
{

  // Union field token can be only one of the following:
  "tokenSecretVersion": string
  // End of list of possible types for union field token.
}
欄位
聯集欄位 token。用於驗證身分的權杖。token 只能是下列其中一個設定:
tokenSecretVersion

string

選用。用於驗證的權杖 SecretManager 密鑰版本。

時間戳記

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
欄位
seconds

string (int64 format)

代表自 Unix 紀元 1970-01-01T00:00:00Z 起算的世界標準時間秒數。必須介於 -62135596800 和 253402300799 (含) 之間 (對應 0001-01-01T00:00:00Z 至 9999-12-31T23:59:59Z)。

nanos

integer

以奈秒解析度表示的非負分數秒。這個欄位是時間長度的奈秒部分,而非秒數的替代值。含有分數的負秒值仍須有非負奈秒值,以向前計算時間。必須介於 0 至 999,999,999 之間 (含 0 和 999,999,999)。

LabelsEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

InstallationState

JSON 表示法
{
  "stage": enum (Stage),
  "message": string,
  "actionUri": string
}
欄位
stage

enum (Stage)

僅供輸出。安裝程序的目前步驟。

message

string

僅供輸出。使用者接下來應採取的行動,以繼續安裝。如果安裝作業已完成,則為空白字串。

actionUri

string

僅供輸出。請點選連結,瞭解後續行動。如果安裝作業已完成,則為空白字串。

AnnotationsEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

CryptoKeyConfig

JSON 表示法
{
  "keyReference": string
}
欄位
keyReference

string

這是必要旗標,用於加密/解密客戶資料的金鑰名稱。Cloud KMS 中的金鑰應採用 projects/*/locations/*/keyRings/*/cryptoKeys/* 格式。

GitProxyConfig

JSON 表示法
{
  "enabled": boolean,
  "httpProxyBaseUri": string
}
欄位
enabled

boolean

選用。如果設為 true,就能使用 Git Proxy,對連線中連結的存放區執行 Git 作業。

httpProxyBaseUri

string

僅供輸出。HTTP Proxy 端點的基本 URI。格式為 https://{generatedID}-c-h-{shortRegion}.developerconnect.dev。只有在 enabled 設為 true 時,系統才會填入這個欄位。其他與 Developer Connect 整合的 Google 服務會使用這個端點。

GitHubApp

代表可安裝至 GitHub 使用者或組織,並與 Developer Connect 搭配使用的各種 GitHub 應用程式。

列舉
GIT_HUB_APP_UNSPECIFIED 未指定 GitHub 應用程式。
DEVELOPER_CONNECT Developer Connect GitHub 應用程式。
FIREBASE Firebase GitHub 應用程式。
GEMINI_CODE_ASSIST Gemini Code Assist 應用程式。
DATAFORM Dataform GitHub 應用程式。

階段

安裝程序階段。

列舉
STAGE_UNSPECIFIED 未指定階段。
PENDING_CREATE_APP 僅適用於 GitHub Enterprise。已要求建立應用程式。使用者必須在 GitHub Enterprise 主機中確認建立作業。
PENDING_USER_OAUTH 使用者必須透過 OAuth 授權 GitHub (或 Enterprise) 應用程式。
PENDING_INSTALL_APP 使用者必須點選連結,安裝 GitHub (或 Enterprise) 應用程式。
COMPLETE 安裝程序已完成。

工具註解

工具註解會傳送至 MCP 用戶端,說明特定工具的基本風險。大多數用戶端會將這些提示視為不受信任,但可用於決定何時向使用者傳送確認提示。

除了標題字串外,下列布林值提示的定義如下:

  • readOnlyHint:如果設為 true,工具不會修改環境。預設值:false。
  • destructiveHint:如果為 true,工具可以執行破壞性動作。如果為 false,則工具只能執行附加動作。預設值:true。
  • idempotentHint:如果設為 true,則使用相同引數重複呼叫工具,不會對環境造成額外影響。預設值:false。
  • openWorldHint:如果設為 true,工具就能與外部實體的「開放世界」互動。如果設為 false,工具只能與內部實體互動。舉例來說,網頁搜尋工具是開放世界,而記憶工具則不是。

Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌