mcpserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mcpserver exposes the six public API operations as MCP tools. The tool set is fixed: one tool per endpoint, same names as the CLI commands.

Index

Constants

View Source
const (
	ToolCreatePost   = "create_post"
	ToolListPosts    = "list_posts"
	ToolGetPost      = "get_post"
	ToolDeletePost   = "delete_post"
	ToolListAccounts = "list_accounts"
	ToolGetUsage     = "get_usage"
)

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 CreatePostInput

type CreatePostInput struct {
	Content     string   `` /* 138-byte string literal not displayed */
	Platforms   []string `` /* 200-byte string literal not displayed */
	AccountIDs  []string `json:"account_ids,omitempty" jsonschema:"Specific connected account ids from list_accounts. Use this OR platforms."`
	ScheduledAt string   `` /* 163-byte string literal not displayed */
}

CreatePostInput is the create_post 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: scheduled, pending, processing, published, failed or partial."`
	Platform string `json:"platform,omitempty" jsonschema:"Only posts that target this platform, e.g. x or linkedin."`
	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.

Jump to

Keyboard shortcuts

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