用 mcp-use SDK 一晚搭出 ChatGPT 内嵌面板的 MCP
作者实测 mcp-use SDK:一个文件搞定类型化工具和 ChatGPT 内嵌 React 面板,但云层托管和恶意版本标记是坑。

I built an MCP server on someone else's SDK in an evening — and found where the SDK ends. mcp-use, by @mcp_use / @manufact (Y Combinator S25, $6.3M seed), strips out the protocol plumbing: typed tools, interactive panels that render inside ChatGPT and Claude, a traffic inspector. ~10.7k stars, 41k downloads last week — and two snags ate half a day, with all the real mechanics still on my side. How it works. An MCPServer object declares tools with input and output schemas (zod). A tool's View, written in React, renders as its answer inside the chat. You run the server over HTTP or mcp-use dev, debug it in a browser inspector, and the cloud layer adds hosting, logs, and cross-client checks. I built a demo server with two live tools — recent posts from our publish log, and knowledge-graph stats (494 entities / 475 edges). HTTP MCP on localhost, client connect, both calls passed. The SDK genuinely eats the boilerplate: one file, and I never wrote a line of the protocol by hand. Confirmed: - Assembly: one npm package, 51 deps, a working tool handler in a single file; initialize → tools/list → call with zero hand-written protocol plumbing. - The inspector and type safety catch schema mistakes before runtime, not after. - Views-as-tool-output is the interesting part: the product's interface lives inside the chat, no separate UI to build. Rejected (not for us): - The cloud layer: our agents run private sessions against account credentials — that traffic doesn't go into someone else's hosting. The inspector routes MCP traffic to their servers by design. - Versions 1.4.2 and 1.4.3 of the package are flagged malicious in the OSSF registry. Pin the version, every time. Honest limits: - TypeScript-first. There is a Python branch, but it is noticeably thinner — Python callers connect over HTTP transport rather than the SDK. - The SDK covers "how to declare and serve," not "how to reach the service underneath." Transport, rate limits, anti-bot defenses — still all yours. - Two snags cost me half a day: top-level await requires "type": "module", and a tool with an output schema must return structuredContent — a perfectly valid text-only reply fails validation. - The standard moves faster than the docs: protocolVersion 2025-06-18, and parts of the documentation lag behind code 2.7.3. The verdict: mcp-use saves the understandable hours — protocol plumbing, schemas, debugging. Beyond that begins your own mechanics, and there the library is not a helper. Useful as a foundation; not enough if a live service with captchas and rate limits sits under your tool. Building in public. 🤖