Keycloak Mcp 伺服器
MCP伺服器實現用於Keycloak用戶管理。通過模型上下文協議(MCP)實現AI驅動的Keycloak用戶和領域管理。與Claude桌面和其他MCP客戶端無縫集成,以實現自動化的用戶操作。
概覽
Keycloak模型上下文协议是什麼?
Keycloak模型上下文协议(MCP)是一種創新的伺服器實現,旨在有效管理Keycloak用戶。它利用人工智能驅動的管理來簡化用戶和領域管理,使組織更容易處理其身份和訪問管理需求。MCP促進了與各種客戶端的無縫集成,包括Claude Desktop,允許自動化用戶操作和增強的管理能力。
Keycloak模型上下文協議的特點
- 人工智能驅動的管理:利用人工智能自動化用戶管理任務,減少手動工作並提高效率。
- 無縫集成:與Claude Desktop及其他MCP客戶端輕鬆協作,實現用戶管理的自動化操作。
- 用戶和領域管理:簡化Keycloak中用戶和領域的管理,為管理員提供友好的界面。
- 公共存儲庫:該項目是開源的,公開可用,允許開發者貢獻並增強其功能。
- 活躍社區:隨著星標和分支數量的增長,MCP擁有一個活躍的社區,支持其開發和使用。
如何使用Keycloak模型上下文協議
- 安裝:首先從GitHub克隆存儲庫。您可以使用以下命令:
git clone https://github.com/ChristophEnglisch/keycloak-model-context-protocol.git
- 設置:按照存儲庫的README文件中提供的安裝說明設置伺服器。
- 配置:配置MCP以連接到您的Keycloak實例。這可能涉及設置API密鑰和調整設置以適合您的環境。
- 集成:與像Claude Desktop這樣的客戶端集成,以開始自動化用戶管理任務。
- 使用:利用MCP的功能有效管理用戶和領域。查閱文檔以獲取詳細的使用說明和示例。
常見問題解答
Q1: Keycloak模型上下文協議的主要目的是什麼?
A1: MCP的主要目的是通過人工智能驅動的自動化來增強Keycloak中的用戶管理和領域管理。
Q2: Keycloak模型上下文協議是免費使用的嗎?
A2: 是的,MCP是一個開源項目,免費提供。您可以為其開發做出貢獻或在您的項目中免費使用。
Q3: 我該如何為Keycloak模型上下文協議做出貢獻?
A3: 您可以通過分叉存儲庫、進行改進並提交拉取請求來貢獻。社區歡迎增強MCP功能和可用性的貢獻。
Q4: 我可以將Keycloak模型上下文協議與其他應用程序集成嗎?
A4: 是的,MCP旨在與各種應用程序和客戶端集成,使其在用戶管理的不同用例中具有多功能性。
Q5: 我可以在哪裡找到有關Keycloak模型上下文協議的更多信息?
A5: 有關該項目的其他信息,包括文檔和使用示例,可以在項目的GitHub存儲庫中找到。
詳細
Keycloak MCP Server
A Model Context Protocol server for Keycloak administration, providing tools to manage users and realms.
Features
- Create new users in specific realms
- Delete users from realms
- List available realms
- List users in specific realms
Installation
Installing via Smithery
To install Keycloak for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install keycloak-model-context-protocol --client claude
Via NPM (Recommended)
The server is available as an NPM package:
### Direct usage with npx
npx -y keycloak-model-context-protocol
### Or global installation
npm install -g keycloak-model-context-protocol
Local Development Setup
If you want to develop or modify the server:
git clone <repository-url>
cd keycloak-model-context-protocol
npm install
npm run build
Configuration
Using NPM Package (Recommended)
Configure the server in your Claude Desktop configuration file:
{
"mcpServers": {
"keycloak": {
"command": "npx",
"args": ["-y", "keycloak-model-context-protocol"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
For Local Development
{
"mcpServers": {
"keycloak": {
"command": "node",
"args": ["path/to/dist/index.js"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
Available Tools
create-user
Creates a new user in a specified realm.
Inputs:
realm
: The realm nameusername
: Username for the new useremail
: Email address for the userfirstName
: User's first namelastName
: User's last name
delete-user
Deletes a user from a specified realm.
Inputs:
realm
: The realm nameuserId
: The ID of the user to delete
list-realms
Lists all available realms.
list-users
Lists all users in a specified realm.
Inputs:
realm
: The realm name
Development
npm run watch
Testing
To test the server using MCP Inspector:
npx -y @modelcontextprotocol/inspector npx -y keycloak-model-context-protocol
Deployment
NPM Package
This project is automatically published to NPM via GitHub Actions when a new release is published on GitHub.
Setup Requirements for Deployment
- Create NPM account and get access token
- Add NPM_TOKEN secret to GitHub repository
- Go to repository Settings > Secrets
- Add new secret named
NPM_TOKEN
- Paste your NPM access token as the value
Prerequisites
- Node.js 18 or higher
- Running Keycloak instance
伺服器配置
{
"mcpServers": {
"mcp-server-circleci": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--circleci-public--mcp-server-circleci--mcp-server-circleci",
"node ./dist/index.js"
],
"env": {
"CIRCLECI_TOKEN": "circleci-token",
"CIRCLECI_BASE_URL": "circleci-base-url"
}
}
}
}