Skip to content

Commit 6acc16b

Browse files
committed
chore: upgrade github.com/modelcontextprotocol/go-sdk
1 parent 6233fd5 commit 6acc16b

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.24.0
44

55
require (
66
github.com/getkin/kin-openapi v0.133.0
7-
github.com/google/jsonschema-go v0.2.1-0.20250828145618-7d3a7746ff83
8-
github.com/modelcontextprotocol/go-sdk v0.4.0
7+
github.com/google/jsonschema-go v0.2.3
8+
github.com/modelcontextprotocol/go-sdk v0.6.0
99
go.yaml.in/yaml/v3 v3.0.4
1010
)
1111

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
1010
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
1111
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
1212
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
13-
github.com/google/jsonschema-go v0.2.1-0.20250828145618-7d3a7746ff83 h1:LYZft4tK/R6x6vqNemVJHsDkOtBZFhJh8mFWGyaDAfE=
14-
github.com/google/jsonschema-go v0.2.1-0.20250828145618-7d3a7746ff83/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
13+
github.com/google/jsonschema-go v0.2.3 h1:dkP3B96OtZKKFvdrUSaDkL+YDx8Uw9uC4Y+eukpCnmM=
14+
github.com/google/jsonschema-go v0.2.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
1515
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
1616
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
1717
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@@ -20,8 +20,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
2020
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
2121
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
2222
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
23-
github.com/modelcontextprotocol/go-sdk v0.4.0 h1:RJ6kFlneHqzTKPzlQqiunrz9nbudSZcYLmLHLsokfoU=
24-
github.com/modelcontextprotocol/go-sdk v0.4.0/go.mod h1:whv0wHnsTphwq7CTiKYHkLtwLC06WMoY2KpO+RB9yXQ=
23+
github.com/modelcontextprotocol/go-sdk v0.6.0 h1:cmtMYfRAUtEtCiuorOWPj7ygcypfuB2FgFEDBqZqgy4=
24+
github.com/modelcontextprotocol/go-sdk v0.6.0/go.mod h1:djQKZ74bEV+UMAmyG/L0coVhV0HM3fpVtGuUPls0znc=
2525
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
2626
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
2727
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY=

server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func ServeHTTP(server *mcp.Server, addr string, basePath string) error {
6464
basePath = "/mcp"
6565
}
6666

67-
handler := mcp.NewSSEHandler(func(r *http.Request) *mcp.Server { return server })
67+
handler := mcp.NewSSEHandler(func(r *http.Request) *mcp.Server { return server }, nil)
6868
return http.ListenAndServe(addr, handler)
6969
}
7070

@@ -134,7 +134,7 @@ func normalizeAddrToHost(addr string) string {
134134
// handler := openapi2mcp.HandlerForBasePath(srv, "/petstore")
135135
// mux.Handle("/petstore/", handler)
136136
func HandlerForBasePath(server *mcp.Server, basePath string) http.Handler {
137-
return mcp.NewSSEHandler(func(r *http.Request) *mcp.Server { return server })
137+
return mcp.NewSSEHandler(func(r *http.Request) *mcp.Server { return server }, nil)
138138
}
139139

140140
// ServeStreamableHTTP starts the MCP server using HTTP StreamableHTTP (wraps mcpserver.NewStreamableHTTPServer and Start).

spec.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
package openapi2mcp
33

44
import (
5+
"errors"
56
"fmt"
67
"os"
78
"regexp"
@@ -102,7 +103,7 @@ func generateAIOpenAPILoadError(operation, path string, originalErr error) error
102103
response.WriteString(" description: OK\n")
103104
response.WriteString("```\n")
104105

105-
return fmt.Errorf(response.String())
106+
return errors.New(response.String())
106107
}
107108

108109
// LoadOpenAPISpec loads and parses an OpenAPI YAML or JSON file from the given path.

0 commit comments

Comments
 (0)