Update an MCP server
import requests
url = "https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}"
payload = {
"description": "<string>",
"url": "<string>",
"env": {},
"env_patch": {},
"allowed_tools": ["<string>"],
"enabled": True,
"adapter_key": "<string>",
"cluster_allow_list": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
url: '<string>',
env: {},
env_patch: {},
allowed_tools: ['<string>'],
enabled: true,
adapter_key: '<string>',
cluster_allow_list: ['<string>']
})
};
fetch('https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/mcp-servers/{server_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"url": "<string>",
"env": {},
"env_patch": {},
"allowed_tools": [
"<string>"
],
"enabled": true,
"adapter_key": "<string>",
"cluster_allow_list": [
"<string>"
]
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"transport": "stdio",
"url": "<string>",
"env_keys": [
"<string>"
],
"allowed_tools": [
"<string>"
],
"enabled": true,
"permission_tier": "read_only",
"adapter_key": "<string>",
"cluster_allow_list": [
"<string>"
],
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_connected_at": "2023-11-07T05:31:56Z",
"last_error": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}MCP Servers
Update an MCP server
Changes the fields the body names and keeps the rest. env replaces every env entry, while env_patch changes only the keys it names. An explicit null clears allowed_tools, adapter_key or cluster_allow_list. The name and transport cannot change: register a new server for that. The same URL and secret-marker rules as registration apply. Requires the ai.manage permission.
PUT
/
api
/
v1
/
org
/
mcp-servers
/
{server_id}
Update an MCP server
import requests
url = "https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}"
payload = {
"description": "<string>",
"url": "<string>",
"env": {},
"env_patch": {},
"allowed_tools": ["<string>"],
"enabled": True,
"adapter_key": "<string>",
"cluster_allow_list": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
url: '<string>',
env: {},
env_patch: {},
allowed_tools: ['<string>'],
enabled: true,
adapter_key: '<string>',
cluster_allow_list: ['<string>']
})
};
fetch('https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/mcp-servers/{server_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"url": "<string>",
"env": {},
"env_patch": {},
"allowed_tools": [
"<string>"
],
"enabled": true,
"adapter_key": "<string>",
"cluster_allow_list": [
"<string>"
]
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"transport": "stdio",
"url": "<string>",
"env_keys": [
"<string>"
],
"allowed_tools": [
"<string>"
],
"enabled": true,
"permission_tier": "read_only",
"adapter_key": "<string>",
"cluster_allow_list": [
"<string>"
],
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_connected_at": "2023-11-07T05:31:56Z",
"last_error": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Response
The updated server