forge-toolkit: хелперы для разработки MCP-серверов на Go. - toolkit: args/schema/result/env/probe/server - toolkit/validate: валидаторы синтаксиса - configreload: live-reload конфига по контент-хэшу - docs: ARCHITECTURE, quickstart, mcp-contract - template/ и examples/hello-tool/ - CI (Gitea Actions), лицензия Apache-2.0
25 lines
470 B
Go
25 lines
470 B
Go
// Command hello-tool — минимальный MCP-сервер на forge-toolkit.
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"example.com/hello-tool/internal/tools"
|
|
|
|
"git.totmin.ru/en2zmax/forge-toolkit"
|
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
|
)
|
|
|
|
func main() {
|
|
if toolkit.Health() {
|
|
return
|
|
}
|
|
if err := toolkit.Run("hello-tool", func(s *mcp.Server) {
|
|
tools.RegisterAll(s)
|
|
}); err != nil {
|
|
fmt.Fprintf(os.Stderr, "hello-tool: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|