server

command
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Command server 是 mcp-toolify 的完整组装示例:基座 + 唯一的内置插件 spill (大结果落盘)。

审计(audit)、配额(quota)、二次确认(confirm)都已移出本仓库,作为**外置插件** 的范例——任何插件都必须能以外部 module 的形式装进来,否则基座就悄悄给内置插件开了 特例。装它们的方式与这里一样:import 该 module 后按「外 → 内」的顺序各调一次 Install(推荐顺序见 README 的「插件顺序」一节)。

改了工具函数后重新生成 wrapper(生成物不入库,构建前现场生成):

go generate ./example/...

运行(token 鉴权是强制的,因此必须给配置文件):

go run ./example/cmd/server -addr :8011 -config ./example/conf/mcp.toml

试一次只读调用:

curl -sS localhost:8011 -H 'Authorization: Bearer replace-me-readonly' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"greeter.greet","arguments":{"name":"world","excited":true}}}'

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL