Skip to content

Quickstart example fails #123

@atroyn

Description

@atroyn

Describe the bug
The quickstart example fails with the following error:

npm run mcp

...
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/mcp/index.ts:22:17 - error TS2339: Property 'name' does not exist on type 'RequestHandlerExtra'.

22   async (uri, { name }) => ({
                   ~~~~

    at createTSError (/Users/antontroynikov/Projects/CascadeProjects/panopticon/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/Users/antontroynikov/Projects/CascadeProjects/panopticon/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/Users/antontroynikov/Projects/CascadeProjects/panopticon/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/Users/antontroynikov/Projects/CascadeProjects/panopticon/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/Users/antontroynikov/Projects/CascadeProjects/panopticon/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/antontroynikov/Projects/CascadeProjects/panopticon/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:173:12) {
  diagnosticCodes: [ 2339 ]
}

RequestHandlerExtra does indeed have no such property:

export type RequestHandlerExtra = {

To Reproduce

Copy the v 1.3.0 quickstart example into an index.ts file, and then do npm run mcp

Expected behavior
The example should succesfully run.

Logs
If applicable, add logs to help explain your problem.

Additional context
Installed via npm install @modelcontextprotocol/sdk

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions