mcp-api — Claude Code MCP server: what it does, how to install
Connects your local FusionAuth instance to AI coding agents via API. Inspect setups, query accounts, and manage identities from the prompt.
claude mcp add --env API_KEY_APIKEYAUTH=<API_KEY_APIKEYAUTH> --env API_BASE_URL=<API_BASE_URL> --env USE_TOOLS=<USE_TOOLS> --transport stdio mcp-api -- npx -y @fusionauth/mcp-apiWhat mcp-api does
This integration bridges assistant clients with the FusionAuth REST interface. Generated directly from the OpenAPI specification, it exposes more than 300 platform operations. Agents can inspect configurations or create mock records during local testing.
Do not connect this to production clusters. The project is an early preview and demands handing an API secret over to your AI runner. Because leaks remain a risk, FusionAuth advises running this purely against sandbox instances.
Loading every available call costs close to 200k tokens of schema definitions alone. That easily exhausts model prompt limits. Setting USE_TOOLS="retrieve,search" keeps payloads manageable by enabling read-only actions and dropping unused handlers.
What it helps with
- inspect applications configured in a local FusionAuth cluster
- query user directories without opening the management console
- provision test accounts using natural language requests
- trim schema overhead by restricting enabled tool prefixes
Example prompts for the agent
- How many users are currently registered in my FusionAuth instance?
- List all applications configured in FusionAuth
- Create a test account with email [email protected] and a random password
How to install mcp-api
Platform CLI
claude mcp add --env API_KEY_APIKEYAUTH=<API_KEY_APIKEYAUTH> --env API_BASE_URL=<API_BASE_URL> --env USE_TOOLS=<USE_TOOLS> --transport stdio mcp-api -- npx -y @fusionauth/mcp-apiReplace <…> with your own values
Platform CLI
codex mcp add mcp-api --env API_KEY_APIKEYAUTH=<API_KEY_APIKEYAUTH> --env API_BASE_URL=<API_BASE_URL> --env USE_TOOLS=<USE_TOOLS> -- npx -y @fusionauth/mcp-apiReplace <…> with your own values
Config file
{
"mcpServers": {
"mcp-api": {
"command": "npx",
"args": [
"-y",
"@fusionauth/mcp-api"
],
"env": {
"API_KEY_APIKEYAUTH": "<API_KEY_APIKEYAUTH>",
"API_BASE_URL": "<API_BASE_URL>",
"USE_TOOLS": "<USE_TOOLS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mcp-api": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@fusionauth/mcp-api"
],
"env": {
"API_KEY_APIKEYAUTH": "<API_KEY_APIKEYAUTH>",
"API_BASE_URL": "<API_BASE_URL>",
"USE_TOOLS": "<USE_TOOLS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e API_KEY_APIKEYAUTH=<API_KEY_APIKEYAUTH> -e API_BASE_URL=<API_BASE_URL> -e USE_TOOLS=<USE_TOOLS> mcp-api npx -y @fusionauth/mcp-apiReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-api
How to install mcp-api in Claude Code?
Run `claude mcp add --env API_KEY_APIKEYAUTH=<API_KEY_APIKEYAUTH> --env API_BASE_URL=<API_BASE_URL> --env USE_TOOLS=<USE_TOOLS> --transport stdio mcp-api -- npx -y @fusionauth/mcp-api` with your instance URL and secret.
What does the mcp-api server do?
It translates FusionAuth API operations into callable tool definitions so an AI assistant can manage tenants, accounts, and application settings.
Why should you configure USE_TOOLS?
The complete registry exceeds 300 methods and consumes roughly 200k context tokens. Filtering with prefixes like retrieve,search prevents context exhaustion and avoids unintended modifications.