mcp/server: add initial capability server option (#182)
This CL adds an option for servers to advertise support for features that have not been added yet. This includes Prompts, Tools, and Resources as these could be dynamically added after initialization. Fixes: #135.
This commit is contained in:
parent
a5aa370ea0
commit
2b6f7b5185
1 changed files with 29 additions and 3 deletions
|
|
@ -333,6 +333,22 @@ func TestServerCapabilities(t *testing.T) {
|
|||
Tools: &toolCapabilities{ListChanged: true},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "With initial capabilities",
|
||||
configureServer: func(s *Server) {},
|
||||
serverOpts: ServerOptions{
|
||||
HasPrompts: true,
|
||||
HasResources: true,
|
||||
HasTools: true,
|
||||
},
|
||||
wantCapabilities: &serverCapabilities{
|
||||
Completions: &completionCapabilities{},
|
||||
Logging: &loggingCapabilities{},
|
||||
Prompts: &promptCapabilities{ListChanged: true},
|
||||
Resources: &resourceCapabilities{ListChanged: true},
|
||||
Tools: &toolCapabilities{ListChanged: true},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
|
|
|||
Loading…
Reference in a new issue