Mastodon MCP Server
Provides full access to the Mastodon REST API across user, admin, and moderation endpoints, including timelines, statuses, media uploads, streaming, and OAuth/token authentication.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mastodon-mcp
An MCP server for the whole Mastodon REST API: every documented user endpoint plus all admin and moderation endpoints. It runs on Cloudflare Workers or Docker/Node.
https://your-server/{instance_domain}/mcp e.g. https://mcp.example.com/mastodon.social/mcp
https://your-server/mcp (DEFAULT_INSTANCE)280 endpoints, generated from mastodon/documentation, plus undocumented routes found in Mastodon's source. Includes streaming (SSE) and media uploads.
Low token cost: 4 meta-tools (~1k tokens) instead of ~270 tools (~63k tokens). Responses are compacted by default (HTML→text, nested accounts shrunk, nulls dropped) and support
selectfield projection.Auth: OAuth (MCP clients log in through the browser), Bearer passthrough of a Mastodon token, server-side API keys, or a mix.
MCP 2026-07-28 (stateless) and legacy
initializeclients (2025-03-26 … 2025-11-25).
Quick start
Docker
cp .env.example .env # set SECRET_KEY (openssl rand -base64 32) and PUBLIC_URL
docker compose up --build -d # listens on 127.0.0.1:8787For OAuth from remote clients, put a TLS reverse proxy in front and set PUBLIC_URL (or TRUST_PROXY=true).
Cloudflare Workers
npm install
npx wrangler secret put SECRET_KEY
npx wrangler kv namespace create MCP_KV # optional; add the binding to wrangler.jsonc
npm run deployLocal
npm install && SECRET_KEY=dev npm run dev:node # Node
npm run dev # workerd (secrets in .dev.vars)Related MCP server: Discord Cloud MCP
Connecting a client
Add https://your-server/mastodon.social/mcp as a remote (Streamable HTTP) MCP server.
Auth mode | What the client does |
OAuth (needs | Nothing special. The client gets a 401, discovers |
Bearer |
|
API key |
|
Mixed | API key or OAuth token in |
Anonymous |
|
Admin endpoints need admin:read/admin:write scopes (on by default in APP_SCOPES) and a staff role on the account.
Tools
Tool | Purpose |
| Find endpoints by keyword ( |
| Params, scopes, return entity, version, raw docs URL. |
|
|
| Current account, auth mode, scopes, server version. |
Example:
{"id":"statuses.create","args":{"status":"Hello","poll":{"options":["a","b"],"expires_in":3600}},"idempotency_key":"…"}
{"id":"timelines.home","args":{"limit":20},"select":["id","account.acct","content"]}
{"id":"media.v2","args":{"file":{"url":"https://…/cat.jpg"},"description":"A cat"}}
{"id":"admin.accounts.action","args":{"id":"123","type":"silence","text":"spam"}}To get one tool per endpoint, add ?expose=statuses,timelines (or ?expose=all) to the MCP URL.
Resources: mastodon://guide, mastodon://docs (raw doc URLs), mastodon://catalog[/{group}], mastodon://endpoint/{id}.
Prompts: catch_up, moderation_queue, compose_post.
Machine-readable docs
URL | Content |
| Agent guide + raw docs index |
| Full endpoint catalog (method, path, params, scopes, docs links) |
| Mastodon method docs |
| Entity docs |
Configuration
All settings are environment variables (Worker vars/secrets or .env).
Variable | Default | Description |
| — | Enables OAuth; seals tokens. Rotating it invalidates all issued tokens. |
| from request | Public origin, used for OAuth redirects and metadata |
|
| Use |
| — | Instance served at |
| any public | Comma-separated allowlist |
|
|
|
|
| Accept raw Mastodon tokens ( |
|
| Requested when the client doesn't specify scopes |
|
| Upper bound for scopes; the app is registered with these |
|
| Access token lifetime (refresh tokens don't expire) |
|
| Reply HTTP 403 |
| — | Comma-separated static keys |
| — | Server-side tokens for API-key users ( |
| auto-register | Pre-registered apps |
|
| Block mutating calls |
|
| Hide and block admin endpoints |
| same-origin | Browser origins allowed to call |
|
| Truncation limit per tool result |
|
| Mastodon request timeout |
|
| Media upload limit |
| — / | Local development against e.g. |
|
| Node/Docker only. |
|
| Upstream User-Agent |
Security notes
The server stores no user data. Tokens are AES-GCM sealed and bound to one instance. The store holds only caches (registered apps, instance metadata).
Instance domains must be public DNS names (SSRF guard). Redirects from Mastodon are never followed, so tokens can't leak.
Every new OAuth connection goes through a consent page naming the client and its redirect host.
Development
See AGENTS.md. Short version: npm run check before committing. When Mastodon changes, run npm run catalog and npm run check-routes.
License: AGPL-3.0-or-later.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Mastodon MCP — public Mastodon data via mastodon.social (no auth required)
Discover MCP servers and A2A agents; verify, message, post, follow, react, and receive webhooks.
Zero-dependency Cloudflare Worker gateway turning websites and REST APIs into MCP tools.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server implementation that runs on Cloudflare Workers with OAuth authentication support, allowing users to connect MCP clients like Claude Desktop or the MCP Inspector to utilize remote AI tools.-
- AlicenseNot gradedqualityDmaintenanceProvides full Discord API access via the Model Context Protocol, allowing users to manage servers, messages, channels, and webhooks through MCP clients. It is specifically designed for deployment on Cloudflare Workers to facilitate remote bot control.6Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables clients to discover capabilities and compose tool calls with structured responses through a remote MCP endpoint running on Cloudflare Workers.MIT
- AlicenseBqualityBmaintenanceEnables MCP clients such as Claude and Cursor to read timelines, search statuses, and look up users or conversations, plus optionally post, delete, favorite, and follow with explicit confirmation. It supports both local stdio launches and remote HTTP hosting with per-user authorization.15MIT