KosmoKrator

social

Mastodon MCP Integration for OpenAI Agents SDK

Connect Mastodon to OpenAI Agents SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

6 functions 5 read 1 write Bearer token auth

Connect Mastodon to OpenAI Agents SDK

Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.

Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with --write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.

Mastodon MCP Config for OpenAI Agents SDK

Use headless JSON commands for CI-style execution and MCP for agent tool discovery.

{
  "mcpServers": {
    "kosmokrator-mastodon": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=mastodon",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=mastodon --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Mastodon instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Mastodon Tools Visible to OpenAI Agents

OpenAI Agents sees stable MCP tool names generated from the Mastodon integration catalog.

MCP toolSource functionTypeDescription
integration__mastodon__mastodon_list_statuses mastodon.mastodon_list_statuses Read Browse statuses (toots) from a Mastodon timeline. Use "home" for your home feed, "public" for the federated timeline, or "local" for the local instance timeline. Supports pagination.
integration__mastodon__mastodon_get_status mastodon.mastodon_get_status Read Retrieve a single Mastodon status (toot) by its ID. Returns the full post content, author details, and engagement metrics.
integration__mastodon__mastodon_create_status mastodon.mastodon_create_status Write Publish a new status (toot) on Mastodon. Supports content warnings, visibility controls (public, unlisted, private, direct), replies, and language settings.
integration__mastodon__mastodon_list_accounts mastodon.mastodon_list_accounts Read List followers of a Mastodon account. Returns account profiles with display names, bios, and follower counts. Supports pagination.
integration__mastodon__mastodon_get_account mastodon.mastodon_get_account Read Retrieve a Mastodon account profile by ID. Returns display name, bio, follower counts, and other profile details.
integration__mastodon__mastodon_get_current_user mastodon.mastodon_get_current_user Read Get the authenticated user's Mastodon profile. Returns display name, bio, follower/following counts, and other account details.

Related Mastodon Pages