Grant an MCP tool to a role
import requests
url = "https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}/grants"
payload = { "tool_name": "<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({tool_name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}/grants', 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/{server_id}/grants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_mcp_server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_name": "<string>",
"allowed_to_role": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}MCP Servers
Grant an MCP tool to a role
Lets members with the given role use one of the server’s tools. The role defaults to member. Requires the ai.manage permission.
POST
/
api
/
v1
/
org
/
mcp-servers
/
{server_id}
/
grants
Grant an MCP tool to a role
import requests
url = "https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}/grants"
payload = { "tool_name": "<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({tool_name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/mcp-servers/{server_id}/grants', 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/{server_id}/grants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_mcp_server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_name": "<string>",
"allowed_to_role": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"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
application/json