MCP Server
The Fanpage Karma MCP (Model Context Protocol) Server lets AI assistants and automation platforms access your social media analytics data directly through the Data API v2.
MCP is an open standard that enables AI assistants to use external tools. Instead of copying data manually, you can ask your AI assistant to fetch metrics, posts, and time series data from your Fanpage Karma account in natural language.
How It Works
1. Add the server URL as a connector in your AI assistant (see setup guides below).
2. Sign in with your Fanpage Karma account when the assistant asks for it. Only automation tools such as n8n use an API token instead.
3. Ask questions in natural language — the assistant calls the right tool and returns the data.
Server URL
https://app.fanpagekarma.com/api/v2/mcp
Works with all MCP clients that support Streamable HTTP.
Prerequisites & Pricing
The MCP Server uses the Fanpage Karma Data API v2. To use it, you need an active API subscription (included in the Professional plan).
API usage is billed per profile queried
Each profile you query via the MCP Server counts towards your API usage and is billed per profile per month (not per request). Once a profile is queried in a billing period, all further requests for that profile are included at no extra cost.
See API Documentation → Prerequisites & Pricing for full pricing details, including Basic and Enterprise plans.
Use the list_queried_profiles tool to check which profiles have been queried in the current billing period.
See Settings → API for your current usage.
Authentication
The MCP Server supports two authentication methods. Choose the one that fits your client:
Sign in with Fanpage Karma (OAuth 2.1) — recommended
For AI assistants such as Claude (web, desktop and mobile), Claude Code, ChatGPT and Cursor. No API token is needed — you add the server URL as a connector and sign in to your Fanpage Karma account once.
The client handles the OAuth flow automatically (dynamic client registration, PKCE, token refresh). See Sign-in Flow (OAuth) for details.
API Token (Bearer)
For automation platforms and scripts that cannot open a browser window, such as n8n. You configure your API token in the client.
Getting Your API Token
1. Log in to Fanpage Karma.
2. Go to Settings → API.
3. Copy your API token.
The token is sent as Authorization: Bearer YOUR_TOKEN header with every request.
Treat it like a password: anyone with the token can query data on your account's API subscription.
Compatibility
The MCP Server works with any client that supports the MCP standard. Depending on the client, you sign in with your Fanpage Karma account (OAuth 2.1) or use an API token.
| Client | Auth Method | Notes |
|---|---|---|
| Claude (claude.ai, Desktop, mobile) | OAuth 2.1 | Add as custom connector in Customize → Connectors; available in all Claude apps |
| Claude Code (CLI) | OAuth 2.1 or API token | Via claude mcp add, then sign in with /mcp |
| ChatGPT | OAuth 2.1 | Add as custom MCP server in Settings → Plugins |
| Cursor / Windsurf | OAuth 2.1 or API token | Remote MCP server with the server URL |
| n8n | API token | MCP Client Tool node |
| Scripts and other automation | API token | Authorization: Bearer header |
| Other MCP clients | OAuth 2.1 | Any MCP client supporting OAuth 2.1 with PKCE |
Setup: Claude (claude.ai, Desktop, mobile)
Add Fanpage Karma once as a custom connector; it is then available in claude.ai, the Claude Desktop app and the mobile apps.
Step 1: Add the Connector
In claude.ai or the Claude Desktop app, open
Customize → Connectors, click Add custom connector,
enter the name Fanpage Karma and the server URL:
https://app.fanpagekarma.com/api/v2/mcp
Step 2: Connect and Sign In
Click Connect. Claude opens the Fanpage Karma login page; sign in and click Authorize on the consent screen.
Step 3: Ask
In a chat, make sure the Fanpage Karma connector is enabled (tools menu below the input field) and ask your question, for example "How did my Instagram account perform last month?"
On Team and Enterprise plans, an owner adds the connector once in Organization settings → Connectors;
members then connect it under Customize → Connectors and sign in with their own Fanpage Karma account.
API tokens in claude_desktop_config.json are no longer needed.
Setup: Claude Code
Add the server in your terminal:
claude mcp add --transport http fanpagekarma https://app.fanpagekarma.com/api/v2/mcp
Then start Claude Code, run /mcp, select fanpagekarma and choose
Authenticate. Your browser opens the Fanpage Karma login page; after you authorize, the tools are available.
For headless use (CI, servers without a browser) you can pass your API token instead:
claude mcp add --transport http fanpagekarma https://app.fanpagekarma.com/api/v2/mcp \
--header "Authorization: Bearer your-api-token-here"
Setup: ChatGPT
ChatGPT connects to MCP servers as custom MCP servers (plugins). Availability depends on your ChatGPT plan. In a ChatGPT Business workspace, only an admin or owner can create and publish the connection; members ask them to set it up and then connect with their own Fanpage Karma account. On Enterprise and Edu, the workspace's app permissions decide who may add it.
Step 1: Add the Server
In ChatGPT, open Settings → Plugins, choose Add → custom MCP server,
enter a name (e.g. fanpagekarma), select Streamable HTTP and enter the server URL:
https://app.fanpagekarma.com/api/v2/mcp
Leave the bearer token and header fields empty and save.
Step 2: Sign In
ChatGPT opens the Fanpage Karma login page; sign in and click Authorize. Then ask your question in a chat.
Setup: n8n
Use the MCP Client Tool node with the hosted service. n8n runs without a browser, so it uses your API token:
Step 1: Add Node
Add an MCP Client Tool node to your workflow.
Step 2: Configure Authentication
Authentication: Bearer Token
Token: Your Fanpage Karma API token
Step 3: Set Endpoint
Streamable HTTP:
https://app.fanpagekarma.com/api/v2/mcp
Sign-in Flow (OAuth)
Clients that support OAuth 2.1 connect without a static API token. You authorize access by logging in to your Fanpage Karma account — no token copy-paste needed.
The general setup for any OAuth-capable MCP client:
Step 1: Add the MCP Server
In your client's settings, add a new MCP server / connector and enter the server URL:
https://app.fanpagekarma.com/api/v2/mcp
Step 2: Authorize
The client will redirect you to the Fanpage Karma login page. After logging in, you will see a consent screen showing the permissions being requested. Click Authorize to grant access.
Step 3: Start Using
Once authorized, you can use all Fanpage Karma tools directly in your conversations. Ask questions in natural language just like with any other MCP setup.
Client-specific steps: Claude, Claude Code, ChatGPT.
How It Works Under the Hood
The OAuth 2.1 flow is handled automatically by your client (dynamic client registration, PKCE, token refresh). Your access is tied to your Fanpage Karma account and to the user who authorized it, and requires an active API subscription. Access tokens are valid for one hour and never contain your API token; the client renews them in the background. You can revoke access at any time by removing the server from your client settings.
Reconnecting & Limits
The assistant asks you to sign in again
Connections created before November 2026 use an older token format that the server no longer accepts. If your assistant reports that the Fanpage Karma connection expired or asks you to reconnect, disconnect the connector in your client settings and connect it again (in Claude: Customize → Connectors → Fanpage Karma → Disconnect, then Connect). You only need to do this once.
Disconnecting an app
Account admins see every app that is connected to the account under Settings → API → Connected apps, with who connected it, since when and when it was last active. The trash icon disconnects an app; it loses access immediately and has to be connected again. You can also disconnect from within the assistant.
Creating a new API token
Account admins can create a new API token under Settings → API. The previous token stops working immediately: Data Studio, n8n and your own scripts need the new token, and all connected apps are disconnected and have to be connected again once.
Account errors
If a tool call reports that your plan does not include API access, that your API usage limit is reached or that your account is under review, the assistant cannot fix it by retrying. Check your plan and usage in Settings → API.
Privacy
How Fanpage Karma handles data when you connect an AI assistant is described in the section Connecting AI assistants (MCP server) of our privacy policy.
Limits
- Every tool call must be answered within 50 seconds. If Fanpage Karma first has to load a profile and period, the server waits up to about 40 seconds for it. Long or older periods can take several minutes; then the assistant gets no numbers for that period and is told to ask you to try again later. The loading continues in the background, so a later attempt finds the data ready.
- Post and story lists hold at most 1000 items per call, the newest first. If a period has more, the assistant asks again for the older ones; each call is one request against the hourly limit.
- Fanpage Karma loads at most 10 profiles or periods per account at the same time. If the assistant asks for more at once, it is told to wait briefly and query the rest one after another.
- If a profile handle is not found, the assistant is told to ask you for the profile link instead of guessing other spellings.
get_profile_postsandget_profile_storiesaccept at most 366 days per call. For longer periods the assistant queries one year at a time and combines the results.- Requesting only the metrics you need keeps answers small and fast.
Other Clients
Any MCP-compatible client (Cursor, Windsurf, ChatGPT, custom integrations, etc.) can connect using the HTTP endpoints below. See Authentication for how to authenticate.
Bearer Token Header
For clients using Bearer Token authentication, include the token in every request:
Authorization: Bearer your-api-token-here
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v2/mcp |
Send messages (Streamable HTTP) |
The server is stateless: no session to open or close, and every request carries the token.
Available Tools
The MCP server exposes nine tools that map to the API v2 endpoints. All of them only read: no tool publishes, replies, deletes or changes anything in your account or on a network.
| Tool | Description | Parameters |
|---|---|---|
list_connected_profiles |
List your connected social media profiles with extended analytics | — |
list_queried_profiles |
List profiles queried via API in current billing period | — |
list_dashboards |
List the account's Analytics dashboards with id, name and number of profiles, 200 per call | offset (optional, for the next 200) |
list_dashboard_profiles |
List all profiles in the account's Analytics dashboards, with the dashboards they belong to, 200 per call | dashboard_id (optional, only the profiles of this dashboard), offset (optional, for the next 200), include_pictures (optional, adds profile picture URLs) |
list_available_metrics |
List available metric keys, labels and types for a network and endpoint |
networkrequired,
endpointrequired
|
get_profile_metrics |
Get profile-level metrics (followers, engagement, reach, etc.) |
networkrequired,
profile_idrequired,
from, to, period, metrics
|
get_profile_posts |
Get posts with engagement metrics |
networkrequired,
profile_idrequired,
from, to, period, limit, offset, metrics, include_images
|
get_profile_stories |
Get Instagram Stories data |
profile_idrequired,
from, to, period, limit, offset, metrics, include_images
|
get_profile_daily |
Get daily time series for specific metrics |
networkrequired,
profile_idrequired,
metricsrequired,
from, to, period
|
Date parameters use YYYY-MM-DD format. If omitted, the last 28 days are used.
Instead of from and to, period names a period: last_7_days, last_28_days, last_90_days, this_month, this_quarter, this_year, last_month, last_quarter, last_year. Use either period or from/to, not both.
Use list_available_metrics or GET /api/v2/{network}/{endpoint}/metrics to discover available metric keys.
The get_profile_daily tool uses the /profile/daily endpoint path.
Supported Networks
The following networks are available for all profile tools:
- youtube
- tiktok
- threads
- bluesky
The get_profile_stories tool is only available for Instagram.
Usage Examples
Once configured, you can ask your AI assistant questions like the ones below. The first three use a public demo profile that does not count towards your API usage, so you can try them right away.
Monthly Review
“How did Barack Obama's Facebook page do last month? Give me followers, follower growth, number of posts and engagement.”
Post Performance
“Show me the five posts with the most interactions on Barack Obama's Facebook page in the last 90 days, and say what they have in common.”
Time Series Trends
“Plot the daily follower count of Barack Obama's Facebook page for the last 28 days and point out any unusual days.”
Your Connected Profiles
“Which of my connected profiles grew fastest last quarter? Compare follower growth and engagement across all of them.”
Dashboards
“Take the profiles in my dashboard "Competitors" and rank them by engagement for this month.”
Competitor Comparison
“Compare the TikTok accounts of Nike and Adidas over the last 90 days: follower growth, posts per week and average interactions per post.”
Instagram Stories
“Show me my Instagram Stories performance from last week.”