Skip to main content
Glama
ActivityPub MCP Server

ActivityPub MCP Server


Install

Requires Node.js 20+.

npx -y activitypub-mcp

One-click install:

Add to Cursor Install in VS Code

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.


Related MCP server: Claude-LMStudio Bridge

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/


License

MIT — see LICENSE.

Acknowledgments

Built on the Model Context Protocol by Anthropic, and interacts with the decentralized social web as specified by ActivityPub (W3C) and ActivityStreams.

Available Tools

18 tools
discover-actorDiscover Fediverse ActorA
Read-only

Find and retrieve the profile of any fediverse user or account (called an 'actor' in ActivityPub). Returns display name, bio, follower/following URLs, and inbox/outbox endpoints. Pass a handle like '@alice@mastodon.social' or 'alice@mastodon.social'.

Inputs: identifier (required). Returns: actor

discover-instancesDiscover Fediverse InstancesA
Read-only

Discover fediverse instances in real-time using the instances.social API with advanced filtering

Inputs: software, language, minUsers, maxUsers, +4 more. Returns: instances, hasMore

fetch-timelineFetch Actor TimelineA
Read-only

Fetch recent posts (the outbox) from any fediverse actor — a user or account — with cursor- and ID-based pagination. Pass a handle like 'alice@mastodon.social'.

Inputs: identifier (required), limit, cursor, minId, +2 more. Returns: posts, nextCursor, hasMore, source

get-bookmarksGet BookmarksB
Read-only

Get your bookmarked posts

Inputs: limit, accountId. Returns: posts, nextCursor, hasMore, source

get-favouritesGet FavouritesA
Read-only

Get posts you have favourited

Inputs: limit, accountId. Returns: posts, nextCursor, hasMore, source

get-home-timelineGet Home TimelineA
Read-only

Get your personalized home timeline (posts from accounts you follow)

Inputs: limit, maxId, sinceId, accountId. Returns: posts, nextCursor, hasMore, source

get-instance-infoGet Instance InformationA
Read-only

Get detailed information about a fediverse instance: software and version, description, registration policy, supported languages, user/post/domain counts, and contact account.

Inputs: domain (required). Returns: domain, title, description, version, +3 more

get-notificationsGet NotificationsC
Read-only

Get your notifications (mentions, follows, boosts, favourites)

Inputs: limit, types, accountId. Returns: notifications

get-post-threadGet Post ThreadA
Read-only

Fetch a post and its full conversation thread including replies and parent posts

Inputs: postUrl (required), depth, maxReplies. Returns: ancestors, post, replies

get-public-timelineGet Public TimelineA
Read-only

Fetch an instance's public timeline. scope 'federated' (default) shows posts the instance has seen from across the fediverse; 'local' shows only posts authored on that instance.

Inputs: domain (required), scope, limit, maxId. Returns: posts, nextCursor, hasMore, source

get-relationshipGet RelationshipA
Read-only

Check your relationship status with another account (following, followed by, blocking, muting, etc.). Pass a single acct like 'username@instance'. To check multiple accounts, call this tool once per account.

Inputs: acct (required), accountId, accountIds. Returns: acct, following, followedBy, blocking, +2 more

get-scheduled-postsGet Scheduled PostsA
Read-only

List your scheduled posts that haven't been published yet

Inputs: limit, accountId. Returns: scheduledPosts

list-accountsList Configured AccountsA
Read-only

List all configured authenticated accounts for write operations

Inputs: no named parameters. Returns: accounts, writeEnabled, activeAccountId

switch-accountSwitch Active AccountA

Switch the active account used for write operations

Inputs: accountId (required). Returns: accountId, username, instance, active, +1 more

verify-accountVerify Account CredentialsB
Read-only

Verify that the account credentials are valid and get account information

Inputs: accountId. Returns: accountId, username, instance, active, +1 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools are clearly scoped by resource type such as actor, instance, timeline, or account, and timeline tools are distinguished by source (actor outbox, instance public, home). A few potential overlaps exist, such as discover-actor vs. search and discover-instances vs. get-instance-info, but the descriptions provide enough context for an agent to choose correctly.

    Naming Consistency4/5

    Tool names follow a consistent lowercase hyphenated verb-noun pattern like discover-actor, fetch-timeline, and get-notifications. The main deviation is the bare verb 'search', and the mix of get/fetch/discover/list verbs is mild rather than chaotic.

    Tool Count3/5

    At 18 tools, the server sits in the heavy range for a typical MCP server. While most tools have distinct uses, several read-only endpoints such as trending hashtags vs. trending posts and bookmarks vs. favourites could potentially be consolidated without losing clarity.

    Completeness2/5

    The server covers a broad read surface—profiles, timelines, threads, trends, notifications, and relationships—but lacks any mutation tools for core ActivityPub interactions like posting, replying, boosting, favouriting, or following. This is a significant gap, especially since list-accounts and switch-account are explicitly described as being for write operations yet no write operation exists.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that provides tools for interacting with Mastodon, enabling users to create toots with customizable visibility and attach media files with descriptions.
      4
      8
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A customizable Model Context Protocol server built with mcp-framework that enables Claude to access external tools and capabilities through a standardized interface.
      55 npm
      -
    • A
      license
      B
      quality
      D
      maintenance
      A personal MCP server for AI assistant integration that provides custom tools, resources, and prompts for use with Claude Desktop and other MCP-compatible clients.
      2
      MIT