Adds a POST /mcp endpoint (github.com/modelcontextprotocol/go-sdk) with
three tools mirroring the existing /calendar logic: get_calendar_today,
get_calendar_for_date and get_holidays. Bumps go.mod to Go 1.25 (required
by the SDK) and vendors the new dependencies. Also fixes an unanchored
.gitignore rule ("domogeek") that was silently excluding all untracked
files under cmd/domogeek/.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu8wwahgecuCGfesTKCfEd
33 lines
640 B
Go
33 lines
640 B
Go
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
|
|
// Use of this source code is governed by the license
|
|
// that can be found in the LICENSE file.
|
|
|
|
// Package json provides internal JSON utilities.
|
|
|
|
package json
|
|
|
|
import (
|
|
"bytes"
|
|
"io"
|
|
|
|
"github.com/segmentio/encoding/json"
|
|
)
|
|
|
|
type Decoder struct {
|
|
dec *json.Decoder
|
|
}
|
|
|
|
func NewDecoder(r io.Reader) *Decoder {
|
|
dec := json.NewDecoder(r)
|
|
dec.DontMatchCaseInsensitiveStructFields()
|
|
return &Decoder{dec: dec}
|
|
}
|
|
|
|
func (d *Decoder) Decode(v any) error {
|
|
return d.dec.Decode(v)
|
|
}
|
|
|
|
func Unmarshal(data []byte, v any) error {
|
|
return NewDecoder(bytes.NewReader(data)).Decode(v)
|
|
}
|