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>"
}
]
}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.
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The registered MCP server's id.
Body
2048A public http(s) URL for http and sse servers.
1Replaces every env entry. The secret-marker rule of registration applies.
Changes only the env keys it names. The secret-marker rule of registration applies.
The tools agents may call; null allows every tool.
read_only, read_write A curated adapter key from the catalog; null clears it.
Cluster ids to limit the server to; null allows every cluster.
Response
The updated server
stdio, http, sse The env key names, sorted. Values are never returned.
The tools agents may call, or null for every tool the server offers.
read_only, read_write The curated adapter the server was registered from, or null.
The cluster ids the server is limited to, or null for every cluster.
When Ankra last connected to the server.
The error from the last failed connection, or null.