File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 6
6
"main" : " index.ts" ,
7
7
"scripts" : {
8
8
"typecheck" : " tsc --noEmit" ,
9
- "build" : " pnpm typecheck && tsc" ,
9
+ "build" : " pnpm typecheck && tsc && cp package.json dist/package.json " ,
10
10
"start" : " node dist/index.js" ,
11
11
"start:stdio" : " MCP_TRANSPORT_MODE=stdio pnpm start" ,
12
12
"start:sse" : " MCP_TRANSPORT_MODE=sse pnpm start" ,
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ import { DEFAULT_GATEWAY_URL } from './config.js';
20
20
import { Principal } from '@ucanto/interface' ;
21
21
import { DID } from '@ucanto/core' ;
22
22
import { readFileSync } from 'fs' ;
23
- import { join } from 'path' ;
23
+ import { join , dirname } from 'path' ;
24
+ import { fileURLToPath } from 'url' ;
24
25
import { parseIpfsPath , streamToBase64 , base64ToBytes } from './utils.js' ;
25
26
import { CID , UnknownLink } from 'multiformats' ;
26
27
import { CarReader } from '@ipld/car' ;
@@ -32,7 +33,10 @@ import { Readable } from 'node:stream';
32
33
*/
33
34
const STORAGE_SERVICE_DID = 'did:web:web3.storage' ;
34
35
35
- const packageJson = JSON . parse ( readFileSync ( join ( process . cwd ( ) , 'package.json' ) , 'utf-8' ) ) ;
36
+ const __filename = fileURLToPath ( import . meta. url ) ;
37
+ const __dirname = dirname ( __filename ) ;
38
+ const rootDir = join ( __dirname , '../../..' ) ;
39
+ const packageJson = JSON . parse ( readFileSync ( join ( rootDir , 'package.json' ) , 'utf-8' ) ) ;
36
40
37
41
/**
38
42
* Add the major version of the MCP server to the headers of the Storacha client.
You can’t perform that action at this time.
0 commit comments