chore(logging): removes custom handling
With the release of version 1.17.5 of the SDK, servers no longer need to have their own custom handler for the SetLevelRequestSchema. See https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/1.17.5.
This commit is contained in:
1 file changed
-11
@@ -1,6 +1,5 @@
|
||||
import tools from './tools/index.js';
|
||||
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { SetLevelRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
||||
import pkg from '../package.json' with { type: 'json' };
|
||||
import { isToolPermittedByUser } from './config.js';
|
||||
import { type SmitheryConfig, setOptions } from './config.js';
|
||||
@@ -28,16 +27,6 @@ export default function createMcpServer(options?: CreateMcpServerOptions): McpSe
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
mcpServer.server.assertCanSetRequestHandler(SetLevelRequestSchema.shape.method.value);
|
||||
mcpServer.server.setRequestHandler(SetLevelRequestSchema, () => ({}));
|
||||
} catch (error) {
|
||||
/**
|
||||
* An error here signifies native-handling of the SetLevel request.
|
||||
* See https://github.com/modelcontextprotocol/typescript-sdk/issues/871.
|
||||
*/
|
||||
}
|
||||
|
||||
for (const tool of Object.values(tools)) {
|
||||
// The user may have enabled/disabled this tool at runtime
|
||||
if (!isToolPermittedByUser(tool.name)) continue;
|
||||
|
||||
Reference in new issue
Block a user