MCP: add request logging (#23216)

This commit is contained in:
andig 2025-08-24 12:42:36 +02:00 • committed by GitHub
parent f775e9d7a4
commit b131838117
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 8 deletions

View file

@ -254,13 +254,11 @@ func runRoot(cmd *cobra.Command, args []string) {
// setup MCP
if viper.GetBool("mcp") {
const path = "/mcp"
local := conf.Network.URI()
router := httpd.Router()
var handler http.Handler
if handler, err = mcp.NewHandler(router, local, path); err == nil {
router.PathPrefix(path).Handler(handler)
if handler, err = mcp.NewHandler(router); err == nil {
router.PathPrefix("/mcp").Handler(handler)
}
}