activitypub-mcp — Claude Code MCP server: what it does, how to install
Connect LLMs to the Fediverse. It lets assistants inspect Mastodon, Misskey, and ActivityPub actors in read-only mode or publish posts.
claude mcp add --env ACTIVITYPUB_ENABLE_WRITES=<ACTIVITYPUB_ENABLE_WRITES> --env LOG_LEVEL=<LOG_LEVEL> --transport stdio activitypub-mcp -- npx -y activitypub-mcpWhat activitypub-mcp does
The server bridges language models with federated social platforms. By default, it operates in read-only mode. The model can inspect actors, fetch outboxes, and review trending topics without risking unwanted mutations from untrusted posts.
Actor lookups rely on standard ActivityPub endpoints, so instances like Lemmy or PeerTube work immediately. Search tools and trending lists require Mastodon or Misskey REST APIs. Mutations stay blocked until you set ACTIVITYPUB_ENABLE_WRITES=true.
The package requires Node.js 20 or higher. Running authentication stores credentials locally in ~/.config/activitypub-mcp/accounts.json, supporting OAuth and MiAuth flows.
What it helps with
- Inspect profiles and retrieve outbox posts across ActivityPub servers
- Check trending hashtags and public posts on Mastodon or Misskey
- Publish notes, replies, and reactions after enabling write tools
- Manage notifications and bookmarks directly from the model session
Example prompts for the agent
- Show trending posts and hashtags from mastodon.social.
- Fetch recent notifications for my authenticated account.
How to install activitypub-mcp
Platform CLI
claude mcp add --env ACTIVITYPUB_ENABLE_WRITES=<ACTIVITYPUB_ENABLE_WRITES> --env LOG_LEVEL=<LOG_LEVEL> --transport stdio activitypub-mcp -- npx -y activitypub-mcpReplace <…> with your own values
Platform CLI
codex mcp add activitypub-mcp --env ACTIVITYPUB_ENABLE_WRITES=<ACTIVITYPUB_ENABLE_WRITES> --env LOG_LEVEL=<LOG_LEVEL> -- npx -y activitypub-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"activitypub-mcp": {
"command": "npx",
"args": [
"-y",
"activitypub-mcp"
],
"env": {
"ACTIVITYPUB_ENABLE_WRITES": "<ACTIVITYPUB_ENABLE_WRITES>",
"LOG_LEVEL": "<LOG_LEVEL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"activitypub-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"activitypub-mcp"
],
"env": {
"ACTIVITYPUB_ENABLE_WRITES": "<ACTIVITYPUB_ENABLE_WRITES>",
"LOG_LEVEL": "<LOG_LEVEL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e ACTIVITYPUB_ENABLE_WRITES=<ACTIVITYPUB_ENABLE_WRITES> -e LOG_LEVEL=<LOG_LEVEL> activitypub-mcp npx -y activitypub-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 activitypub-mcp
How do I install activitypub-mcp in Claude Code?
Run claude mcp add activitypub-mcp -- npx -y activitypub-mcp in your terminal. You must have Node.js 20 or newer installed.
What does activitypub-mcp do?
It exposes tools for assistants to query Fediverse actors, read posts, and fetch server trends. It also supports posting and managing reactions when write mode is active.
Why are write tools turned off out of the box?
Disabling mutations prevents Fediverse content from tricking the agent into modifying your account. You must pass ACTIVITYPUB_ENABLE_WRITES=true to enable posting.