MCP is failing because of typescript #413

Closed
opened 2026-04-05 16:19:38 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @slavaGanzin on 7/24/2025

Describe the bug
Hi there tried to launch mcp, and got various errors:

From npm:

$ npm install -g typescript@latest

changed 1 package in 876ms


$ oneuptime-mcp --version

~/oneuptime/MCP/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:1:28 - error TS2307: Cannot find module 'Common/Models/DatabaseModels/Index' or its corresponding type declarations.

1 import DatabaseModels from "Common/Models/DatabaseModels/Index";
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:2:29 - error TS2307: Cannot find module 'Common/Models/AnalyticsModels/Index' or its corresponding type declarations.

2 import AnalyticsModels from "Common/Models/AnalyticsModels/Index";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:3:31 - error TS2307: Cannot find module 'Common/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel' or its corresponding type declarations.

3 import DatabaseBaseModel from "Common/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:4:32 - error TS2307: Cannot find module 'Common/Models/AnalyticsModels/AnalyticsBaseModel/AnalyticsBaseModel' or its corresponding type declarations.

4 import AnalyticsBaseModel from "Common/Models/AnalyticsModels/AnalyticsBaseModel/AnalyticsBaseModel";
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:8:46 - error TS2307: Cannot find module 'Common/Utils/Schema/ModelSchema' or its corresponding type declarations.

8 import { ModelSchema, ModelSchemaType } from "Common/Utils/Schema/ModelSchema";
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:12:8 - error TS2307: Cannot find module 'Common/Utils/Schema/AnalyticsModelSchema' or its corresponding type declarations.

12 } from "Common/Utils/Schema/AnalyticsModelSchema";
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:388:9 - error TS2375: Type '{ tableName: string; singularName: string; pluralName: string; modelType: ModelType.Analytics; apiPath: string | undefined; }' is not assignable to type '{ tableName: string; singularName: string; pluralName: string; modelType: ModelType; apiPath?: string; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'apiPath' are incompatible.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

