
Mcp Api
io.fusionauth由 fusionauth.io 發布v0.1.14更新於 Oct 24, 2026
Preview release of FusionAuth API MCP server
概覽
讓助理呼叫 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 的上下文視窗。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Api,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
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:
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:
createdeletepatchupdateretrievesearch
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%.
If you only want to allow read-only operations, use the following configuration:
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
deleteset 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.
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:
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版本歷史
1- v0.1.14最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。