{
  "markdown": "# Preview FusionAuth API MCP Server (fusionauth-mcp-api)\n\n[![npm version](https://img.shields.io/npm/v/@fusionauth/mcp-api.svg)](https://www.npmjs.com/package/@fusionauth/mcp-api)\n[![License: Apache](https://img.shields.io/badge/License-Apache-yellow.svg)](https://opensource.org/license/apache-2-0)\n[![GitHub repository](https://img.shields.io/badge/GitHub-FusionAuth/fusionauth--mcp--api-blue.svg)](https://github.com/FusionAuth/fusionauth-mcp-api)\n\nA preview release of an MCP server for the FusionAuth API.\nBuilt with the excellent [github.com/harsha-iiiv/openapi-mcp-generator](https://github.com/harsha-iiiv/openapi-mcp-generator)\n\n## ⚠️  Not for Production Use!\n\nUsing this MCP server requires providing the MCP client with a FusionAuth API key. Only use this for dev and test instances. FusionAuth is not responsible for potentially leaking sensitive information.\n\n<!--\ntag::forDocSite[]\n-->\n\n## Prerequisites\n\n* A running FusionAuth instance\n* Node.js\n\n## Configuration\n\nFirst, set up a limited API key in the FusionAuth instance. Here's documentation on [creating an API key](https://fusionauth.io/docs/apis/authentication#create-an-api-key) and [configuring the correct permissions for an API key](https://fusionauth.io/docs/apis/authentication#api-key-permissions).\n\nNext, configure your MCP client to use the FusionAuth API MCP server.\n\nFor example, to add to Claude Desktop, edit `~/Library/Application Support/Claude/claude_desktop_config.json` to include the `fusionauth-mcp-api` key below. \n\nIf you don't have any previous MCP servers installed, it would look like this:\n\n```json\n{\n  \"mcpServers\": {\n      \"fusionauth-mcp-api\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@fusionauth/mcp-api\"\n      ],\n      \"env\": {\n        \"API_KEY_APIKEYAUTH\": \"<your fusionauth api key>\",\n        \"API_BASE_URL\": \"http://localhost:9011\",\n        \"USE_TOOLS\": \"retrieve,search\"\n      }\n    }\n  }\n}\n```\n\nThe `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.\n\nConsult your MCP client's documentation to determine exactly how to add an MCP server to your client.\n\n## Example Prompts\n\n* \"which tools do you have access to?\" should show you all the FusionAuth API tools\n* \"how many fusionauth applications do I have?\"\n* \"how many users do I have in my fusionauth instance?\"\n* \"add a user with an email address of test@example.com and a password of 'password'\" (requires less restricted tools)\n\n## Restricting Tools\n\nThe default MCP Server has a tool for every API endpoint of FusionAuth. Over 300 of them!\nHowever, the tools, descriptions, requests, and responses combine to nearly 200k tokens, \nwhich can exceed the context window of many MCP clients.\n\nYou can restrict which tools this MCP server makes available by setting the USE_TOOLS env \nvariable as shown above.\n\nEach tool is defined by its prefix. The default prefixes are:\n\n* `create`\n* `delete`\n* `patch`\n* `update`\n* `retrieve`\n* `search`\n\nThere 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.\n\nFor example, if you don't need to use any `delete` or `patch` methods, the following setting reduces the tool list by 20%.\n\n```\nUSE_TOOLS=\"create,update,retrieve,search,other\"\n```\n\nIf you only want to allow read-only operations, use the following configuration:\n\n```\nUSE_TOOLS=\"retrieve,search\"\n```\n\nThis also reduces the tool list size by 66%.\n\n## Securing Your MCP Server\n\nThere 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):\n\n* Point to the correct instance. This tool is in preview and we suggest you only point it at a local, dev instance.\n* 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.\n* 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](https://fusionauth.io/docs/apis/authentication#api-key-permissions). \n\n## Troubleshooting\n\nVerify your API key has the correct permissions for the operation the MCP client is taking.\n\nCheck 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.\n\nUse 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`\n\n<!--\nend::forDocSite[]\n-->\n\n## Building Locally\n\nYou can also build and run this locally.\n\n```bash\ngit clone https://github.com/FusionAuth/fusionauth-mcp-api.git\ncd fusionauth-mcp-api\ncd packages/mcp-api\nnpm install\nnpm run build\n\n# optional step to store config information in .env file\ncp .env.example .env\n# optionally edit .env to set API_BASE_URL and API_KEY_APIKEYAUTH\n```\n\nThen, similar to the instructions above, configure your MCP client to use the FusionAuth API MCP server.\n\nFor 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:\n\n```json\n{\n  \"mcpServers\": {\n    \"fusionauth-mcp-api\": {\n      \"command\": \"npm\",\n      \"args\": [\n        \"run\",\n        \"--silent\",\n        \"--prefix\",\n        \"<path to local git repo>/fusionauth-mcp-api/packages/mcp-api\",\n        \"start\"\n      ],\n      \"env\": {\n        \"API_KEY_APIKEYAUTH\": \"<your fusionauth api key>\",\n        \"API_BASE_URL\": \"http://localhost:9011\",\n        \"USE_TOOLS\": \"retrieve,search\"\n      }\n    }\n  }\n}\n```\n\nYou can omit the `env` section above if you have configured an `.env` file.\n\n## Publishing\n\nbin/updatemcp.sh\ngit commit <changed files>\ngit tag <tag>\ngit push origin main --tags\nnpm publish --access public --workspace=packages/mcp-api\n\n## Feedback\n\nPlease share feature requests and bugs in this repo.\n\nIf you want to share interesting use cases or ask how to use functionality, please post in [the FusionAuth forum](https://fusionauth.io/community/forum/).\n",
  "bytes": 6972,
  "sha": "39e5613e840abc46bbae97c41d4408f8021b627e989654848ace0e944b5137a2",
  "repo_slug": "fusionauth/fusionauth-mcp-api",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_fusionauth_mcp_api_dbfa4023/readme"
}