Keycloak Mcp 服务器
MCP服务器实现用于Keycloak用户管理。通过模型上下文协议(MCP)实现对Keycloak用户和领域的AI驱动管理。与Claude Desktop和其他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 的功能高效管理用户和领域。查看文档以获取详细的使用说明和示例。
常见问题解答
问题 1:Keycloak 模型上下文协议的主要目的是什么?
回答 1:MCP 的主要目的是通过人工智能驱动的自动化增强 Keycloak 中的用户管理和领域管理。
问题 2:Keycloak 模型上下文协议是免费使用的吗?
回答 2:是的,MCP 是一个开源项目,免费提供。您可以为其开发做出贡献或在您的项目中使用,而无需任何费用。
问题 3:我如何能为 Keycloak 模型上下文协议做贡献?
回答 3:您可以通过分叉仓库、进行改进并提交拉取请求来贡献。社区欢迎增强 MCP 功能和可用性的贡献。
问题 4:我可以将 Keycloak 模型上下文协议与其他应用程序集成吗?
回答 4:是的,MCP 旨在与各种应用程序和客户端集成,使其在用户管理的不同用例中具有多功能性。
问题 5:我在哪里可以找到有关 Keycloak 模型上下文协议的更多信息?
回答 5:有关更多信息,包括文档和使用示例,可以在项目的 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
Server配置
{
"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"
}
}
}
}