Postlint MCP Server

io.github.conorbronsdon由 GitHub 账号 conorbronsdon 发布v1.1.0更新于 Oct 24, 2026

Check a social post against a platform's real character limit: X, Bluesky, LinkedIn, Threads.

已验证STDIO仅桌面效率与工作流沟通与协作

概览

AI 生成的概览

检查草稿中的社交帖子是否符合 X、Bluesky、LinkedIn、Threads、Mastodon 和 Discord 的真实字数限制。

可以做什么
提供按各平台实际计数方式测量帖子的工具:check_post 返回单个平台的判定结果,包括计数长度、限制、剩余空间和计数来源;check_post_all 返回每个平台一行;platform_limits 列出各平台限制、计数单位及其来源。它会考虑 X 将每个链接按 23 个字符计、Bluesky 按字素簇计数等规则。它只测量文本并报告数字,不会修改或发布内容。
适用场景
适合为多个平台起草或排期帖子、需要在发布前确认草稿是否超限的场景,尤其是含链接、表情符号或非拉丁文字、靠肉眼无法判断字数时。若只发一个平台或从不触及限制,则用处不大。
运行要求
通过 stdio 在本地运行,可用 npx 从 npm 安装,或用 Node.js 从源码构建。无需账号、令牌、环境变量或网络访问。
安装前请注意
它不会发布、截断或发起网络请求,因此不会改动你的内容。边界情况下计数为估算:不带协议的裸域名可能无法识别,[URL] 等草稿占位符按真实链接计价并会提示该计数为下限,Mastodon 限制因实例而异,报告的默认值可能与你的服务器不符。媒体、投票和内容警告不计入。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Postlint MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

postlint-mcp

Maintenance mode. This project is stable and receives security fixes. New features aren't planned, but issues and pull requests are still welcome.

Check a social post against a platform's real character limit before it ships. X, Bluesky, LinkedIn, Threads, Mastodon, Discord. Pure compute — no API, no auth, no network.

[npm version] [License: Apache 2.0] [Node] [Glama score] [Podcast] [X]

[Three drafts checked in a terminal: an X post at 308 of 280 with three URLs billed at 23 each, a Bluesky post at 302 of 300, and that same draft with its link still a [URL] placeholder, which a length check reads as 277 but the server prices at exactly 300 of 300]

Recorded from docs/demo.tape with vhs. The posts and counts come from scripts/fixtures.mjs, which the regression tests import too.


An MCP server that answers one question: does this post fit?

A language model cannot count characters by inspection, and on these platforms neither can you. The limits are not what they look like. X bills every URL at 23 characters through t.co whether the link is 12 characters or 200. Bluesky counts extended grapheme clusters, so a four-person family emoji is 1 and not 11. Mastodon charges nothing for the domain on a remote mention. Getting any of that wrong shows up as a rejected post, or a truncated one, at publish time.

Counting is what a tool call is for. The model cannot do it by inspection, and a deterministic function can do it exactly.

Why this exists. Two posts went out of a podcast promo workflow over the limit. A Bluesky post shipped at 302 against 300, with the line "Under 300 graphemes. Audit clean." sitting directly beneath it. An X post was drafted at 308 against 280 and would have been rejected on launch morning. Both were invisible to eyeballing, because in both cases the count was a claim and not a measurement. Both are regression tests in this repo.

Tools

ToolWhat it returns
check_postVerdict for one platform: counted length, the limit, headroom, and what drove the count
check_post_allOne row per platform, with the breakdown attached only to the rows that fail
platform_limitsEach platform's limit, its counting unit, why that unit is not a character count, and the source

Responses are small on purpose. check_post_all omits the arithmetic on passing rows because agents pay tokens per response.

How each platform counts

PlatformLimitUnitThe part that surprises peopleSource
x280weighted charactersEvery URL costs exactly 23. CJK, Hangul, and emoji cost 2 each; Latin, Greek, Cyrillic, Hebrew, and Arabic cost 1. An emoji sequence is one unit of 2, not 2 per code point.twitter-text v3 config
x_premium25,000weighted charactersSame weighting, higher ceiling.X help center
bluesky300graphemesFlags, ZWJ emoji, skin-tone modifiers, and combining accents each count as 1. URLs count in full. A second cap of 3,000 UTF-8 bytes can bind first on ZWJ-heavy text.atproto lexicon
linkedin3,000charactersThe 3,000 is generous; the fold is the real constraint. The feed collapses the post behind "see more" after a few lines.LinkedIn help
threads500charactersThe September 2025 change added a 10,000-character attachment. The post body is still 500.Meta newsroom
mastodon500graphemesURLs cost 23, as on X. On @[email protected] only @user counts. The limit is per-instance and plenty of servers run higher.Mastodon API docs
discord2,000characters4,000 with Nitro. Embeds have a separate 6,000 total.Discord support

Every number above traces to a published source. Widely repeated figures that no primary source states — the Facebook post limit, the YouTube community post limit, Reddit's title cap, Instagram's organic caption cap — are deliberately absent. A limit that cannot be defended makes a passing check worth nothing.

Setup

Published on npm. The config blocks below use npx, which fetches it on first run; no clone required.

