← Back to API Documentation

MCP Server

The Fanpage Karma MCP (Model Context Protocol) Server lets AI agents like Claude, ChatGPT, and automation platforms like n8n access your social media analytics data directly through the 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. Get your API token from Settings → API.
2. Configure the server URL in your AI client (see setup guides below).
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

Authentication via Authorization: Bearer YOUR_TOKEN header.

Getting Your API Token

1. Log in to Fanpage Karma.
2. Go to Settings → API.
3. Copy your API token.

The token is used for authentication with all setup methods below.

Setup: Claude Desktop

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
"mcpServers": {
"fanpagekarma": {
"url": "https://app.fanpagekarma.com/api/v2/mcp",
"headers": {
"Authorization": "Bearer your-api-token-here"
}
}
}
}

Restart Claude Desktop after saving the file.

Setup: Claude Code

Run the following command in your terminal:

claude mcp add --transport http fanpagekarma https://app.fanpagekarma.com/api/v2/mcp \
--header "Authorization: Bearer your-api-token-here"

Or add to your project's .mcp.json:

{
"mcpServers": {
"fanpagekarma": {
"type": "http",
"url": "https://app.fanpagekarma.com/api/v2/mcp",
"headers": {
"Authorization": "Bearer your-api-token-here"
}
}
}
}

Setup: n8n

Use the MCP Client Tool node with the hosted service:

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 (recommended):
https://app.fanpagekarma.com/api/v2/mcp

SSE (legacy):
https://app.fanpagekarma.com/api/v2/mcp/sse

Other Clients

Any MCP-compatible client (Cursor, Windsurf, ChatGPT, custom integrations, etc.) can connect using the HTTP endpoints below.

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer your-api-token-here

Endpoints

Method Endpoint Description
POST /api/v2/mcp Send messages (Streamable HTTP)
GET /api/v2/mcp SSE stream (requires mcp-session-id header)
DELETE /api/v2/mcp Close session
GET /api/v2/mcp/sse Establish SSE connection (legacy)
POST /api/v2/mcp/messages Send messages via SSE (legacy)

Most clients support Streamable HTTP. Use the SSE endpoints only if your client requires the legacy SSE transport.

Available Tools

The MCP server exposes seven tools that map to the API v2 endpoints:

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_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, metrics
get_profile_posts Get posts with engagement metrics networkrequired, profile_idrequired, from, to, limit, offset
get_profile_stories Get Instagram Stories data profile_idrequired, from, to, limit, offset
get_profile_daily Get daily time series for specific metrics networkrequired, profile_idrequired, metricsrequired, from, to

Date parameters use YYYY-MM-DD format. If omitted, the last 28 days are used.
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:

  • facebook
  • instagram
  • youtube
  • linkedin
  • tiktok
  • threads
  • bluesky
  • pinterest

The get_profile_stories tool is only available for Instagram.

Usage Examples

Once configured, you can ask your AI assistant questions like:

Profile Discovery

“List all my social media profiles.”

Metrics Analysis

“Show me the metrics for my Instagram account @example from 2024-01-01 to 2024-01-31.”

Post Performance

“Get the top performing posts from my Facebook page this month.”

Cross-Network Comparison

“Compare engagement rates across all my profiles.”

Time Series Trends

“Show me the daily follower trend for my X profile over the last 30 days.”

Instagram Stories

“Show me my Instagram Stories performance from last week.”