Integrations
Update an MCP server
Turns the server on or off for workflows and marks each tool read-only or enabled; a tool left out is unchanged. Sending url, auth_type, header_name, token or client_id reconnects the server: CostGraph lists its tools again, keeping the choices made for tools it still lists, and an omitted bearer token keeps the stored one. Reconnecting with auth_type oauth returns an authorize_url, and the server keeps its current sign-in until that completes.
PATCH
/
api
/
v1
/
integrations
/
connections
/
{id}
/
mcp-server
Update an MCP server
curl --request PATCH \
--url https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"client_secret": "<string>",
"header_name": "<string>",
"token": "<string>",
"tools": [
{
"enabled": true,
"name": "<string>",
"read_only": true
}
],
"url": "<string>",
"workflows_enabled": true
}
'import requests
url = "https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"header_name": "<string>",
"token": "<string>",
"tools": [
{
"enabled": True,
"name": "<string>",
"read_only": True
}
],
"url": "<string>",
"workflows_enabled": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '<string>',
client_secret: '<string>',
header_name: '<string>',
token: '<string>',
tools: [{enabled: true, name: '<string>', read_only: true}],
url: '<string>',
workflows_enabled: true
})
};
fetch('https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => '<string>',
'client_secret' => '<string>',
'header_name' => '<string>',
'token' => '<string>',
'tools' => [
[
'enabled' => true,
'name' => '<string>',
'read_only' => true
]
],
'url' => '<string>',
'workflows_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"header_name\": \"<string>\",\n \"token\": \"<string>\",\n \"tools\": [\n {\n \"enabled\": true,\n \"name\": \"<string>\",\n \"read_only\": true\n }\n ],\n \"url\": \"<string>\",\n \"workflows_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"header_name\": \"<string>\",\n \"token\": \"<string>\",\n \"tools\": [\n {\n \"enabled\": true,\n \"name\": \"<string>\",\n \"read_only\": true\n }\n ],\n \"url\": \"<string>\",\n \"workflows_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"header_name\": \"<string>\",\n \"token\": \"<string>\",\n \"tools\": [\n {\n \"enabled\": true,\n \"name\": \"<string>\",\n \"read_only\": true\n }\n ],\n \"url\": \"<string>\",\n \"workflows_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"authorize_url": "<string>",
"server": {
"auth_type": "none",
"connection_id": "<string>",
"created_at": "<string>",
"header_name": "<string>",
"id": "<string>",
"last_error": "<string>",
"name": "<string>",
"slug": "<string>",
"status": "<string>",
"tools": [
{
"description": "<string>",
"enabled": true,
"name": "<string>",
"read_only": true,
"read_only_hint": true
}
],
"updated_at": "<string>",
"url": "<string>",
"workflows_enabled": true
},
"sign_in_required": true
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Path Parameters
Connection id
Body
application/json
MCP server settings
Was this page helpful?
⌘I
Update an MCP server
curl --request PATCH \
--url https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"client_secret": "<string>",
"header_name": "<string>",
"token": "<string>",
"tools": [
{
"enabled": true,
"name": "<string>",
"read_only": true
}
],
"url": "<string>",
"workflows_enabled": true
}
'import requests
url = "https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"header_name": "<string>",
"token": "<string>",
"tools": [
{
"enabled": True,
"name": "<string>",
"read_only": True
}
],
"url": "<string>",
"workflows_enabled": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '<string>',
client_secret: '<string>',
header_name: '<string>',
token: '<string>',
tools: [{enabled: true, name: '<string>', read_only: true}],
url: '<string>',
workflows_enabled: true
})
};
fetch('https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => '<string>',
'client_secret' => '<string>',
'header_name' => '<string>',
'token' => '<string>',
'tools' => [
[
'enabled' => true,
'name' => '<string>',
'read_only' => true
]
],
'url' => '<string>',
'workflows_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"header_name\": \"<string>\",\n \"token\": \"<string>\",\n \"tools\": [\n {\n \"enabled\": true,\n \"name\": \"<string>\",\n \"read_only\": true\n }\n ],\n \"url\": \"<string>\",\n \"workflows_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"header_name\": \"<string>\",\n \"token\": \"<string>\",\n \"tools\": [\n {\n \"enabled\": true,\n \"name\": \"<string>\",\n \"read_only\": true\n }\n ],\n \"url\": \"<string>\",\n \"workflows_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/integrations/connections/{id}/mcp-server")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"header_name\": \"<string>\",\n \"token\": \"<string>\",\n \"tools\": [\n {\n \"enabled\": true,\n \"name\": \"<string>\",\n \"read_only\": true\n }\n ],\n \"url\": \"<string>\",\n \"workflows_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"authorize_url": "<string>",
"server": {
"auth_type": "none",
"connection_id": "<string>",
"created_at": "<string>",
"header_name": "<string>",
"id": "<string>",
"last_error": "<string>",
"name": "<string>",
"slug": "<string>",
"status": "<string>",
"tools": [
{
"description": "<string>",
"enabled": true,
"name": "<string>",
"read_only": true,
"read_only_hint": true
}
],
"updated_at": "<string>",
"url": "<string>",
"workflows_enabled": true
},
"sign_in_required": true
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}