Connect LLMs to the Fediverse
MCP server giving LLMs read, and opt-in write, access to the Fediverse - Mastodon, Misskey, Lemmy, PeerTube, and other ActivityPub servers.
3.2.1Add to Favorites
Why it matters
Enable Large Language Models to explore and interact with the Fediverse. This asset acts as a bridge, translating LLM commands into actions on ActivityPub-compatible platforms.
Outcomes
What it gets done
Discover and interact with Fediverse accounts and content.
Create and manage posts, replies, and social interactions.
Export Fediverse data into various formats like JSON, Markdown, or CSV.
Integrate with LLM interfaces like Claude Desktop for seamless interaction.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-activitypub-mcp | bash Capabilities
Tools your agent gets
Find and discover actors across the fediverse using WebFinger.
Discover fediverse instances and get detailed information about them.
Find and explore fediverse instances via live API.
Get recommendations for fediverse instances based on criteria.
Get posts from any user's timeline with pagination support.
Fetch complete conversation threads with replies.
Search for content across a specific fediverse instance.
Search for accounts across the fediverse.
Overview
ActivityPub MCP Server
An MCP server that lets an LLM read and, if enabled, post to the Fediverse - Mastodon, Misskey, Lemmy, PeerTube, and other ActivityPub-compatible servers. Read tools are on by default; write tools require an explicit opt-in environment flag. Use it when an LLM workflow needs to research or summarize Fediverse activity, or, once writes are enabled and the threat model is reviewed, to post and interact on behalf of an account.
What it does
An MCP server that gives an LLM a client for the Fediverse - the decentralized social web built on the ActivityPub protocol. It speaks plain ActivityPub (WebFinger to actor to outbox) well enough to read from any conformant server: Mastodon, Misskey, Foundkey, Pleroma and Akkoma, Lemmy (communities and users), PeerTube (channels and accounts), GoToSocial, and Pixelfed. Read tools are registered by default and cover the common research tasks - discovering an actor's profile, fetching a timeline, reading a post thread, pulling instance info, searching, and checking trending hashtags and posts. Write tools (posting, replying, boosting, following, and more) exist in the codebase but are not registered in a session unless explicitly enabled, so injected fediverse content encountered while reading cannot trigger account actions on its own.
When to use - and when NOT to
Use it when an LLM needs to research, summarize, or monitor activity on the Fediverse: profile lookups, timeline digests, notification triage, or topic curation across Mastodon-family and other ActivityPub servers. It is also suited to Fediverse automation once writes are deliberately enabled - scheduled threads, image posts with alt text, replying on behalf of an account - but that requires reading the threat model first, since the server ingests world-writable content such as posts, bios, and notifications that can carry prompt-injection payloads, and notifications in particular are an unsolicited channel anyone can trigger. Do not enable writes for an untrusted or high-stakes account without reviewing SECURITY.md's SSRF protections and credential handling, and do not expect the instance-API tools (search, trending, public timeline) or any write tool to work against a Lemmy or PeerTube instance - those require a Mastodon- or Misskey-API-compatible server specifically, unlike the plain-ActivityPub discovery tools which work broadly.
Capabilities
Public read tools need no account: discover-actor, fetch-timeline, get-post-thread, get-instance-info, get-public-timeline, get-trending-hashtags, get-trending-posts, search, discover-instances. Authenticated read tools need a logged-in account: list-accounts, switch-account, verify-account, get-home-timeline, get-notifications, get-bookmarks, get-favourites, get-relationship. Once the ACTIVITYPUB_ENABLE_WRITES flag is set, the full mutation set registers: post, reply, delete, boost, favourite, bookmark, follow, mute, block, vote, upload media, and scheduled posts. Authentication runs through a CLI login command that performs OAuth for Mastodon-family instances or MiAuth for Misskey, storing credentials locally with multi-account switching; alternatively, a single account can be configured directly via environment variables without the CLI flow. Beyond the default stdio transport, the server can run in HTTP mode behind a bearer-gated endpoint with a liveness check, and ships a Dockerfile and docker-compose.yml for self-hosting.
How to install
Requires Node.js 20+.
npx -y activitypub-mcp
One-click installers are available for Cursor and VS Code, and Claude Desktop can install it via a downloadable .mcpb bundle or by editing its config file to run the same npx command. To authenticate, run the CLI login flow: npx activitypub-mcp login mastodon.social.
Who it's for
Developers and researchers building Fediverse-aware LLM workflows - digesting timelines, monitoring mentions, curating topics - and, for those willing to review the security model, automating posting and engagement across Mastodon, Misskey, and the wider ActivityPub network. The project is licensed under MIT.
Source README
ActivityPub MCP Server
Fediverse Client for LLMs
A lightweight Model Context Protocol (MCP) server that lets an LLM explore and interact with the existing Fediverse - Mastodon, Misskey, Foundkey, Pleroma, and compatible servers. Read-only by default; write tools are opt-in.
Install
Requires Node.js 20+.
npx -y activitypub-mcp
One-click install:
Claude Desktop
One-click: download the .mcpb bundle (activitypub-mcp-<version>.mcpb) from the latest release and open it in Claude Desktop.
Manual: edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"activitypub": {
"command": "npx",
"args": ["-y", "activitypub-mcp"]
}
}
}
Restart Claude Desktop.
Cursor
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"activitypub": {
"command": "npx",
"args": ["-y", "activitypub-mcp"]
}
}
}
Restart Cursor.
Read-only by default
Out of the box, only read tools are registered: discover actors, fetch timelines, search, get threads, explore instances, read trending content. No write tools exist in the MCP session, so injected fediverse content cannot trigger account actions.
Public read tools (no account needed): discover-actor, fetch-timeline, get-post-thread, get-instance-info, get-public-timeline, get-trending-hashtags, get-trending-posts, search, discover-instances.
Authenticated read tools (account required): list-accounts, switch-account, verify-account, get-home-timeline, get-notifications, get-bookmarks, get-favourites, get-relationship.
Enabling writes
Set ACTIVITYPUB_ENABLE_WRITES=true in the environment or MCP config env block. This registers the full set of mutation tools: post, reply, delete, boost, favourite, bookmark, follow, mute, block, vote, upload media, and scheduled posts. Read the threat model before enabling.
{
"mcpServers": {
"activitypub": {
"command": "npx",
"args": ["-y", "activitypub-mcp"],
"env": {
"ACTIVITYPUB_ENABLE_WRITES": "true"
}
}
}
}
Authentication
Log in with the CLI:
npx activitypub-mcp login mastodon.social
This runs OAuth (Mastodon-family) or MiAuth (Misskey) in your browser and saves credentials to ~/.config/activitypub-mcp/accounts.json. Multi-account is supported - use switch-account to change the active account.
Alternatively, set ACTIVITYPUB_DEFAULT_INSTANCE and ACTIVITYPUB_DEFAULT_TOKEN env vars for a single account without the CLI flow.
Platform support
discover-actor and fetch-timeline speak plain ActivityPub (WebFinger → actor → outbox), so they read any conformant ActivityPub server - Mastodon, Misskey, Foundkey, Pleroma/Akkoma, Lemmy (communities and users), PeerTube (channels and accounts), GoToSocial, and Pixelfed.
The instance-API read tools (search, get-trending-hashtags, get-trending-posts, get-public-timeline) and every write tool require a Mastodon- or Misskey-API instance, since they call those platforms' REST APIs. Login uses OAuth (Mastodon-family) or MiAuth (Misskey).
Example
After adding the server to your MCP client, try:
"Look up @gargron@mastodon.social and summarize their latest posts."
The model will call discover-actor to fetch the profile, then fetch-timeline to read recent posts.
See examples/ for copy-pasteable recipes - Fediverse research digests, scheduled threads, notification triage, image posts with alt text, and topic curation.
HTTP transport
In addition to stdio (default), the server supports HTTP mode with a bearer-gated /mcp endpoint and /health liveness check. Set MCP_HTTP_SECRET (min 16 chars) to enable.
To self-host it as a service, the repo includes a Dockerfile and a docker-compose.yml (HTTP mode):
export MCP_HTTP_SECRET=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
docker compose up --build # then: curl http://localhost:8080/health
See the docs for full configuration.
Security
This server fetches world-writable fediverse content - posts, bios, notifications - and feeds it to the LLM. That content can contain prompt-injection payloads. Notifications are an unsolicited channel: anyone can mention your account. The <untrusted-content> envelope and read-only default reduce the risk surface, but do not eliminate it.
See SECURITY.md for the full threat model, SSRF protections, credential handling, and reporting instructions.
Documentation
The full tool reference, resource list, prompt catalog, environment variable guide, and deployment notes live on the docs site:
cameronrye.github.io/activitypub-mcp/docs/
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.