Mcp Api

io.fusionauth由 fusionauth.io 发布v0.1.14更新于 Oct 24, 2026

Preview release of FusionAuth API MCP server

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

让助手调用 FusionAuth 身份与用户管理 API,包括创建、更新、搜索和删除用户、应用与租户。

可以做什么
这是一个预览版 MCP 服务器,把 FusionAuth API 暴露为工具,每个 API 端点对应一个工具,总数超过 300 个。工具按前缀分组,例如 create、delete、patch、update、retrieve、search 和 other,通过 USE_TOOLS 变量选择启用哪些分组。助手因此可以查询应用或用户数量、查找记录,并在启用写入工具时新增或修改用户与配置。
适用场景
适用于需要对接 FusionAuth 身份服务器,并希望助手用自然语言查看或管理租户、应用和用户的场景。更适合本地开发与测试实例,而非生产环境。
运行要求
需要一个运行中的 FusionAuth 实例和 Node.js。npm 包 @fusionauth/mcp-api 通过 stdio 在本地运行。必需的环境变量:API_BASE_URL 指定实例地址,API_KEY_APIKEYAUTH 为 FusionAuth API 密钥。USE_TOOLS 可选,用于限制暴露的工具分组;不设置会加载全部工具,约需 20 万 token 的上下文窗口。
安装前请注意
该服务器为预览版,README 明确说明不可用于生产环境,且 FusionAuth 不对可能泄露敏感信息负责。它需要在 MCP 客户端配置中提供 FusionAuth API 密钥(API_KEY_APIKEYAUTH)。启用写入工具后,助手可以创建、更新、修补或删除用户、应用及其他配置,因此建议把 USE_TOOLS 限制为 retrieve,search,并收紧 API 密钥的权限范围。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Api,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

FusionAuth API MCP Server (fusionauth-mcp-api)

[npm version] [License: Apache] [GitHub repository]

Using this MCP server requires a FusionAuth API key which is stored in the MCP client configuration. Scope the API key appropriately.

FusionAuth is not responsible for potentially leaking sensitive information.

Prerequisites

  • A running FusionAuth instance
  • Node.js

Configuration

First, set up a limited API key in the FusionAuth instance. Here's documentation on creating an API key and configuring the correct permissions for an API key.

Next, configure your MCP client to use the FusionAuth API MCP server.

For example, to add to Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json to include the fusionauth-mcp-api key below.

If you don't have any previous MCP servers installed, it would look like this:

json
{  "mcpServers": {      "fusionauth-mcp-api": {      "command": "npx",      "args": [        "@fusionauth/mcp-api"      ],      "env": {        "API_KEY_APIKEYAUTH": "<your fusionauth api key>",        "API_BASE_URL": "http://localhost:9011",        "USE_TOOLS": "retrieve,search"      }    }  }}

The USE_TOOLS env variable above essentially restricts the available tools to read-only operations. You can omit this variable to allow full access, but you will need a model that can handle about 200k tokens.

Consult your MCP client's documentation to determine exactly how to add an MCP server to your client.

Example Prompts

  • "which tools do you have access to?" should show you all the FusionAuth API tools
  • "how many fusionauth applications do I have?"
  • "how many users do I have in my fusionauth instance?"
  • "add a user with an email address of [email protected] and a password of 'password'" (requires less restricted tools)

Restricting Tools

The default MCP Server has a tool for every API endpoint of FusionAuth. Over 300 of them! However, the tools, descriptions, requests, and responses combine to nearly 200k tokens, which can exceed the context window of many MCP clients.

You can restrict which tools this MCP server makes available by setting the USE_TOOLS env variable as shown above.

Each tool is defined by its prefix. The default prefixes are:

  • create
  • delete
  • patch
  • update
  • retrieve
  • search

There is also an other tool bucket that contains every tool with another prefix. The all tool bucket includes all tools and is the default value.

For example, if you don't need to use any delete or patch methods, the following setting reduces the tool list by 20%.

USE_TOOLS="create,update,retrieve,search,other"

If you only want to allow read-only operations, use the following configuration:

USE_TOOLS="retrieve,search"

This also reduces the tool list size by 66%.

Securing Your MCP Server

There are three different approaches to secure your MCP server and you should combine them to enable secure access to your FusionAuth instance while still meeting your functionality needs. In order of granularity (from coarse to fine-grained):

  • Point to the correct instance.
  • Enable the correct type of tools. In addition to reducing context window usage, limiting the type of requests your LLM can make can increase security. For instance, if you don't enable the delete set of tools, you don't have to worry about the LLM "helping" you by deleting FusionAuth configuration.
  • Lock down your API key. This allows fine-grained control beyond the tool choice. The MCP server communicates to FusionAuth using an API key. You can limit that API key to only allow it to act on tenants, applications and users by choosing the appropriate set of permissions.

Troubleshooting

Verify your API key has the correct permissions for the operation the MCP client is taking.

Check your MCP client logs; these vary by MCP client and platform. For example, $HOME/Library/Logs/Claude/mcp-server-fusionauth-api-server.log is the location for Claude Desktop on macOS. Consult your client's documentation for the precise location.

Use the modelcontextprotocol inspector to help determine if the issue is with the MCP server or with your MCP client: npx @modelcontextprotocol/inspector. If you want to change the USE_TOOLS variable, you cannot dynamically change it and must pass it on the command line. npx @modelcontextprotocol/inspector npx @fusionauth/mcp-api -e API_KEY_APIKEYAUTH=... -e USE_TOOLS=create

Building Locally

You can also build and run this locally.

bash
git clone https://github.com/FusionAuth/fusionauth-mcp-api.gitcd fusionauth-mcp-apicd packages/mcp-apinpm installnpm run build
# optional step to store config information in .env filecp .env.example .env# optionally edit .env to set API_BASE_URL and API_KEY_APIKEYAUTH

Then, similar to the instructions above, configure your MCP client to use the FusionAuth API MCP server.

For example, to add to Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json to include the fusionauth-mcp-api key below. If you don't have any previous MCP servers installed, it would look like this:

json
{  "mcpServers": {    "fusionauth-mcp-api": {      "command": "npm",      "args": [        "run",        "--silent",        "--prefix",        "<path to local git repo>/fusionauth-mcp-api/packages/mcp-api",        "start"      ],      "env": {        "API_KEY_APIKEYAUTH": "<your fusionauth api key>",        "API_BASE_URL": "http://localhost:9011",        "USE_TOOLS": "retrieve,search"      }    }  }}

You can omit the env section above if you have configured an .env file.

Publishing

bin/updatemcp.sh git commit git tag git push origin main --tags npm publish --access public --workspace=packages/mcp-api

Feedback

Please share feature requests and bugs in this repo.

If you want to share interesting use cases or ask how to use functionality, please post in the FusionAuth forum.

来源:README.md,提交 7a978f8

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.14最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。