Command Palette

Search for a command to run...

Home / Servers

go-hooppy

Updated 1mo ago

by anatolykoptev

go-hooppy

Go client library, CLI, and MCP server for the Hooppy social media auto-posting API.

Hooppy publishes posts to 20+ social networks (VK, OK, Telegram, Instagram, Twitter/X, TikTok, YouTube, LinkedIn, Dzen, Max, Threads, and more) from a single API. This package provides:

  • Client library — pure Go API client with bearer JWT auth, zero heavy deps
  • CLIhooppy command for scripts and manual use
  • MCP serverhooppy-mcp for LLM agents (Claude, etc.) to publish via Model Context Protocol

Install

go get github.com/anatolykoptev/go-hooppy@latest

Or install the CLI tools:

go install github.com/anatolykoptev/go-hooppy/cmd/hooppy@latest
go install github.com/anatolykoptev/go-hooppy/cmd/hooppy-mcp@latest

Authentication

Get your API token from Hooppy → Settings → API-token (https://hooppy.ru/settings/api).

Set it via environment variable:

export HOOPPY_TOKEN="eyJ0eXAiOiJKV1Qi..."

Or save to a file (the client checks both):

mkdir -p ~/.config/hooppy
echo -n "eyJ0eXAiOiJKV1Qi..." > ~/.config/hooppy/token
chmod 600 ~/.config/hooppy/token

Client library usage

package main

import (
    "context"
    "fmt"
    "log"
    
    "github.com/anatolykoptev/go-hooppy"
)

func main() {
    client, err := hooppy.NewClientFromEnv()
    if err != nil {
        log.Fatal(err)
    }

    // List connected accounts
    resp, err := client.ListAccounts(context.Background(), hooppy.ListAccountsFilter{})
    if err != nil {
        log.Fatal(err)
    }
    for _, acc := range resp.List {
        fmt.Printf("ID=%d  %s (source=%d)\n", acc.ID, acc.SocialAccountName, acc.SourceID)
    }

    // Publish a post immediately to selected pages
    result, err := client.CreatePost(context.Background(), hooppy.PostPublishNowPayload{
        PublicationWhenType: 1,
        PublicationHowType:  1,
        SelectedPagesIDs:    []int{123456, 789012}, // your page IDs from hooppy pages list
        Texts:               []hooppy.PostText{{Text: "Hello from go-hooppy!", SourceID: 0}},
    })
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Post created: ID=%d\n", result.ID)
}

Retry and HTTP client configuration

By default, the client does NOT retry failed requests. Enable retry for transient failures (429/5xx) on safe methods (GET, DELETE) via Config.RetryOptions:

client, err := hooppy.NewClient(hooppy.Config{
    Token: "your-jwt-token",
    RetryOptions: &retry.Options{
        MaxAttempts:  3,                   // default: 3
        InitialDelay: 500 * time.Millisecond, // default: 500ms
        MaxDelay:     5 * time.Second,     // default: 5s
        // MaxElapsedTime defaults to 30s if unset.
        // OnRetry: func(attempt int, err error) { /* observe retries */ },
    },
})

Retry behavior:

  • GET and DELETE are retried on 429/500/502/503/504 with exponential backoff.
  • POST and streaming uploads (CreatePost, BatchDeletePosts, UploadMedia, UploadDocument) NEVER retry — they are non-idempotent.
  • The Retry-After header (RFC 7231: seconds or HTTP-date) overrides the backoff delay.
  • Context is the sole deadline authority — retry stops when the context is cancelled.
  • APIError.RetryAfter exposes the parsed header value (0 if absent).

To customize the HTTP transport (connection pool, TLS, proxies), inject your own *http.Client:

client, err := hooppy.NewClient(hooppy.Config{
    Token:      "your-jwt-token",
    HTTPClient: &http.Client{Transport: &http.Transport{
        MaxIdleConnsPerHost: 30, // tune for high-concurrency (e.g. MCP server)
        // ... other transport fields
    }},
})

CLI usage

# List accounts
hooppy accounts list
hooppy accounts list --source 6   # Pinterest only

# List pages (groups)
hooppy pages list --source 1      # VK pages

# Create and publish a post
hooppy posts create --text "Hello world" --to <page-id>,<page-id>

Related servers

n8n

Updated today

by n8n-io

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

204,501

mcp-server-fetch

OfficialUpdated 14d ago

by modelcontextprotocol

A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

90,371

@modelcontextprotocol/server-everything

OfficialUpdated 14d ago

by modelcontextprotocol

MCP server that exercises all the features of the MCP protocol

90,371

mcp-server-git

OfficialUpdated 14d ago

by modelcontextprotocol

A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs

90,371