centralauth-mcp-server
v0.3.0
Published
MCP server for AI-assisted CentralAuth integration guidance.
Downloads
46
Maintainers
Readme
CentralAuth MCP Server
A Model Context Protocol (MCP) server that helps AI tools integrate CentralAuth into applications using the public developer documentation and OpenID discovery endpoint.
Features
- Integration guidance for
Next.js,Express, generic OAuth 2.0 apps, React Native, and desktop apps - Callback URL, whitelist-domain, and PKCE guidance
- Public OpenID Connect discovery helper
- Starter
.envtemplates for app integrations - Starter framework code snippets
- Full ready-to-copy starter file bundles for
Next.jsandExpress - Project env writing support that can update
.env/.env.localfiles directly - Optional admin-mode organization creation and secret rotation
Requirements
- Node.js 18+
- No CentralAuth API key is required
Setup
npm install
npm run buildRun
npm run dev
# or
npm startProject auto-detection
When using write_project_env_file, the server can infer the app type from a target project path.
Examples:
Next.js→ prefers.env.localExpress/ generic Node apps → prefers.envReact Native/ Expo → uses.env
You can still override the app type explicitly if needed.
What this MCP server can do
This server is designed to help AI assistants do more than just explain OAuth concepts. It can help with the whole CentralAuth setup flow:
Understand your app
- explain how CentralAuth fits into
Next.js,Express,React Native, or a generic OAuth app - explain callback URLs, whitelist domains, and PKCE
- explain how CentralAuth fits into
Generate setup artifacts
- create starter env blocks
- generate code snippets
- generate multi-file starter bundles for
Next.jsandExpress
Update real projects
- write CentralAuth env variables into a target project's
.envor.env.local - auto-detect the project type when possible
- write CentralAuth env variables into a target project's
Optional admin automation
- create a new CentralAuth organization from a prompt
- rotate an existing organization secret
- immediately produce updated env values for the target app
Available tools
Docs-only tools
get_integration_checklistexplain_callback_setupvalidate_env_requirementsdraft_organization_from_promptgenerate_env_templategenerate_project_envwrite_project_env_filegenerate_integration_snippetgenerate_starter_filesget_openid_configuration
Optional admin-mode tools
These require CENTRALAUTH_API_KEY in the MCP server environment:
create_organization_from_promptrotate_organization_secret
Both admin tools can also update a target project's .env file automatically when you provide a targetProjectPath or targetEnvPath.
Example prompts
Docs-only examples
Use the CentralAuth MCP server to explain how to integrate CentralAuth into my Next.js app.Use the CentralAuth MCP server to generate starter files for an Express app at https://api.example.com.Draft a CentralAuth organization for "Acme Billing Portal" and show me the env variables for a Next.js app at https://billing.example.com.Write the CentralAuth env values for organization "Acme Private Portal" and detect the correct env file automatically.Admin-mode examples
Create a new CentralAuth organization from the prompt "Acme customer portal" under tenant `YOUR_TENANT_ID` and write the env values into /path/to/my-nextjs-app.Rotate the secret for organization `YOUR_ORG_ID` and update this project's env file.Example MCP config
Local workspace build
{
"mcpServers": {
"centralauth": {
"command": "node",
"args": ["/absolute/path/to/CentralAuth-MCP-Server/dist/index.js"]
}
}
}Installed via npx
{
"mcpServers": {
"centralauth": {
"command": "npx",
"args": ["-y", "centralauth-mcp-server"]
}
}
}