
Operation-level Mastodon API clients with generated per-operation modules, SDK for composing operations, Gradle tasks, CLI tools, and MCP server exposing Mastodon tooling to AI assistants.
Kotlin Multiplatform SDK for the Mastodon API.
org.litote.mastodon.ktor.sdk
Each API operation has its own module in the client directory. Add only what you need:
// POST /api/v1/statuses
implementation("org.litote.mastodon.ktor.sdk:statuses-api-v1-statuses-post-client:<version>")
// POST /api/v2/media
implementation("org.litote.mastodon.ktor.sdk:media-api-v2-media-post-client:<version>")Configure a ClientConfiguration with your server and access token:
val config = ClientConfiguration(
baseUrl = "https://mastodon.example.com/",
httpClientConfig = {
install(ContentNegotiation) { json(Json { ignoreUnknownKeys = true }) }
defaultRequest {
header("Authorization", "Bearer $accessToken")
}
}
)
val client = StatusesApiV1StatusesPostClient(config)
val response = client.createStatus(TextStatus(status = "Hello Mastodon!"))For operation composition (e.g. upload an image and post a media status).
See sdk/README.md for usage.
For projects that build with Gradle, the gradle-plugin module provides sendText and sendMedia tasks that call the SDK directly — no shell invocation needed.
See gradle-plugin/README.md for setup and usage.
Expose Mastodon tools to any MCP client (Claude Desktop, Claude Code, etc.) via a STDIO transport.
See mcp-server/README.md for setup and usage.
Command-line tools to post statuses to Mastodon.
See cli/README.md for usage.
Kotlin Multiplatform SDK for the Mastodon API.
org.litote.mastodon.ktor.sdk
Each API operation has its own module in the client directory. Add only what you need:
// POST /api/v1/statuses
implementation("org.litote.mastodon.ktor.sdk:statuses-api-v1-statuses-post-client:<version>")
// POST /api/v2/media
implementation("org.litote.mastodon.ktor.sdk:media-api-v2-media-post-client:<version>")Configure a ClientConfiguration with your server and access token:
val config = ClientConfiguration(
baseUrl = "https://mastodon.example.com/",
httpClientConfig = {
install(ContentNegotiation) { json(Json { ignoreUnknownKeys = true }) }
defaultRequest {
header("Authorization", "Bearer $accessToken")
}
}
)
val client = StatusesApiV1StatusesPostClient(config)
val response = client.createStatus(TextStatus(status = "Hello Mastodon!"))For operation composition (e.g. upload an image and post a media status).
See sdk/README.md for usage.
For projects that build with Gradle, the gradle-plugin module provides sendText and sendMedia tasks that call the SDK directly — no shell invocation needed.
See gradle-plugin/README.md for setup and usage.
Expose Mastodon tools to any MCP client (Claude Desktop, Claude Code, etc.) via a STDIO transport.
See mcp-server/README.md for setup and usage.
Command-line tools to post statuses to Mastodon.
See cli/README.md for usage.