Skip to content

Impossible to instrument @modelcontextprotocol/sdk #187

@lforst

Description

@lforst

The @modelcontextprotocol/sdk package wants you to import stuff from "@modelcontextprotocol/sdk/server/mcp.js" like so:

import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";

This import resolves to node_modules/@modelcontextprotocol/dist/esm/sdk/server/mcp.js.

I cannot find a way to provide a module definition to new Hook() that will actually wrap the module.

It seems like we are always ending up in this branch

if (!baseDir.endsWith(specifiers.get(filename))) continue
and bailing the wrapping.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions