Developer Builds an MCP Server Used by Copilot and OpenCode
In a first-hand Juejin report, the author describes building a simple MCP Server with Node.js, TypeScript and the official MCP SDK, then registering a calculateSum tool for agent discovery and invocation. The same server was called successfully by GitHub Copilot and OpenCode, with the author checking actual tool-call records to confirm that OpenCode used calculateSum rather than simply calculating the answer itself. The report also explains MCP Host, Client and Server roles and compares MCP-based tool discovery with direct HTTP API access.
The report provides a concrete interoperability example in which one MCP tool implementation is reused across two AI applications, while also showing why execution records and tool permissions matter when working with agents.
前阵子一直听到 MCP 这个词,也知道它的全称是 Model Context Protocol,中文叫「模型上下文协议」。
但如果有人问我,MCP 到底是什么、用来解决什么问题、怎么实际使用?想了想,我还真说不清楚。
于是,我决定专门花点时间研究一下。
经过一番折腾,我不仅跑通了第一个 MCP Server,还自己开发了一个简单的工具,并成功让 GitHub Copilot 和 OpenCode 调用。
这里记录一下整个过程,也算给自己的调研做个总结。
一、先弄明白 MCP 是什么
刚接触 MCP 时,我最大的疑惑就是:它到底是干什么的?
#Model Context Protocol#GitHub Copilot#OpenCode#MCP SDK#MCP Inspector#VS Code#Node.js#TypeScript