Skip to content
Support

Connect Hub to AI Clients via MCP

Configure the Formbricks Hub MCP server for AI clients and self-hosted Hub deployments.

The @formbricks/hub-mcp package lets MCP-capable AI clients work with Formbricks Hub through a local stdio MCP server. Point it at either a local Hub instance or a self-hosted production deployment, then ask your AI client to create, search, update, or summarize feedback records.

  • A running Hub API, such as http://localhost:8080 from the Quick Start or a deployed HTTPS URL.
  • The Hub API key configured as API_KEY on the Hub server.
  • Node.js and npx on the machine where your AI client starts MCP servers.
  • An AI client that supports local stdio MCP servers.

Add a stdio MCP server entry to your AI client’s MCP configuration:

{
"mcpServers": {
"formbricks-hub": {
"command": "npx",
"args": ["-y", "@formbricks/hub-mcp@latest"],
"env": {
"HUB_API_KEY": "your_hub_api_key",
"FORMBRICKS_HUB_BASE_URL": "https://hub.example.com"
}
}
}
}

For local Docker Compose from the Quick Start, use:

{
"mcpServers": {
"formbricks-hub-local": {
"command": "npx",
"args": ["-y", "@formbricks/hub-mcp@latest"],
"env": {
"HUB_API_KEY": "your_secure_api_key_here",
"FORMBRICKS_HUB_BASE_URL": "http://localhost:8080"
}
}
}
}

HUB_API_KEY is the key the MCP package sends to Hub. It should match the API_KEY value used by the Hub API.

FORMBRICKS_HUB_BASE_URL is the Hub API root URL reachable from the MCP server. Use the API root, not a /v1 URL. Examples:

Deployment styleBase URL
Local Docker Composehttp://localhost:8080
Dedicated domainhttps://hub.example.com
Reverse-proxy path prefixhttps://example.com/hub

After the MCP server is configured, you do not need to write API code yourself. Ask your AI client what you want to do in Hub, and the client can call the MCP tool with the generated Hub client behind the scenes.

Useful prompts:

  • “List the latest 10 feedback records for tenant org-123.”
  • “Create a test text feedback record for tenant org-123, then delete it.”
  • “Find feedback records for tenant org-123 and submission subm-001, then summarize the fields.”
  • “Summarize the latest feedback records for tenant org-123 by source type.”

For production deployments, set PUBLIC_BASE_URL on the Hub API process when Hub is exposed through ingress, TLS termination, a reverse proxy, or a path prefix:

Terminal window
PUBLIC_BASE_URL=https://hub.example.com

or:

Terminal window
PUBLIC_BASE_URL=https://example.com/hub

Hub uses PUBLIC_BASE_URL when serving runtime OpenAPI specs at:

  • GET /openapi.yaml
  • GET /openapi.json

Those endpoints are public by design, like GET /health. Keep /v1/* protected with Authorization: Bearer <API_KEY>.

Check that HUB_API_KEY in the MCP configuration exactly matches the Hub server’s API_KEY.

Make sure FORMBRICKS_HUB_BASE_URL is reachable from the machine running the AI client. For local Docker Compose on the same machine, http://localhost:8080 usually works. If the AI client runs inside another container, use the hostname that is reachable from that container.

If your client reports that network access to the Hub host is blocked, make sure the configured Hub URL is reachable from the MCP execution environment.

If your AI client returns json: unknown field "user_id", the Hub deployment is older than the current API contract. Deploy the latest Hub version and try again.

Set PUBLIC_BASE_URL on the Hub API deployment and restart the API. Use an absolute http or https URL without query strings, fragments, or credentials.

Pin the package in your MCP config:

"args": ["-y", "@formbricks/hub-mcp@1.2.3"]

To see which version npx will install, check the published package:

Terminal window
npm view @formbricks/hub-mcp version