Mastodon Scout
Verified@patelhiren
npx machina-cli add skill @patelhiren/mastodon-scout --openclawMastodon Scout
Purpose
Read-only Mastodon CLI that fetches data from the Mastodon API. Returns human-readable summaries by default, or raw JSON with --json flag.
Invocation Rules (MANDATORY)
Binary Selection
- macOS / Darwin →
{baseDir}/bin/mastodon-scout - Linux →
{baseDir}/bin/mastodon-scout
Commands
Home Timeline
{baseDir}/bin/mastodon-scout home
Fetches the authenticated user's home timeline.
User Tweets
{baseDir}/bin/mastodon-scout user-tweets
Fetches the authenticated user's own posts.
Mentions
{baseDir}/bin/mastodon-scout mentions
Fetches mentions of the authenticated user.
Search
{baseDir}/bin/mastodon-scout search <query>
Searches for posts matching the query.
Flags (Optional)
--instance <url> # Mastodon instance URL (default: https://mastodon.social)
--limit <int> # Number of items to return (default: 20)
--timeout <int> # Timeout in seconds (default: 30)
--json # Output raw JSON instead of human-readable text
Environment Variables (REQUIRED)
MASTODON_TOKEN # OAuth bearer token for authentication
Output Modes
Text Mode (Default)
mastodon-scout home
Returns human-readable summary of timeline data.
The agent MAY summarize and explain the timeline results to make them more accessible to the user.
JSON Mode
mastodon-scout --json home
Returns raw JSON data from the Mastodon API.
When JSON mode is used, return the output verbatim without interpretation.
Error Handling
-
If the binary exits non-zero:
- In JSON mode: return error output verbatim
- In text mode: the agent MAY explain the error to the user
- Do not retry
-
If MASTODON_TOKEN is not set:
- The binary will exit with an error message
- Agent should guide the user to the authentication setup section
Examples That Trigger This Skill
mastodon-scout homeshow my mastodon timelinecheck mastodon mentionssearch mastodon for "golang"get my mastodon posts
Performance Requirements
- Execute binary directly
- No web searches
- No secondary tools beyond the binary
- Minimize latency
Notes
- In text mode: agent MAY summarize and explain results
- In JSON mode: output verbatim, no interpretation
- This skill is read-only (no posting, following, or other mutations)
Authentication Setup (Agent MAY Help)
EXCEPTION TO STRICT MODE: If the user needs help obtaining a token, the agent may provide guidance before executing the skill.
The tool requires a Mastodon OAuth bearer token set in the MASTODON_TOKEN environment variable.
How to Obtain a Token (Guide the User):
Step 1: Access Development Settings
- User should log into their Mastodon instance (e.g., mastodon.social, fosstodon.org)
- Navigate to: Settings → Development (or Preferences → Development)
- Direct URL format:
https://[instance-domain]/settings/applications
Step 2: Create Application
- Click "New Application"
- Fill in details:
- Application name:
mastodon-scout(or any name) - Application website: Can leave blank or use any URL
- Redirect URI:
urn:ietf:wg:oauth:2.0:oob(for CLI apps) - Scopes: CRITICAL - Only select
read(uncheck write, follow, push)
- Application name:
Step 3: Get Access Token
- Click "Submit"
- Click on the created application to view details
- Copy the "Your access token" field value
Step 4: Set Environment Variable
export MASTODON_TOKEN="paste_token_here"
Step 5: Verify Token Works
{baseDir}/bin/mastodon-scout home
Common Mastodon Instances:
mastodon.social- General purpose (default)fosstodon.org- FOSS/tech communitymas.to- Tech focusedhachyderm.io- Tech/infosec community
Use --instance https://your-instance.com flag for non-default instances.
Security Notes to Communicate:
- Token is read-only (cannot post, follow, or delete)
- Keep token secret (don't commit to git)
- Can be revoked anytime in Development settings
- Each Mastodon instance requires its own token
Output Format
Text Mode (Default)
Human-readable summary of posts, formatted for readability. The agent decides how to present the information.
JSON Mode (--json flag)
All commands return JSON in the following format:
{
"success": true,
"data": [ /* Mastodon API response */ ]
}
Or on error:
{
"success": false,
"error": "error message"
}
The data field contains the raw Mastodon API response without any modifications.
Overview
Mastodon Scout is a read-only CLI that fetches data from the Mastodon API. By default it returns human-readable timeline summaries, and you can get raw JSON with the --json flag. It supports home timeline, user posts, mentions, and keyword search to streamline quick insights from Mastodon without a browser.
How This Skill Works
Authenticated via the MASTODON_TOKEN environment variable, Mastodon Scout queries the Mastodon API for the requested data (home timeline, user-tweets, mentions, or search). The tool outputs human-readable summaries by default and switches to raw JSON when --json is used. It runs as a binary at {baseDir}/bin/mastodon-scout on supported platforms and accepts optional flags like --instance, --limit, and --timeout.
When to Use It
- Monitor your home timeline with a quick, readable digest.
- Pull your own posts for archiving or review.
- Check mentions to track engagement and respond promptly.
- Search for keywords across your Mastodon instances.
- Export data to JSON for pipelines or tooling.
Quick Start
- Step 1: Ensure MASTODON_TOKEN is set in your environment.
- Step 2: Run {baseDir}/bin/mastodon-scout home to fetch your home timeline.
- Step 3: Add --json for raw data or --limit <n> to cap results.
Best Practices
- Set MASTODON_TOKEN securely in your environment and protect it from exposure.
- Use --limit to cap results and --timeout to avoid long hangs.
- Specify --instance when querying a non-default Mastodon instance.
- Prefer text output for quick reads; use --json for data pipelines.
- Handle non-zero exits gracefully and avoid automatic retries.
Example Use Cases
- Generate a daily digest of your home timeline for a content team.
- Export the last 20 mentions to JSON for outreach follow-up.
- Search across instances for a brand name to monitor mentions.
- Archive your own posts for offline backup.
- Integrate with a monitoring script to trigger alerts on new posts.