388         modelInfo: {
            ~~~~~~~~~

  ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Types/McpTypes.ts:19:3
    19   modelInfo: {
         ~~~~~~~~~
    The expected type comes from property 'modelInfo' which is declared here on type 'ModelToolsResult'

...

  diagnosticCodes: [
    2307, 2307,
    2307, 2307,
    2307, 2307,
    2375
  ]
}


From source:

git clone https://github.com/OneUptime/oneuptime.git
              cd oneuptime

              # Generate the MCP server
              cd MCP


              # Install dependencies
              npm install && npm link

              # This should now execute
              oneuptime-mcp --version
Cloning into 'oneuptime'...
remote: Enumerating objects: 363614, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 363614 (delta 27), reused 20 (delta 16), pack-reused 363568 (from 3)
Receiving objects: 100% (363614/363614), 469.00 MiB | 34.44 MiB/s, done.
Resolving deltas: 100% (284743/284743), done.

added 358 packages, and audited 1556 packages in 4s

241 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (1 low, 6 moderate, 6 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

changed 1 package, and audited 3 packages in 1s

found 0 vulnerabilities
/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
../Common/Models/DatabaseModels/AcmeCertificate.ts:12:62 - error TS2307: Cannot find module 'typeorm' or its corresponding type declarations.

12 import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
                                                                ~~~~~~~~~

    at createTSError (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1617:30)
    at loadTS (node:internal/modules/cjs/loader:1826:10)
    at Object.require.extensions.<computed> [as .ts] (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1469:32)
    at Module._load (node:internal/modules/cjs/loader:1286:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14) {
  diagnosticCodes: [ 2307 ]
}

Env

$ uname -a
Darwin m 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8112 x86_64

$ node -v
v24.1.0

$ tsc -v
Version 5.8.3
*Originally created by @slavaGanzin on 7/24/2025* **Describe the bug** Hi there tried to launch mcp, and got various errors: From npm: ```bash $ npm install -g typescript@latest changed 1 package in 876ms $ oneuptime-mcp --version ~/oneuptime/MCP/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:1:28 - error TS2307: Cannot find module 'Common/Models/DatabaseModels/Index' or its corresponding type declarations. 1 import DatabaseModels from "Common/Models/DatabaseModels/Index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:2:29 - error TS2307: Cannot find module 'Common/Models/AnalyticsModels/Index' or its corresponding type declarations. 2 import AnalyticsModels from "Common/Models/AnalyticsModels/Index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:3:31 - error TS2307: Cannot find module 'Common/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel' or its corresponding type declarations. 3 import DatabaseBaseModel from "Common/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:4:32 - error TS2307: Cannot find module 'Common/Models/AnalyticsModels/AnalyticsBaseModel/AnalyticsBaseModel' or its corresponding type declarations. 4 import AnalyticsBaseModel from "Common/Models/AnalyticsModels/AnalyticsBaseModel/AnalyticsBaseModel"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:8:46 - error TS2307: Cannot find module 'Common/Utils/Schema/ModelSchema' or its corresponding type declarations. 8 import { ModelSchema, ModelSchemaType } from "Common/Utils/Schema/ModelSchema"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:12:8 - error TS2307: Cannot find module 'Common/Utils/Schema/AnalyticsModelSchema' or its corresponding type declarations. 12 } from "Common/Utils/Schema/AnalyticsModelSchema"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Utils/DynamicToolGenerator.ts:388:9 - error TS2375: Type '{ tableName: string; singularName: string; pluralName: string; modelType: ModelType.Analytics; apiPath: string | undefined; }' is not assignable to type '{ tableName: string; singularName: string; pluralName: string; modelType: ModelType; apiPath?: string; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties. Types of property 'apiPath' are incompatible. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. 388 modelInfo: { ~~~~~~~~~ ../../../../../../../usr/local/lib/node_modules/@oneuptime/mcp-server/Types/McpTypes.ts:19:3 19 modelInfo: { ~~~~~~~~~ The expected type comes from property 'modelInfo' which is declared here on type 'ModelToolsResult' ... diagnosticCodes: [ 2307, 2307, 2307, 2307, 2307, 2307, 2375 ] } ``` From source: ```bash git clone https://github.com/OneUptime/oneuptime.git cd oneuptime # Generate the MCP server cd MCP # Install dependencies npm install && npm link # This should now execute oneuptime-mcp --version Cloning into 'oneuptime'... remote: Enumerating objects: 363614, done. remote: Counting objects: 100% (46/46), done. remote: Compressing objects: 100% (30/30), done. remote: Total 363614 (delta 27), reused 20 (delta 16), pack-reused 363568 (from 3) Receiving objects: 100% (363614/363614), 469.00 MiB | 34.44 MiB/s, done. Resolving deltas: 100% (284743/284743), done. added 358 packages, and audited 1556 packages in 4s 241 packages are looking for funding run `npm fund` for details 14 vulnerabilities (1 low, 6 moderate, 6 high, 1 critical) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. changed 1 package, and audited 3 packages in 1s found 0 vulnerabilities /private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: ../Common/Models/DatabaseModels/AcmeCertificate.ts:12:62 - error TS2307: Cannot find module 'typeorm' or its corresponding type declarations. 12 import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm"; ~~~~~~~~~ at createTSError (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:859:12) at reportTSError (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:863:19) at getOutput (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1077:36) at Object.compile (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1433:41) at Module.m._compile (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1617:30) at loadTS (node:internal/modules/cjs/loader:1826:10) at Object.require.extensions.<computed> [as .ts] (/private/tmp/oneuptime/MCP/node_modules/ts-node/src/index.ts:1621:12) at Module.load (node:internal/modules/cjs/loader:1469:32) at Module._load (node:internal/modules/cjs/loader:1286:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) { diagnosticCodes: [ 2307 ] } ``` Env ```bash $ uname -a Darwin m 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8112 x86_64 $ node -v v24.1.0 $ tsc -v Version 5.8.3 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#413