Register an MCP server
import requests
url = "https://platform.ankra.app/api/v1/org/mcp-servers"
payload = {
"name": "<string>",
"url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', url: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/mcp-servers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/mcp-servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<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
Register an MCP server
Registers an MCP server for the organisation's AI agents. A remote server (http or sse) must have a public http(s) URL. An env key that looks like a credential must reference a secret by marker (${SECRET_SLOT:<slot_id>}, or ${VAULT:<path>} naming one of the organisation's own secret slots): a plain value, or a ${VAULT:<path>} outside the organisation's secret slots, is refused, so create a secret slot first and pass its sentinel. Env values are never returned. Requires the ai.manage permission.
POST
/
api
/
v1
/
org
/
mcp-servers
Register an MCP server
import requests
url = "https://platform.ankra.app/api/v1/org/mcp-servers"
payload = {
"name": "<string>",
"url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', url: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/mcp-servers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/mcp-servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<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
Env entries for the server. A key that looks like a credential (token, secret, password, api_key, ...) must hold a ${SECRET_SLOT:<slot_id>} or ${VAULT:} marker. A ${VAULT:} value, under any key, must name one of the organisation's own secret slots (ankra/ai-secret-slots/<organisation_id>/<slot_id>); any other path is refused.
Response
The registered server