Help us shape the future of Go! Take the 2026 Go Developer Survey

mcpserver

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mcpserver exposes the public API operations as MCP tools: one tool per endpoint, with the same names and arguments as the remote server at https://api.postatron.com/mcp.

Index

Constants

View Source
const (
	ToolCreatePost     = "create_post"
	ToolListPosts      = "list_posts"
	ToolGetPost        = "get_post"
	ToolDeletePost     = "delete_post"
	ToolDeletePosts    = "delete_posts"
	ToolUpdatePost     = "update_post"
	ToolConnectAccount = "connect_account"
	ToolListAccounts   = "list_accounts"
	ToolListProfiles   = "list_profiles"
	ToolListQueues     = "list_queues"
	ToolCreateQueue    = "create_queue"
	ToolUpdateQueue    = "update_queue"
	ToolDeleteQueue    = "delete_queue"
	ToolGetUsage       = "get_usage"
	ToolGetAnalytics   = "get_analytics"
	ToolCreateUpload   = "create_upload"
	ToolGetUpload      = "get_upload"
)

Tool names, kept identical to the CLI commands (with underscores).

Variables

View Source
var Version = "1.0.0"

Version is reported to MCP clients in serverInfo. Overridden at release time with -ldflags "-X ...mcpserver.Version=v1.2.3".

Functions

func New

func New(ops apiv1.Operations) *mcp.Server

New builds an MCP server whose tools call ops.

func Run

func Run(ctx context.Context, ops apiv1.Operations) error

Run serves the tools over stdio until the client disconnects.

Types

type AnalyticsInput added in v1.1.0

type AnalyticsInput struct {
	Range     string `json:"range,omitempty" jsonschema:"One of 7d, 30d or 90d. Defaults to 30d."`
	Platform  string `` /* 129-byte string literal not displayed */
	AccountID string `json:"account_id,omitempty" jsonschema:"Only this connected account (an id from list_accounts)."`
	Profile   string `json:"profile,omitempty" jsonschema:"Only accounts in this profile (a name or id from list_profiles)."`
	Source    string `json:"source,omitempty" jsonschema:"all (default) or postatron, to count only posts published with Postatron."`
}

AnalyticsInput is the get_analytics tool input.

type ConnectAccountInput added in v1.5.0

type ConnectAccountInput struct {
	Platform string `json:"platform" jsonschema:"The network to connect: x, instagram, facebook, linkedin, tiktok, youtube, threads or bluesky."`
	Profile  string `` /* 130-byte string literal not displayed */
}

ConnectAccountInput is the connect_account tool input.

type CreatePostInput

type CreatePostInput struct {
	Content     string                  `` /* 138-byte string literal not displayed */
	Platforms   []string                `` /* 203-byte string literal not displayed */
	AccountIDs  []string                `json:"account_ids,omitempty" jsonschema:"Specific connected account ids from list_accounts. Use this OR platforms."`
	Profile     string                  `` /* 157-byte string literal not displayed */
	MediaURLs   []string                `` /* 154-byte string literal not displayed */
	MediaIDs    []string                `json:"media_ids,omitempty" jsonschema:"Upload ids from create_upload, for files on the person's own device."`
	ScheduledAt string                  `` /* 163-byte string literal not displayed */
	Queue       string                  `` /* 194-byte string literal not displayed */
	X           *apiv1.XOptions         `` /* 367-byte string literal not displayed */
	Instagram   *apiv1.InstagramOptions `` /* 266-byte string literal not displayed */
	TikTok      *apiv1.TikTokOptions    `` /* 704-byte string literal not displayed */
	YouTube     *apiv1.YouTubeOptions   `` /* 525-byte string literal not displayed */
}

CreatePostInput is the create_post tool input.

type CreateQueueInput added in v1.8.0

type CreateQueueInput struct {
	Name     string            `json:"name" jsonschema:"What to call the queue, e.g. Weekday mornings."`
	Profile  string            `json:"profile,omitempty" jsonschema:"The profile (name or id from list_profiles) the queue posts for. Omit for Default."`
	Timezone string            `json:"timezone" jsonschema:"IANA timezone the slot times are in, e.g. Europe/London. Ask the person if you do not know it."`
	Slots    []apiv1.QueueSlot `json:"slots,omitempty" jsonschema:"Weekly slots: day 0 (Sunday) to 6 (Saturday) and time as HH:MM."`
	Paused   bool              `json:"paused,omitempty" jsonschema:"Create it paused, taking no posts until resumed."`
}

CreateQueueInput is the create_queue tool input.

