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

mcpserver

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 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"
	ToolUpdatePost     = "update_post"
	ToolConnectAccount = "connect_account"
	ToolListAccounts   = "list_accounts"
	ToolListProfiles   = "list_profiles"
	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 */
}

CreatePostInput is the create_post 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 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 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."`
}

UpdatePostInput is the update_post 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