mastodon-mcp-server
This server lets AI assistants and MCP clients interact with a Mastodon instance through MCP tools — reading timelines, posting and managing statuses, managing accounts, notifications, search, trending, lists, media, polls, and follow requests.
Instance & accounts: fetch instance info, verify/search/get accounts, view profiles and social graphs, follow/unfollow, block/unblock, mute/unmute, check relationships, and update your own profile.
Timelines: read home, local, public, and hashtag timelines.
Statuses: post new toots (with content warnings, visibility, media, replies), delete your own statuses, favourite/unfavourite, reblog/unreblog, bookmark/unbookmark, and see who favourited or boosted a status.
Notifications: list notifications, dismiss individual ones, or clear all.
Search & discovery: search accounts/statuses/hashtags, get trending tags/statuses/links, and browse the instance directory.
Collections: view your favourites, bookmarks, mutes, and blocks.
Lists: create/delete lists and add/remove accounts.
Polls: vote in polls.
Follow requests: view, approve, or reject pending follow requests.
Media: upload image/video/audio attachments with optional alt text.
Safety modes: supports read-only mode (write operations disabled by default) and works over stdio or HTTP transports.
Provides tools for interacting with Mastodon instances, enabling AI assistants to read timelines, post and manage statuses, follow/unfollow accounts, search, and handle notifications, lists, polls, and media.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mastodon-mcp-server show me my home timeline"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mastodon-mcp-server
A comprehensive MCP (Model Context Protocol) server for Mastodon integration. Enables AI assistants and other MCP clients to interact with Mastodon instances — read timelines, post statuses, manage accounts, search, and more.
Features
Timelines: home, local, public, hashtag
Statuses: post, delete, favourite, reblog, bookmark
Accounts: follow, unfollow, block, mute, relationships, profile update
Notifications: read, dismiss individual or all
Search: accounts, statuses, hashtags
Trending: tags, statuses, links
Lists: create, delete, manage members
Media: upload attachments
Polls: vote
Read-only mode: safe browsing without write access
STDIO and HTTP transports: works with any MCP-compatible client
Related MCP server: X(Twitter) V2 MCP Server
Installation
Debian 13+ / Ubuntu 24+
apt install mastodon-mcp-serverpip
pip install mastodon-mcp-serverFrom source
git clone https://github.com/VitexSoftware/mastodon-mcp-server.git
cd mastodon-mcp-server
pip install -e .Configuration
Copy .env.example to .env and fill in your credentials:
cp .env.example .envVariable | Required | Default | Description |
| yes | — | Mastodon instance URL (e.g. |
| yes | — | OAuth access token |
| no |
| Disable all write operations |
| no |
| Transport: |
| no |
| HTTP transport bind address |
| no |
| HTTP transport port |
| no |
| Disable HTTP session state |
| no |
| Enable verbose logging |
Getting an Access Token
Go to your Mastodon instance → Preferences → Development → New application
Grant required scopes:
read,write,followCopy the Your access token value
Client Setup
Claude Code (CLI)
claude mcp add --scope user mastodon /usr/bin/mastodon-mcp \
-e MASTODON_INSTANCE=mastodon.social \
-e MASTODON_ACCESS_TOKEN=your-token-hereClaude Desktop
~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"mastodon": {
"command": "mastodon-mcp",
"env": {
"MASTODON_INSTANCE": "https://mastodon.social",
"MASTODON_ACCESS_TOKEN": "your-token-here"
}
}
}
}Warp Terminal
~/.warp/mcp_config.json:
{
"mcpServers": {
"mastodon": {
"command": "/usr/bin/mastodon-mcp",
"args": [],
"env": {
"MASTODON_INSTANCE": "https://mastodon.social",
"MASTODON_ACCESS_TOKEN": "your-token-here"
}
}
}
}VSCode (GitHub Copilot / Continue)
~/.config/Code/User/mcp.json:
{
"servers": {
"MastodonMCP": {
"type": "stdio",
"command": "/usr/bin/mastodon-mcp",
"args": [],
"env": {
"MASTODON_INSTANCE": "https://mastodon.social",
"MASTODON_ACCESS_TOKEN": "your-token-here"
}
}
}
}HTTP transport (any MCP client)
MASTODON_MCP_TRANSPORT=streamable-http mastodon-mcpUsage
usage: mastodon-mcp [-h] [--version]
Model Context Protocol server for Mastodon integration.
options:
-h, --help show this help message and exit
--version show program's version number and exit
Environment variables:
MASTODON_INSTANCE Mastodon instance URL (required)
MASTODON_ACCESS_TOKEN OAuth access token (required)
MASTODON_MCP_TRANSPORT Transport mode: stdio (default) or streamable-http
MASTODON_MCP_HOST HTTP bind address (default: 127.0.0.1)
MASTODON_MCP_PORT HTTP port (default: 8000)
MASTODON_MCP_STATELESS_HTTP Disable HTTP session state (default: false)
READ_ONLY Restrict to read-only operations (default: true)
DEBUG Enable verbose logging (default: false)Available Tools
Instance
Tool | Description |
| Instance name, description, version, rules |
Accounts
Tool | Description |
| Own profile |
| Account by numeric ID |
| Search accounts by username or display name |
| Posts by an account |
| Social graph |
| Follow management |
| Block management |
| Mute management |
| Relationship to one or more accounts |
| Update own display name, bio, locked status |
Timelines
Tool | Description |
| Home timeline (followed accounts) |
| Local instance public timeline |
| Federated public timeline |
| Statuses with a specific hashtag |
Statuses
Tool | Description |
| Single status by ID |
| Thread ancestors and descendants |
| Post a new status (supports CW, visibility, media, polls) |
| Delete own status |
| Favourite management |
| Boost management |
| Bookmark management |
| Who engaged with a status |
Notifications
Tool | Description |
| List notifications (filterable by type) |
| Dismiss a single notification |
| Clear all notifications |
Search & Discovery
Tool | Description |
| Search accounts, statuses, and hashtags |
| Trending hashtags |
| Trending statuses |
| Trending links/articles |
| Browse the instance profile directory |
Collections
Tool | Description |
| Own favourited statuses |
| Own bookmarked statuses |
| Muted accounts |
| Blocked accounts |
Lists
Tool | Description |
| All lists |
| Accounts in a list |
| Create/delete lists |
| Add/remove list members |
Polls
Tool | Description |
| Vote in a poll |
Follow Requests
Tool | Description |
| Pending follow requests |
| Accept/reject requests |
Media
Tool | Description |
| Upload image/video/audio attachment |
Future Tools (Mastodon.py ≥ 2.x / Mastodon server ≥ 3.5)
The following tools are implemented but commented out in server.py. Uncomment them when your distribution ships python3-mastodon >= 2.0.1 (already available on Debian 13/trixie):
Tool | Requirement |
| Edit a status (server 3.5+) |
| Edit history (server 3.5+) |
| Plain-text source for editing |
| Translate a status (server 4.0+) |
| Direct-message conversations |
| List scheduled posts |
| Reschedule a post |
| Cancel a scheduled post |
| Unread notification count |
Testing
# Offline (tool registration + helper functions + version check)
python3 scripts/test_server.py
# With live instance (basic connectivity)
MASTODON_INSTANCE=https://mastodon.social \
MASTODON_ACCESS_TOKEN=your-token \
python3 scripts/test_server.pyLive capability scenario
tests/live_capability_scenario.py exercises every registered read-only tool against a real Mastodon instance and verifies that write tools refuse with a clear error when READ_ONLY=true (the default).
# Env-based (recommended)
MASTODON_INSTANCE=https://f.cz \
MASTODON_ACCESS_TOKEN=your-token \
READ_ONLY=true \
python3 tests/live_capability_scenario.py --json-out /tmp/mastodon-live.json
# Or pass credentials as flags
python3 tests/live_capability_scenario.py \
--instance https://f.cz \
--access-token "$MASTODON_ACCESS_TOKEN" \
--json-out /tmp/mastodon-live.jsonWhat it checks:
MCP tool catalog registration (callable present for every tool)
Annotation vs
validate_write()consistency (readOnlyHint=Falsetools must guard writes)Every read-only tool against the live API (instance, account, timelines, statuses, search, trending, lists, mutes/blocks, directory, …)
Every write tool under
READ_ONLY=true(must raise / refuse; never mutate)
Exit code is 0 only when every non-skipped check passes. Use --json-out for a machine-readable report. --allow-writes skips the write guards (does not exercise mutating calls).
Architecture
The server is built on FastMCP (python3-fastmcp) and Mastodon.py. Tools are registered with MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint). Write tools call validate_write(), which refuses when READ_ONLY is enabled (default: true).
Citation
This project is built on Mastodon.py. If you use it in academic work, please cite:
@article{Diener2026,
author = {Diener, Lorenz and Delcourt, Corentin},
title = {Mastodon.py: A Python library for the Mastodon API},
journal = {Journal of Open Source Software},
year = {2026},
volume = {11},
number = {120},
pages = {8946},
doi = {10.21105/joss.08946},
url = {https://doi.org/10.21105/joss.08946}
}See Mastodon.py's CITATION.cff for details.
License
MIT — Vítězslav Dvořák info@vitexsoftware.cz
Available Tools
54 toolsaccount_blockAccount BlockCIdempotent
Block an account.
Inputs: account_id (required). Returns: result
account_followAccount FollowCIdempotent
Follow an account.
Inputs: account_id (required). Returns: result
account_followersAccount FollowersCRead-onlyIdempotent
Get followers of an account.
Inputs: account_id (required), limit. Returns: result
account_followingAccount FollowingBRead-onlyIdempotent
Get accounts that a given account follows.
Inputs: account_id (required), limit. Returns: result
account_getAccount GetBRead-onlyIdempotent
Get a Mastodon account by its numeric ID.
Inputs: account_id (required). Returns: result
account_muteAccount MuteCIdempotent
Mute an account.
Inputs: account_id (required). Returns: result
account_relationshipsAccount RelationshipsARead-onlyIdempotent
Get the authenticated user's relationship to one or more accounts.
Inputs: account_ids (required). Returns: result
account_searchAccount SearchBRead-onlyIdempotent
Search for accounts by username or display name.
Inputs: query (required), limit, resolve. Returns: result
account_statusesAccount StatusesCRead-onlyIdempotent
Get statuses posted by a specific account.
Inputs: account_id (required), limit, only_media, exclude_reblogs, +1 more. Returns: result
account_unblockAccount UnblockCIdempotent
Unblock an account.
Inputs: account_id (required). Returns: result
account_unfollowAccount UnfollowCIdempotent
Unfollow an account.
Inputs: account_id (required). Returns: result
account_unmuteAccount UnmuteBIdempotent
Unmute an account.
Inputs: account_id (required). Returns: result
account_updateAccount UpdateBIdempotent
Update the authenticated account's profile.
Inputs: bot, note, locked, display_name. Returns: result
account_verifyAccount VerifyARead-onlyIdempotent
Get the authenticated account's own profile.
Returns: str: JSON with account id, username, display_name, followers_count, etc.
Inputs: no named parameters. Returns: result
blocksBlocksBRead-onlyIdempotent
Get accounts blocked by the authenticated account.
Inputs: limit. Returns: result
bookmarksBookmarksBRead-onlyIdempotent
Get statuses bookmarked by the authenticated account.
Inputs: limit. Returns: result
directoryDirectoryCRead-onlyIdempotent
Browse the profile directory of the instance.
Inputs: limit, local, order. Returns: result
favouritesFavouritesCRead-onlyIdempotent
Get statuses favourited by the authenticated account.
Inputs: limit. Returns: result
follow_request_authorizeFollow Request AuthorizeCIdempotent
Approve a follow request.
Inputs: account_id (required). Returns: result
follow_request_rejectFollow Request RejectCDestructiveIdempotent
Reject a follow request.
Inputs: account_id (required). Returns: result
follow_requestsFollow RequestsARead-onlyIdempotent
Get pending follow requests for the authenticated account.
Inputs: limit. Returns: result
instance_infoInstance InfoARead-onlyIdempotent
Get information about the connected Mastodon instance.
Returns: str: JSON with instance name, description, version, rules, etc.
Inputs: no named parameters. Returns: result
list_accountsList AccountsCRead-onlyIdempotent
Get accounts in a specific list.
Inputs: list_id (required), limit. Returns: result
list_accounts_addList Accounts AddBIdempotent
Add accounts to a list.
Inputs: list_id (required), account_ids (required). Returns: result
list_accounts_deleteList Accounts DeleteCDestructiveIdempotent
Remove accounts from a list.
Inputs: list_id (required), account_ids (required). Returns: result
list_createList CreateC
Create a new list.
Inputs: title (required), replies_policy. Returns: result
list_deleteList DeleteCDestructiveIdempotent
Delete a list.
Inputs: list_id (required). Returns: result
lists_getLists GetBRead-onlyIdempotent
Get all lists created by the authenticated account.
Returns: str: JSON list of list objects with id and title.
Inputs: no named parameters. Returns: result
media_postMedia PostC
Upload a media file (image, video, audio) to Mastodon.
Inputs: file_path (required), description. Returns: result
mutesMutesBRead-onlyIdempotent
Get accounts muted by the authenticated account.
Inputs: limit. Returns: result
notification_dismissNotification DismissCDestructiveIdempotent
Dismiss (clear) a single notification.
Inputs: notification_id (required). Returns: result
notifications_clearNotifications ClearADestructiveIdempotent
Dismiss all notifications for the authenticated account.
Returns: str: JSON confirmation.
Inputs: no named parameters. Returns: result
notifications_getNotifications GetCRead-onlyIdempotent
Get notifications for the authenticated account.
Inputs: limit, exclude_types. Returns: result
poll_votePoll VoteC
Vote in a poll.
Inputs: choices (required), poll_id (required). Returns: result
searchSearchCRead-onlyIdempotent
Search Mastodon for accounts, statuses, and hashtags.
Inputs: query (required), limit, resolve, search_type. Returns: result
status_bookmarkStatus BookmarkCIdempotent
Bookmark a status.
Inputs: status_id (required). Returns: result
status_contextStatus ContextBRead-onlyIdempotent
Get ancestors and descendants of a status (thread context).
Inputs: status_id (required). Returns: result
status_deleteStatus DeleteBDestructiveIdempotent
Delete a status posted by the authenticated account.
Inputs: status_id (required). Returns: result
status_favouriteStatus FavouriteAIdempotent
Favourite (like) a status.
Inputs: status_id (required). Returns: result
status_favourited_byStatus Favourited ByCRead-onlyIdempotent
Get accounts that favourited a status.
Inputs: status_id (required). Returns: result
status_getStatus GetBRead-onlyIdempotent
Get a single status by ID.
Inputs: status_id (required). Returns: result
status_postStatus PostC
Post a new status (toot).
Inputs: status, content, language, media_ids, +4 more. Returns: result
status_reblogStatus ReblogBIdempotent
Reblog (boost) a status.
Inputs: status_id (required), visibility. Returns: result
status_reblogged_byStatus Reblogged ByARead-onlyIdempotent
Get accounts that reblogged a status.
Inputs: status_id (required). Returns: result
status_unbookmarkStatus UnbookmarkBIdempotent
Remove a bookmark from a status.
Inputs: status_id (required). Returns: result
status_unfavouriteStatus UnfavouriteCIdempotent
Remove a favourite from a status.
Inputs: status_id (required). Returns: result
status_unreblogStatus UnreblogBIdempotent
Remove a reblog (unboost) of a status.
Inputs: status_id (required). Returns: result
timeline_hashtagTimeline HashtagCRead-onlyIdempotent
Get statuses with a specific hashtag.
Inputs: hashtag (required), limit, local. Returns: result
timeline_homeTimeline HomeBRead-onlyIdempotent
Get the authenticated user's home timeline.
Inputs: limit. Returns: result
timeline_localTimeline LocalBRead-onlyIdempotent
Get the local (instance) public timeline.
Inputs: limit. Returns: result
timeline_publicTimeline PublicBRead-onlyIdempotent
Get the federated public timeline.
Inputs: limit, remote. Returns: result
trending_linksTrending LinksARead-onlyIdempotent
Get trending links (articles) on the instance.
Inputs: limit. Returns: result
trending_statusesTrending StatusesBRead-onlyIdempotent
Get trending statuses on the instance.
Inputs: limit. Returns: result
trending_tagsTrending TagsCRead-onlyIdempotent
Get trending hashtags on the instance.
Inputs: limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 54 tools
Most tools map to clearly distinct resource+action pairs (account_get vs account_follow vs status_reblog), and the domain vocabulary is well-known. Minor overlaps exist, e.g. account_search vs the general search tool, and the notification_get/dismiss/clear trio requires reading descriptions to distinguish granularity.
The dominant pattern is noun_verb (account_get, status_post, list_create), but there are notable deviations: bare nouns with no verb (mutes, blocks, favourites, bookmarks, search, directory) and scrambled multi-part names (list_accounts_add, follow_request_authorize). Plurals are also inconsistent within the same family (notifications_get vs notification_dismiss).
54 tools is a very heavy surface for an agent to navigate and is well past the 25+ threshold for concern. The breadth of the Mastodon API justifies many of them individually, but the set would benefit from consolidation (e.g. generic follow/mute/block with an action parameter).
Coverage is broad and lifecycle-aware: accounts, statuses, timelines, lists, notifications, polls, media, follow requests, mutes/blocks, and trending data are all present with create/delete/action variants. Gaps remain around direct-message/conversation tools, status editing (only status_delete exists despite account_update), and list updates, but core workflows are covered.
Maintenance
Related MCP Connectors
Hosted X (Twitter) MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP server for AI dialogue using various LLM models via AceDataCloud
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
An MCP server that provides agents access to the KeldynAI platform
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to access and interact with Reddit content through features like user analysis, post retrieval, subreddit statistics, and authenticated posting capabilities.15302MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with the Twitter/X API v2, enabling AI assistants to retrieve tweets, post content, reply, quote, and more programmatically.13MIT
- AlicenseBqualityCmaintenanceA comprehensive MCP server that enables LLMs like Claude to explore and interact with the existing Fediverse through standardized MCP tools, resources, and prompts.18131 npm17MIT
- AlicenseBqualityCmaintenanceAn MCP server that enables AI assistants to interact with Twitter/X through a single authenticated session without an official API key, providing 27 tools for reading and writing tweets, user management, timeline access, trends, and direct messages.2714 PyPI2MIT