type CreateUploadInput added in v1.1.0

type CreateUploadInput struct {
	Purpose string `json:"purpose,omitempty" jsonschema:"Optional note shown on the upload page, e.g. \"photo for your Tuesday post\"."`
}

CreateUploadInput is the create_upload tool input.

type DeletePostsInput added in v1.8.0

type DeletePostsInput struct {
	IDs []string `json:"post_ids" jsonschema:"Up to 100 post ids."`
}

DeletePostsInput is the delete_posts tool input.

type EmptyInput

type EmptyInput struct{}

EmptyInput is used by tools that take no arguments.

type ListPostsInput

type ListPostsInput struct {
	Status   string `json:"status,omitempty" jsonschema:"Filter by status: draft, scheduled, pending, processing, published, failed or partial."`
	Platform string `json:"platform,omitempty" jsonschema:"Only posts that target this platform, e.g. x or linkedin."`
	Profile  string `json:"profile,omitempty" jsonschema:"Only posts to accounts in this profile (a name or id from list_profiles)."`
	From     string `json:"from,omitempty" jsonschema:"RFC 3339 start of the date range (scheduled_at for scheduled posts, created_at otherwise)."`
	To       string `json:"to,omitempty" jsonschema:"RFC 3339 end of the date range."`
	Limit    int    `json:"limit,omitempty" jsonschema:"Page size, 1-100 (default 25)."`
	Cursor   string `json:"cursor,omitempty" jsonschema:"next_cursor from a previous page."`
}

ListPostsInput is the list_posts tool input.

type PostIDInput

type PostIDInput struct {
	ID string `json:"id" jsonschema:"The post id."`
}

PostIDInput is shared by get_post and delete_post.

type QueueInput added in v1.8.0

type QueueInput struct {
	Queue string `json:"queue" jsonschema:"The queue's name or id from list_queues."`
}

QueueInput is the delete_queue tool input.

type UpdatePostInput added in v1.5.0

type UpdatePostInput struct {
	PostID           string                  `json:"post_id" jsonschema:"The id of a draft or scheduled post, from create_post or list_posts."`
	Content          string                  `json:"content,omitempty" jsonschema:"New text for the post. Omit to keep it."`
	ScheduledAt      string                  `` /* 135-byte string literal not displayed */
	PublishNow       bool                    `json:"publish_now,omitempty" jsonschema:"Publish the post now, after the other changes. Not with scheduled_at."`
	AddPlatforms     []string                `` /* 179-byte string literal not displayed */
	AddAccountIDs    []string                `json:"add_account_ids,omitempty" jsonschema:"Specific connected account ids to add, from list_accounts."`
	RemoveAccountIDs []string                `json:"remove_account_ids,omitempty" jsonschema:"Account ids to take off the post. At least one must remain."`
	Profile          string                  `json:"profile,omitempty" jsonschema:"A profile name or id from list_profiles, saying which brand add_platforms means."`
	X                *apiv1.XOptions         `json:"x,omitempty" jsonschema:"Replaces the post's X options as a whole (see create_post); {} clears them."`
	Instagram        *apiv1.InstagramOptions `json:"instagram,omitempty" jsonschema:"Replaces the post's Instagram options as a whole (see create_post); {} clears them."`
	TikTok           *apiv1.TikTokOptions    `json:"tiktok,omitempty" jsonschema:"Replaces the post's TikTok settings as a whole (see create_post); {} clears them."`
	YouTube          *apiv1.YouTubeOptions   `json:"youtube,omitempty" jsonschema:"Replaces the post's YouTube options as a whole (see create_post); {} clears them."`
}

UpdatePostInput is the update_post tool input.

type UpdateQueueInput added in v1.8.0

type UpdateQueueInput struct {
	Queue    string             `json:"queue" jsonschema:"The queue's name or id from list_queues."`
	Name     *string            `json:"name,omitempty" jsonschema:"A new name."`
	Profile  *string            `json:"profile,omitempty" jsonschema:"Move the queue to another profile."`
	Timezone *string            `json:"timezone,omitempty" jsonschema:"A new IANA timezone."`
	Slots    *[]apiv1.QueueSlot `json:"slots,omitempty" jsonschema:"Replaces every slot."`
	Active   *bool              `json:"active,omitempty" jsonschema:"false pauses the queue, true resumes it."`
}

UpdateQueueInput is the update_queue tool input.

type UploadIDInput added in v1.1.0

type UploadIDInput struct {
	ID string `json:"upload_id" jsonschema:"The id from create_upload."`
}

UploadIDInput is the get_upload tool input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL