Skip to content

Commit 6472c31

Browse files
chore: A round of "yarn fix" for everyone (modelcontextprotocol#75)
1 parent 4d113b5 commit 6472c31

File tree

11 files changed

+58
-42
lines changed

11 files changed

+58
-42
lines changed

CLI.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,10 @@ dxt unsign my-extension.dxt
157157
For signing extensions, you need:
158158

159159
1. **Certificate**: X.509 certificate in PEM format
160-
161160
- Should have Code Signing extended key usage
162161
- Can be self-signed (for development) or CA-issued (for production)
163162

164163
2. **Private Key**: Corresponding private key in PEM format
165-
166164
- Must match the certificate's public key
167165

168166
3. **Intermediate Certificates** (optional): For CA-issued certificates

MANIFEST.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,12 @@ The `server` object defines how to run the MCP server:
290290
### Server Types
291291

292292
1. **Python**: `server.type = "python"`
293-
294293
- Requires `entry_point` to Python file
295294
- All dependencies must be bundled in the DXT
296295
- Can use `server/lib` for packages or `server/venv` for full virtual environment
297296
- Python runtime version specified in `compatibility.runtimes.python`
298297

299298
2. **Node.js**: `server.type = "node"`
300-
301299
- Requires `entry_point` to JavaScript file
302300
- All dependencies must be bundled in `node_modules`
303301
- Node.js runtime version specified in `compatibility.runtimes.node`

examples/file-system-node/manifest.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@
7171
]
7272
}
7373
},
74-
"keywords": [
75-
"api",
76-
"automation",
77-
"productivity"
78-
],
74+
"keywords": ["api", "automation", "productivity"],
7975
"license": "MIT",
8076
"compatibility": {
8177
"claude_desktop": ">=0.10.0",
@@ -94,4 +90,4 @@
9490
"default": []
9591
}
9692
}
97-
}
93+
}

examples/file-system-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"dependencies": {
88
"@modelcontextprotocol/server-filesystem": "2025.1.14"
99
}
10-
}
10+
}

examples/file-system-node/server/index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@ const loadServer = async () => {
1313
try {
1414
// Save original argv
1515
const originalArgv = process.argv;
16-
16+
1717
// The filesystem server expects directories as command line arguments
1818
process.argv = [process.argv[0], process.argv[1], ...args];
19-
19+
2020
// Dynamically import the ESM module
21-
await import('@modelcontextprotocol/server-filesystem/dist/index.js');
22-
21+
await import("@modelcontextprotocol/server-filesystem/dist/index.js");
22+
2323
// Restore original argv
2424
process.argv = originalArgv;
2525
} catch (error) {
26-
console.error('Failed to load @modelcontextprotocol/server-filesystem:', error);
26+
console.error(
27+
"Failed to load @modelcontextprotocol/server-filesystem:",
28+
error,
29+
);
2730
process.exit(1);
2831
}
2932
};
3033

3134
// Execute the async function
32-
loadServer();
35+
loadServer();

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
"^.+\\.ts$": [
99
"ts-jest",
1010
{
11-
tsConfig: 'tsconfig.test.json'
11+
tsConfig: "tsconfig.test.json",
1212
},
1313
],
1414
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,6 @@
7878
"resolutions": {
7979
"@babel/helpers": "7.27.1",
8080
"@babel/parser": "7.27.3"
81-
}
81+
},
82+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
8283
}

scripts/build-dxt-schema.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import fs from "node:fs/promises";
44
import path from "node:path";
55

66
const schemasToWrite = {
7-
'dxt-manifest': DxtManifestSchema,
8-
'dxt-signature-info': DxtSignatureInfoSchema
9-
}
7+
"dxt-manifest": DxtManifestSchema,
8+
"dxt-signature-info": DxtSignatureInfoSchema,
9+
};
1010

1111
await fs.mkdir(path.join(import.meta.dirname, "../dist"), { recursive: true });
1212

@@ -20,4 +20,3 @@ for (const key in schemasToWrite) {
2020
},
2121
);
2222
}
23-

src/cli/unpack.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { unzipSync } from "fflate";
2-
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
2+
import {
3+
chmodSync,
4+
existsSync,
5+
mkdirSync,
6+
readFileSync,
7+
writeFileSync,
8+
} from "fs";
39
import { join, resolve, sep } from "path";
410

