Files
forge-toolkit/template/main.go
T
Maksim Totmin c398045664
ci / test (push) Failing after 5s
ci / lint (push) Failing after 4s
chore: initial release v0.1.0
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
2026-09-14 00:23:08 +07:00

43 lines
1.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Command forge-tool — каркас MCP-сервера на forge-toolkit.
//
// Скопируй каталог, переименуй модуль (go.mod) и замени доменную логику в
// internal/tools на свою. Точка входа — toolkit.Health (дешёвый --health) и
// toolkit.Run (stdio-цикл с graceful shutdown).
package main
import (
"flag"
"fmt"
"os"
"example.com/forge-tool/internal/tools"
"git.totmin.ru/en2zmax/forge-toolkit"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
func main() {
if toolkit.Health() {
return
}
configPath := flag.String("config", "config.json", "путь к config.json")
flag.Parse()
cfg, err := tools.LoadConfig(*configPath)
if err != nil {
fmt.Fprintf(os.Stderr, "forge-tool: config: %v\n", err)
os.Exit(1)
}
mgr := tools.NewManager(cfg)
defer mgr.Close()
if err := toolkit.Run("forge-tool", func(s *mcp.Server) {
tools.RegisterAll(s, mgr)
}); err != nil {
fmt.Fprintf(os.Stderr, "forge-tool: %v\n", err)
os.Exit(1)
}
}