MCPツールリファレンス
Casdoor MCPサーバーは、Casdoorオブジェクトを管理するツールを提供します。このページでは、ツールのリスト方法、呼び出し方法、および戻り値について説明します。
ツールのリスト表示
tools/list を呼び出します:
POST /api/mcp
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}
レスポンスに含まれるツールは、リクエストの認証方法によって異なります:
| Authentication | Tools in the response |
|---|---|
| None | All tools, so that clients can discover them. Calling a tool still requires authentication |
| Session cookie | All tools |
| Access token | The tools that the scopes of the token allow |
各ツールには、説明と入力スキーマが付属しています:
{
"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"]
}
}
]
}
}
アプリケーションツール
| Tool | Description |
|---|---|
get_applications | Gets all applications of an organization |
get_application | Gets one application |
add_application | Creates an application |
update_application | Changes an application |
delete_application | Deletes an application |
tools/call、ツールの名前、およびその引数を使用してツールを呼び出します。
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"
}
}
}
}
ユーザーツール
ユーザーツールはアプリケーションツールと同様に動作します。
| Tool | Arguments | Description |
|---|---|---|
get_users | owner | Lists all users of an organization |
get_user | id, or owner and email, or owner and phone | Gets one user |
add_user | user object | Creates a user |
update_user | id and user object | Changes a user |
delete_user | user object | Deletes a user |
その他のツール
商用またはエンタープライズライセンスでは、サーバーには組織、プロバイダー、ロール、権限、グループ、証明書、トークンを管理するためのツール、アプリ向けにアプリケーションを設定しサードパーティログインを接続するためのツール、すべての変更のドライラン機能、エージェントによる変更の記録、および変更の承認とロールバック機能が追加されます。詳細については、「AI エージェントによる Casdoor の管理」を参照してください。各ツールに必要なスコープについては、「スコープリファレンス」を参照してください。
結果フォーマット
呼び出しが成功すると、結果は content として返されます:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{
"type": "text",
"text": "[{\"name\":\"app1\",\"displayName\":\"App 1\"}]"
}
]
}
}
ツールが失敗した場合、結果には isError フラグが含まれます:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"content": [
{
"type": "text",
"text": "application quota is exceeded"
}
],
"isError": true
}
}
スコープの欠落などプロトコル自体のエラーは JSON-RPC エラーです。MCP エラー処理を参照してください。