HasData Facebook — Claude Code MCP server: how to install
A hosted MCP server that retrieves public Facebook page info, metrics, and post feeds as JSON. Useful for extracting engagement stats without a Meta developer account.
claude mcp add facebook -e HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/facebook-mcpWhat HasData Facebook does
The server exposes hasdata_facebook_profile_getFacebookProfile to query public pages or profiles via handle, @username, or numeric ID. It responds with category details, bio text, contact information, and total likes. Private accounts and closed groups remain inaccessible.
Clients connect directly to the remote HTTP endpoint or run a local stdio runner via @hasdata/facebook-mcp. The initial request outputs the page record, the newest entry, and photo thumbnails. To inspect older entries, pass nextPageToken from the response to fetch three posts per call.
A HasData API key is mandatory. The service supplies 1000 monthly credits at no cost without credit card registration, which covers 100 profile requests at 10 credits each.
What it helps with
- pull like counts and contact details from public Facebook pages
- fetch engagement metrics including shares and reactions on brand posts
- paginate through past posts using nextPageToken cursors
- inspect verified status and categories for competitor profiles
Example prompts for the agent
- Check the exact follower count and contact info on the @nike Facebook page.
- Fetch recent posts and reaction counts for this Facebook brand profile.
- Retrieve the next batch of posts using this nextPageToken.
How to install HasData Facebook
1Platform CLI
claude mcp add facebook -e HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/facebook-mcpReplace <…> with your own values
2Platform CLI: remote server
claude mcp add --transport http hasdata-facebook 'https://mcp.hasdata.com/mcp?apis=facebook'1Platform CLI: remote server
codex mcp add hasdata-facebook --url 'https://mcp.hasdata.com/mcp?apis=facebook'2Platform CLI
codex mcp add hasdata-facebook --env HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/facebook-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"hasdata-facebook": {
"url": "https://mcp.hasdata.com/mcp?apis=facebook"
}
}
}{
"mcpServers": {
"hasdata-facebook": {
"command": "npx",
"args": [
"-y",
"@hasdata/facebook-mcp"
],
"env": {
"HASDATA_API_KEY": "<HASDATA_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"hasdata-facebook": {
"type": "http",
"url": "https://mcp.hasdata.com/mcp?apis=facebook"
}
}
}{
"servers": {
"hasdata-facebook": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@hasdata/facebook-mcp"
],
"env": {
"HASDATA_API_KEY": "<HASDATA_API_KEY>"
}
}
}
}Replace <…> with your own values
1Platform CLI: remote server
gemini mcp add -t http hasdata-facebook 'https://mcp.hasdata.com/mcp?apis=facebook'2Platform CLI
gemini mcp add -e HASDATA_API_KEY=<HASDATA_API_KEY> hasdata-facebook npx -y @hasdata/facebook-mcpReplace <…> 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 HasData Facebook
How do I install HasData Facebook in Claude Code?
Run claude mcp add facebook -e HASDATA_API_KEY=<HASDATA_API_KEY> -- npx -y @hasdata/facebook-mcp, replacing the placeholder with your HasData key.
What does the HasData Facebook tool return?
It returns structured JSON containing page metadata, contact details, like counts, and post statistics such as shares, comments, and reactions.
Can this server fetch posts from private Facebook groups?
No. It only reads public profiles and pages that any logged-out visitor can see.