511
import { extractSignatureBlock } from "../node/sign.js";
@@ -41,7 +47,7 @@ export async function unpackExtension({
4147
if (isUnix) {
4248
// Parse ZIP central directory to extract file attributes
4349
const zipBuffer = originalContent;
44-
50+
4551
// Find end of central directory record
4652
let eocdOffset = -1;
4753
for (let i = zipBuffer.length - 22; i >= 0; i--) {
@@ -54,21 +60,25 @@ export async function unpackExtension({
5460
if (eocdOffset !== -1) {
5561
const centralDirOffset = zipBuffer.readUInt32LE(eocdOffset + 16);
5662
const centralDirEntries = zipBuffer.readUInt16LE(eocdOffset + 8);
57-
63+
5864
let offset = centralDirOffset;
59-
65+
6066
for (let i = 0; i < centralDirEntries; i++) {
6167
if (zipBuffer.readUInt32LE(offset) === 0x02014b50) {
6268
const externalAttrs = zipBuffer.readUInt32LE(offset + 38);
6369
const filenameLength = zipBuffer.readUInt16LE(offset + 28);
64-
const filename = zipBuffer.toString('utf8', offset + 46, offset + 46 + filenameLength);
65-
70+
const filename = zipBuffer.toString(
71+
"utf8",
72+
offset + 46,
73+
offset + 46 + filenameLength,
74+
);
75+
6676
// Extract Unix permissions from external attributes (upper 16 bits)
6777
const mode = (externalAttrs >> 16) & 0o777;
6878
if (mode > 0) {
6979
fileAttributes.set(filename, mode);
7080
}
71-
81+
7282
const extraFieldLength = zipBuffer.readUInt16LE(offset + 30);
7383
const commentLength = zipBuffer.readUInt16LE(offset + 32);
7484
offset += 46 + filenameLength + extraFieldLength + commentLength;

test/cli.test.ts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,13 @@ describe("DXT CLI", () => {
204204
},
205205
}),
206206
);
207-
207+
208208
// Create an executable script
209209
const executableScript = join(tempExecDir, "run-script.sh");
210-
fs.writeFileSync(executableScript, "#!/bin/bash\necho 'Hello from executable'");
210+
fs.writeFileSync(
211+
executableScript,
212+
"#!/bin/bash\necho 'Hello from executable'",
213+
);
211214
fs.chmodSync(executableScript, 0o755); // Make it executable
212215

213216
// Create a regular file for comparison
@@ -221,25 +224,33 @@ describe("DXT CLI", () => {
221224
});
222225

223226
// Unpack the extension
224-
execSync(`node ${cliPath} unpack ${execPackedFilePath} ${execUnpackedDir}`, {
225-
encoding: "utf-8",
226-
});
227+
execSync(
228+
`node ${cliPath} unpack ${execPackedFilePath} ${execUnpackedDir}`,
229+
{
230+
encoding: "utf-8",
231+
},
232+
);
227233

228234
// Check that the executable file preserved its permissions
229235
const originalStats = fs.statSync(executableScript);
230-
const unpackedStats = fs.statSync(join(execUnpackedDir, "run-script.sh"));
231-
236+
const unpackedStats = fs.statSync(
237+
join(execUnpackedDir, "run-script.sh"),
238+
);
239+
232240
// Check that executable permissions are preserved (0o755)
233241
expect(unpackedStats.mode & 0o777).toBe(0o755);
234242
expect(originalStats.mode & 0o777).toBe(unpackedStats.mode & 0o777);
235243

236244
// Check that regular file permissions are preserved (0o644)
237245
const originalRegularStats = fs.statSync(regularFile);
238-
const unpackedRegularStats = fs.statSync(join(execUnpackedDir, "regular-file.txt"));
239-
240-
expect(unpackedRegularStats.mode & 0o777).toBe(0o644);
241-
expect(originalRegularStats.mode & 0o777).toBe(unpackedRegularStats.mode & 0o777);
246+
const unpackedRegularStats = fs.statSync(
247+
join(execUnpackedDir, "regular-file.txt"),
248+
);
242249

250+
expect(unpackedRegularStats.mode & 0o777).toBe(0o644);
251+
expect(originalRegularStats.mode & 0o777).toBe(
252+
unpackedRegularStats.mode & 0o777,
253+
);
243254
} finally {
244255
// Clean up
245256
fs.rmSync(tempExecDir, { recursive: true, force: true });

0 commit comments

Comments
 (0)