Skip to content

Commit 313f9bd

Browse files
committed
Merge branch 'fix/require-package-json'
2 parents 39f1270 + 8d909b2 commit 313f9bd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/lib/coordination.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { EventEmitter } from 'events'
33
import { Server } from 'http'
44
import express from 'express'
55
import { AddressInfo } from 'net'
6+
import { unlinkSync } from 'fs'
67
import { log, debugLog, DEBUG, setupOAuthCallbackServerWithLongPoll } from './utils'
78

89
export type AuthCoordinator = {
@@ -263,7 +264,7 @@ export async function coordinateAuth(
263264
try {
264265
// Synchronous version for 'exit' event since we can't use async here
265266
const configPath = getConfigFilePath(serverUrlHash, 'lock.json')
266-
require('fs').unlinkSync(configPath)
267+
unlinkSync(configPath)
267268
if (DEBUG) console.error(`[DEBUG] Removed lockfile on exit: ${configPath}`)
268269
} catch (error) {
269270
if (DEBUG) console.error(`[DEBUG] Error removing lockfile on exit:`, error)

src/lib/utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import crypto from 'crypto'
1212
import fs, { readFile } from 'fs/promises'
1313
import path from 'path'
1414
import os from 'os'
15+
import { version as MCP_REMOTE_VERSION } from '../../package.json'
1516

1617
// Global type declaration for typescript
1718
declare global {
@@ -24,9 +25,7 @@ export const REASON_TRANSPORT_FALLBACK = 'falling-back-to-alternate-transport'
2425

2526
// Transport strategy types
2627
export type TransportStrategy = 'sse-only' | 'http-only' | 'sse-first' | 'http-first'
27-
28-
// Package version from package.json
29-
export const MCP_REMOTE_VERSION = require('../../package.json').version
28+
export { MCP_REMOTE_VERSION }
3029

3130
const pid = process.pid
3231
// Global debug flag

src/proxy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
parseCommandLineArgs,
1919
setupSignalHandlers,
2020
getServerUrlHash,
21-
MCP_REMOTE_VERSION,
2221
TransportStrategy,
2322
} from './lib/utils'
2423
import { StaticOAuthClientInformationFull, StaticOAuthClientMetadata } from './lib/types'

0 commit comments

Comments
 (0)