bash
git clone https://github.com/conorbronsdon/postlint-mcp.gitcd postlint-mcpnpm installnpm run build

Claude Code

Add to your .mcp.json:

json
{  "mcpServers": {    "postlint": {      "command": "node",      "args": ["/absolute/path/to/postlint-mcp/dist/index.js"]    }  }}

Claude Desktop

Same block, in claude_desktop_config.json.

Codex

Add to ~/.codex/config.toml:

toml
[mcp_servers.postlint]command = "npx"args = ["-y", "@conorbronsdon/postlint-mcp"]

No token, no environment variables, no network access. Once the package is published, npx -y @conorbronsdon/postlint-mcp replaces the node invocation everywhere above.

Verify

Ask your assistant: "Check this post for X and Bluesky," and paste something with a couple of links in it.

A worked example

The X post that started this, run through check_post with platform: "x":

json
{  "platform": "x",  "limit": 280,  "unit": "weighted characters",  "length": 308,  "over": true,  "remaining": -28,  "drivers": [    "3 URLs counted as 23 each = 69",    "239 other characters counted as 1 each"  ],  "warnings": []}

The drivers line is the useful part. 69 of the budget went to links before a word was written, which tells you to move two of them into a reply rather than trimming prose.

The same post through check_post_all:

json
{  "fits": ["x_premium", "linkedin", "threads", "mastodon", "discord"],  "over": ["x", "bluesky"],  "rows": [    { "platform": "x", "length": 308, "limit": 280, "over": true, "drivers": ["3 URLs counted as 23 each = 69", "239 other characters counted as 1 each"] },    { "platform": "bluesky", "length": 330, "limit": 300, "over": true, "drivers": ["3 URLs counted in full = 91 (Bluesky does not shorten links)", "239 other graphemes"] },    { "platform": "mastodon", "length": 308, "limit": 500, "over": false, "remaining": 192 }  ]}

One post, three different lengths — 308, 330, and 308 again — from the same 330 characters of text. That gap is the whole reason this exists.

Draft placeholders

Drafts carry link placeholders, and [URL] is five characters while a real link is not. A post measured with the placeholder in place and posted with the link filled in is a post measured wrong; one draft came in at 264 that way and posted at 282.

So [URL], [LINK], [YOUTUBE URL], [SUBSTACK URL], and similar are priced as a real link (a 28-character YouTube short link, the shortest thing normally posted) and the response carries a warning saying the count is a floor.

What it does not do

  • It does not post anything. There is no write path, no credential, and no network call of any kind. That last one is enforced rather than asserted: a test replaces fetch, XMLHttpRequest, and WebSocket with throws and drives every tool, so a call added later fails CI instead of quietly making this sentence false.
  • It does not check an instance's actual limit. Mastodon servers configure their own; this reports the 500 default and tells you to read configuration.statuses.max_characters from the target server yourself.
  • It does not truncate. A truncate_to helper was considered and left out. Cutting a post at a character offset splits URLs, breaks grapheme clusters, and lands mid-sentence, and cutting it at a "safe" boundary silently drops whichever clause happened to be last. Either way the tool would be deciding what the post says. It reports the number and leaves the edit to you.
  • It does not detect every URL a platform would. Links with a scheme and www.-prefixed hosts always match. A bare domain matches only on a common TLD (src/count.ts holds the list), where the real twitter-text implementation carries the full IANA registry. Write https:// in front of a link and the count is exact.
  • It does not count media, polls, quote posts, or link cards. Those have their own rules and this measures text.
  • It does not know about content warnings. On Mastodon a CW counts toward the same 500. This checks the body alone.
  • It does not carry limits it cannot source. See the platform table.

Development

bash
npm installnpm run buildnpm test

Tests make no network calls, because the server makes none. The two historical over-limit posts are regression fixtures in src/__tests__/lint.test.ts, alongside grapheme cases for ZWJ family emoji, regional-indicator flags, skin-tone modifiers, combining accents, and CJK.

Contributing

Issues and pull requests are welcome. A new platform needs three things: the limit, the unit it is measured in, and a published source. A new counting rule needs a test that fails without it. Numbers repeated by third parties are not sources.

About

Built and maintained by Conor Bronsdon. I host the Chain of Thought podcast, which covers AI infrastructure, developer tools, and how practitioners actually use this stuff. I built this after shipping two over-limit posts in a workflow that was supposed to catch them.

Companion tools:

  • op3-mcp: podcast analytics through OP3 — downloads, geography, apps, per-episode breakdowns.
  • podcastindex-mcp: the Podcast Index MCP server, search by person or topic, trending shows, feed health.
  • substack-mcp: read posts and manage drafts on Substack, safe for agent workflows.
  • Transistor MCP: Transistor.fm's official MCP server. Episodes, publishing, and analytics.
  • ai-tools-for-creators: a curated list of AI skills and MCP servers for people who ship ideas for a living.

More at chainofthought.show and on X.


Disclaimer

This is an independent personal project, not affiliated with, sponsored by, or endorsed by any company. All views expressed are my own.

License

Apache-2.0

来源:README.md,提交 6622dba

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分