Skip to main content

MCP tools reference

The Casdoor MCP server offers tools that manage Casdoor objects. This page describes how to list the tools, how to call them, and what they return.

List the tools​

Call tools/list:

POST /api/mcp
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}

Which tools the response contains depends on how the request is authenticated:

AuthenticationTools in the response
NoneAll tools, so that clients can discover them. Calling a tool still requires authentication
Session cookieAll tools
Access tokenThe tools that the scopes of the token allow

Each tool comes with a description and an input schema:

{
"jsonrpc": "2.0",
"id": 2,
"result": {
"tools": [
{
"name": "get_applications",
"description": "Get all applications for a specific owner",
"inputSchema": {
"type": "object",
"properties": {
"owner": {
"type": "string",
"description": "The owner of applications"
}
},
"required": ["owner"]
}
}
]
}
}

Application tools​

ToolDescription
get_applicationsGets all applications of an organization
get_applicationGets one application
add_applicationCreates an application
update_applicationChanges an application
delete_applicationDeletes an application

Call a tool with tools/call, the name of the tool, and its arguments.

get_applications:

{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_applications",
"arguments": {
"owner": "my-org"
}
}
}

get_application:

{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "get_application",
"arguments": {
"id": "my-org/my-app"
}
}
}

add_application:

{
"jsonrpc": "2.0",
"id": 5,
"method": "tools/call",
"params": {
"name": "add_application",
"arguments": {
"application": {
"owner": "my-org",
"name": "new-app",
"displayName": "New Application",
"organization": "my-org"
}
}
}
}

update_application:

{
"jsonrpc": "2.0",
"id": 6,
"method": "tools/call",
"params": {
"name": "update_application",
"arguments": {
"id": "my-org/my-app",
"application": {
"owner": "my-org",
"name": "my-app",
"displayName": "Updated Name"
}
}
}
}

delete_application:

{
"jsonrpc": "2.0",
"id": 7,
"method": "tools/call",
"params": {
"name": "delete_application",
"arguments": {
"application": {
"owner": "my-org",
"name": "old-app"
}
}
}
}

User tools​

The user tools work like the application tools.

ToolArgumentsDescription
get_usersownerLists all users of an organization
get_userid, or owner and email, or owner and phoneGets one user
add_useruser objectCreates a user
update_userid and user objectChanges a user
delete_useruser objectDeletes a user

Other tools​

The server also has tools for organizations, roles, permissions, providers, and tokens. For the names of all tools and the scope that each one requires, see the scope reference.

Result format​

A successful call returns the result as content:

{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{
"type": "text",
"text": "[{\"name\":\"app1\",\"displayName\":\"App 1\"}]"
}
]
}
}

When the tool fails, the result has the isError flag:

{
"jsonrpc": "2.0",
"id": 5,
"result": {
"content": [
{
"type": "text",
"text": "application quota is exceeded"
}
],
"isError": true
}
}

Errors of the protocol itself, such as a missing scope, are JSON-RPC errors. See MCP error handling.

See also​