markpost

markpost

An MCP server that formats and syndicates Markdown content to Twitter/X, Threads, and a static blog on S3, with automatic thread splitting and preview capabilities.

Category
访问服务器

README

Markpost

An MCP server that takes Markdown content and syndicates it to Twitter/X, Threads, and a static blog on S3. Designed to be used by AI agents like Claude Code — write a post in Markdown, and Markpost handles the formatting and publishing for each platform.

What it does

  • Formats per platform — Strips Markdown to plain text for social media, renders full HTML for blog
  • Auto-splits into threads — Long content is split at --- separators or sentence boundaries, respecting each platform's character limit (280 for Twitter, 500 for Threads)
  • Previews before publishing — Dry-run tool shows exactly how content will be formatted and split
  • Syndicates everywhere at once — Publish to all platforms with a single tool call, or pick specific ones

Tools

Tool Description
publish_post Format and publish Markdown to one or more platforms
preview_post Preview formatting and thread splits without publishing
ping Health check

Quick start

1. Install

git clone <this-repo> && cd markpost
uv venv && uv pip install -e ".[dev]"

2. Configure API keys

Copy the example config and fill in your credentials:

mkdir -p ~/.markpost
cp config.example.toml ~/.markpost/config.toml

Edit ~/.markpost/config.toml:

[twitter]
consumer_key = "your-consumer-key"
consumer_secret = "your-consumer-secret"
access_token = "your-access-token"
access_token_secret = "your-access-token-secret"

[threads]
access_token = "your-long-lived-access-token"
user_id = "your-threads-user-id"

[blog]
s3_bucket = "my-blog-bucket"
s3_prefix = "posts/"
base_url = "https://blog.example.com"

[blog.aws]
region = "us-east-1"

You can also set a custom config path via the MARKPOST_CONFIG environment variable.

3. Connect to an MCP client

See the sections below for your specific client.

Running the server

stdio mode (default)

stdio is the standard transport for local MCP clients. The server reads JSON-RPC messages from stdin and writes responses to stdout.

uv run python src/markpost/server.py

Or using the FastMCP CLI:

uv run fastmcp run src/markpost/server.py

HTTP mode (remote / SSE)

For remote access or web-based clients, run in HTTP mode:

uv run fastmcp run src/markpost/server.py --transport http --host 0.0.0.0 --port 9000

The server will be available at http://localhost:9000. Clients connect via the Streamable HTTP transport.

Client setup

Claude Code

Register the server with the claude CLI:

claude mcp add markpost -- uv run --directory /path/to/markpost fastmcp run src/markpost/server.py

Verify it's registered:

claude mcp list

The publish_post and preview_post tools will now be available in Claude Code sessions.

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "markpost": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "/path/to/markpost",
        "fastmcp", "run", "src/markpost/server.py"
      ]
    }
  }
}

Restart Claude Desktop after saving.

Other MCP clients (HTTP)

Start the server in HTTP mode (see above), then point your client at http://localhost:9000.

Getting API keys

Twitter/X

  1. Go to the Twitter Developer Portal
  2. Create a Project and App
  3. Set app permissions to Read and Write
  4. Generate your Consumer Key (API Key), Consumer Secret (API Secret), Access Token, and Access Token Secret
  5. If you changed permissions after generating tokens, regenerate them

The free tier allows 1,500 tweets/month.

Threads

  1. Go to the Meta Developer Dashboard
  2. Create a new app and add the Threads API product
  3. Your Threads account must be public
  4. Complete the OAuth flow to get an access token:
    • Authorize at https://threads.net/oauth/authorize?client_id={app_id}&redirect_uri={uri}&scope=threads_basic,threads_content_publish&response_type=code
    • Exchange the code for a short-lived token at https://graph.threads.net/oauth/access_token
    • Exchange for a long-lived token (60 days) at https://graph.threads.net/access_token?grant_type=th_exchange_token&client_secret={secret}&access_token={short_token}
  5. Get your user ID: GET https://graph.threads.net/v1.0/me?access_token={token}

S3 Blog

  1. Create an S3 bucket configured for static website hosting
  2. Configure your AWS credentials via the standard methods (~/.aws/credentials, environment variables, or IAM role)
  3. Set s3_bucket, s3_prefix, and base_url in your config

The base_url should be the public URL where your blog is served (e.g., your CloudFront distribution or S3 website endpoint).

Thread splitting

Long content is automatically split into threads. You control splits two ways:

Explicit separators — Use --- in your Markdown to force a split:

Here is the first tweet in my thread.

---

And here is the second one.

Auto-splitting — If any section exceeds the platform's character limit, it's split at sentence boundaries. If a single sentence is too long, it falls back to word boundaries.

The preview_post tool lets you see exactly how content will be split before publishing.

Development

# Install dev dependencies
uv pip install -e ".[dev]"

# Run tests
uv run pytest tests/ -v

# Run a specific test file
uv run pytest tests/test_formatter.py -v

Project structure

src/markpost/
  server.py              # FastMCP server — ping, publish_post, preview_post
  config.py              # TOML config loading
  formatter.py           # markdown_to_plain, split_into_thread, markdown_to_html
  publishers/
    twitter.py           # Twitter/X via tweepy
    threads.py           # Threads via httpx (async)
    blog.py              # S3 upload via boto3

License

Apache 2.0

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选