Solo开发者将调度API暴露给AI Agent后的8个踩坑实录
AI 总结 · 连续创业者视角(以下内容由 AI 提炼,观点归原作者;读完可不看原文)
一位独立开发者将社交排程SaaS的API通过MCP暴露给Claude/Cursor使用,日均700-800次真实调用后,梳理出8个Demo里不会展示的实战教训。核心反直觉点在于:与Agent交互比人更难,需要强制前置校验、幂等键、审批流及平台限制硬编码,而非依赖Agent智能。
- 拒绝黑盒信任:账号关联歧义需强制List Account再校验,不能靠Agent猜测
- 错误前置拦截:媒体文件(TikTok/IG)必须在创建时校验大小与格式,避免发布时失败
- 防重复机制:Create接口必须加幂等键(Idempotency Key),否则重试即双发
- 异步解耦:MCP只负责创建排期,发布由服务端Job执行…
- 审批流工具化:Pending状态必须独立为Tool…
原文全文(已完整内嵌,无需跳转外网)
I run a small social scheduling SaaS on my own. A few months ago I shipped an MCP server so Claude, ChatGPT and Cursor could schedule posts through the same API the app uses. It is used for real now, roughly 700 to 800 connector calls a day at the CDN last week, none of them mine. What follows is the list of things that were different from the demo, in the order they bit. The agent does not know which account you meant. The moment a brand has two Facebook Pages or two LinkedIn orgs, & ;post this to LinkedIn& ; is ambiguous. Every post now has to carry one account id, and the tool description tells the agent to list accounts first and check that the account is still connected. Disconnected accounts were already the number one cause of failed posts for humans. Agents made it worse because they do not notice the red badge. Validate at create time, not at fire time. A scheduled post fails hours after the agent finished talking, and nobody is there to read the error. So media is required at create time on the platforms that need it (TikTok, YouTube, Instagram, Pinterest), even for drafts, the media type has to match the file, and size caps are enforced on upload. The agent gets the rejection while it can still fix it. Retries duplicate. Our create call has no idempotency key. If the transport drops and the agent retries, you get two scheduled posts. Listing and deleting posts are tools too, so the agent can clean up, but that is the honest gap and it is next on the list. Do not make the agent wait for the publish. The MCP call only creates the scheduled post; publishing runs later as a server job. A 200MB video never sits on the MCP transport, which is where every timeout report we saw came from. Approvals need to be a tool, not a dashboard. Posts can be created as pending approval, and either a person or the agent, via an approve call, moves them to approved. Nothing publishes while pending. Without this, teams turn the agent off after the first wrong post. Some platform limits should be enforced by you, not discovered by the agent. X charges far more for posts with links, so we cap link posts per month per plan. An agent that loves adding links hits the cap on purpose. Assistants quote your docs verbatim. When someone asks ChatGPT for a scheduler with an MCP server, the answer lists the vendors whose pages print the endpoint URL and the setup steps in plain text. Pages that describe the feature in marketing language are skipped. We rewrote ours accordingly, and it is the cheapest change on this list. Live-data features are hard to get through app-store revi
原文 · posts from indiehackers, SideProject, microsaas:阅读原文 →
相关工具推荐(推广):GLM Coding Plan — AI Coding Powered by G…