Skip to content

Commit 685ce68

Browse files
committed
Bump mcp-go to v0.42.0 (#220)
1 parent 554773b commit 685ce68

File tree

5 files changed

+15
-42
lines changed

5 files changed

+15
-42
lines changed

NOTICE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
289289

290290

291291

292-
## github.com/mark3labs/mcp-go (v0.41.1)
292+
## github.com/mark3labs/mcp-go (v0.42.0)
293293

294-
License: [MIT](https://github.com/mark3labs/mcp-go/blob/v0.41.1/LICENSE)
294+
License: [MIT](https://github.com/mark3labs/mcp-go/blob/v0.42.0/LICENSE)
295295

296296
MIT License
297297

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/go-chi/chi/v5 v5.2.3
99
github.com/go-chi/cors v1.2.2
1010
github.com/hashicorp/go-hclog v1.6.3
11-
github.com/mark3labs/mcp-go v0.41.1
11+
github.com/mark3labs/mcp-go v0.42.0
1212
github.com/mozilla-ai/mcpd-plugins-sdk-go v0.0.2
1313
github.com/spf13/cobra v1.10.1
1414
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
4646
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
4747
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
4848
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
49-
github.com/mark3labs/mcp-go v0.41.1 h1:w78eWfiQam2i8ICL7AL0WFiq7KHNJQ6UB53ZVtH4KGA=
50-
github.com/mark3labs/mcp-go v0.41.1/go.mod h1:T7tUa2jO6MavG+3P25Oy/jR7iCeJPHImCZHRymCn39g=
49+
github.com/mark3labs/mcp-go v0.42.0 h1:gk/8nYJh8t3yroCAOBhNbYsM9TCKvkM13I5t5Hfu6Ls=
50+
github.com/mark3labs/mcp-go v0.42.0/go.mod h1:YnJfOL382MIWDx1kMY+2zsRHU/q78dBg9aFb8W6Thdw=
5151
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
5252
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
5353
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=

internal/api/mcp.go

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package api
22

3-
import "github.com/mark3labs/mcp-go/mcp"
3+
import (
4+
"maps"
5+
6+
"github.com/mark3labs/mcp-go/mcp"
7+
)
48

59
// DomainMeta wraps mcp.Meta for API conversion.
610
type DomainMeta mcp.Meta
@@ -13,25 +17,10 @@ type Meta map[string]any
1317
// Returns empty Meta{} if domain type is nil.
1418
// See: https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta
1519
func (d DomainMeta) ToAPIType() (Meta, error) {
16-
if (*mcp.Meta)(&d) == nil {
20+
m := (*mcp.Meta)(&d)
21+
if m == nil || m.AdditionalFields == nil {
1722
return Meta{}, nil
1823
}
1924

20-
// The _meta field is MCP's reserved extensibility mechanism that allows both:
21-
// - progressToken: for out-of-band progress notifications (defined by spec)
22-
// - Additional fields: custom metadata from servers/clients (extensible)
23-
// Both types of fields are merged at the same level in the resulting map.
24-
result := make(Meta)
25-
26-
// Add progressToken if present (using MCP spec-defined field name).
27-
if d.ProgressToken != nil {
28-
result["progressToken"] = d.ProgressToken
29-
}
30-
31-
// Merge additional fields at the same level.
32-
for k, v := range d.AdditionalFields {
33-
result[k] = v
34-
}
35-
36-
return result, nil
25+
return maps.Clone(m.AdditionalFields), nil
3726
}

internal/api/resources.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -296,34 +296,18 @@ func handleServerResourceContent(
296296
for _, content := range result.Contents {
297297
switch c := content.(type) {
298298
case mcp.TextResourceContents:
299-
var meta Meta
300-
if c.Meta != nil {
301-
var err error
302-
meta, err = DomainMeta(*c.Meta).ToAPIType()
303-
if err != nil {
304-
return nil, err
305-
}
306-
}
307299
contents = append(contents, ResourceContent{
308300
URI: c.URI,
309301
MIMEType: c.MIMEType,
310302
Text: c.Text,
311-
Meta: meta,
303+
Meta: c.Meta,
312304
})
313305
case mcp.BlobResourceContents:
314-
var meta Meta
315-
if c.Meta != nil {
316-
var err error
317-
meta, err = DomainMeta(*c.Meta).ToAPIType()
318-
if err != nil {
319-
return nil, err
320-
}
321-
}
322306
contents = append(contents, ResourceContent{
323307
URI: c.URI,
324308
MIMEType: c.MIMEType,
325309
Blob: c.Blob,
326-
Meta: meta,
310+
Meta: c.Meta,
327311
})
328312
}
329313
}

0 commit comments

Comments
 (0)