Skip to content

Commit 9f39a43

Browse files
committed
Merge branch 'main' of github.com:mark3labs/mcp-go
2 parents dd7dcc5 + 4033730 commit 9f39a43

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ func (s *MCPServer) AddTools(tools ...ServerTool) {
492492
// SetTools replaces all existing tools with the provided list
493493
func (s *MCPServer) SetTools(tools ...ServerTool) {
494494
s.toolsMu.Lock()
495-
s.tools = make(map[string]ServerTool)
495+
s.tools = make(map[string]ServerTool, len(tools))
496496
s.toolsMu.Unlock()
497497
s.AddTools(tools...)
498498
}
@@ -714,7 +714,7 @@ func (s *MCPServer) handleReadResource(
714714
matched = true
715715
matchedVars := template.URITemplate.Match(request.Params.URI)
716716
// Convert matched variables to a map
717-
request.Params.Arguments = make(map[string]interface{})
717+
request.Params.Arguments = make(map[string]interface{}, len(matchedVars))
718718
for name, value := range matchedVars {
719719
request.Params.Arguments[name] = value.V
720720
}

server/sse.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ func NewSSEServer(server *MCPServer, opts ...SSEOption) *SSEServer {
179179

180180
// NewTestServer creates a test server for testing purposes
181181
func NewTestServer(server *MCPServer, opts ...SSEOption) *httptest.Server {
182-
sseServer := NewSSEServer(server)
183-
for _, opt := range opts {
184-
opt(sseServer)
185-
}
182+
sseServer := NewSSEServer(server, opts...)
186183

187184
testServer := httptest.NewServer(sseServer)
188185
sseServer.baseURL = testServer.URL

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy