包子好玩
用Bun编译的简单本地stdio MCP服务器示例
安装依赖项
bun install连编可执行程序
bun run build添加到克劳德桌面
可执行文件:
{
...
"mcpServers": {
"example-mcp-server": {
"command": "
"
}
}
}发展:
{
...
"mcpServers": {
"example-mcp-server-dev": {
"command": "bun",
"args": ["run", "
"]
}
}
}视窗
- 配置:
%APPDATA%\Claude\claude_desktop_config.json - 可执行文件:
C:\\path\\to\\bun-fun\\mcp-server.exe - 发展:
C:\\path\\to\\bun-fun\\index.ts
macOS
- 配置:
~/Library/Application Support/Claude/claude_desktop_config.json - 可执行文件:
/path/to/bun-fun/mcp-server - 发展:
/path/to/bun-fun/index.ts
添加到克劳德代码
命令行界面
可执行文件:
claude mcp add example-mcp-server "
"发展:
claude mcp add example-mcp-server-dev "bun" --args "run" "
"视窗
- 可执行文件:
C:\\path\\to\\bun-fun\\mcp-server.exe - 发展:
C:\\path\\to\\bun-fun\\index.ts
macOS/Linux
- 可执行文件:
/path/to/bun-fun/mcp-server - 发展:
/path/to/bun-fun/index.ts
来自克劳德桌面
\[!注意\] 仅限macOS和WSL。
claude mcp add-from-claude-desktop大惊小怪
- \[\]IDE示例
可用的MCP工具
此服务器提供以下MCP工具:
get_current_time
以ISO格式返回当前时间。
参数: 无
示例响应: 2025-09-20T15:30:45.123Z
echo
回应提供的信息。
参数:
message(string,必填):要回显的消息
例子:
- 输入:
{ "message": "Hello, world!" } - 输出:
Echo: Hello, world!
add_numbers
将两个数字相加。
参数:
a(数字,必填):第一个数字b(数字,必填):第二个数字
例子:
- 输入:
{ "a": 5, "b": 3 } - 输出:
5 + 3 = 8
