@mctx-ai/mcp-dev 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/package.json +11 -7
  2. package/src/server.js +2 -85
  3. package/LICENSE +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mctx-ai/mcp-dev",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Local development server for @mctx-ai/mcp-server with hot reload",
5
5
  "type": "module",
6
6
  "main": "./src/cli.js",
@@ -13,6 +13,10 @@
13
13
  "files": [
14
14
  "src"
15
15
  ],
16
+ "scripts": {
17
+ "test": "node --test",
18
+ "lint": "echo 'Linting not configured yet'"
19
+ },
16
20
  "keywords": [
17
21
  "mcp",
18
22
  "model-context-protocol",
@@ -31,11 +35,11 @@
31
35
  "url": "https://github.com/mctx-ai/mcp-server/issues"
32
36
  },
33
37
  "homepage": "https://docs.mctx.ai",
34
- "peerDependencies": {
35
- "@mctx-ai/mcp-server": "^0.3.0"
38
+ "publishConfig": {
39
+ "access": "public",
40
+ "provenance": true
36
41
  },
37
- "scripts": {
38
- "test": "node --test",
39
- "lint": "echo 'Linting not configured yet'"
42
+ "peerDependencies": {
43
+ "@mctx-ai/mcp-server": "0.5.0"
40
44
  }
41
- }
45
+ }
package/src/server.js CHANGED
@@ -48,52 +48,6 @@ function logFramework(message, color = colors.reset) {
48
48
  );
49
49
  }
50
50
 
51
- /**
52
- * Handle MCP initialize handshake
53
- * This is normally handled by the MCP client (Claude Desktop), but we need to
54
- * handle it locally for development.
55
- */
56
- function handleInitialize(rpcRequest) {
57
- const { method, params = {} } = rpcRequest;
58
-
59
- if (method === "initialize") {
60
- // Respond with server capabilities
61
- return {
62
- jsonrpc: "2.0",
63
- id: rpcRequest.id,
64
- result: {
65
- protocolVersion: "2024-11-05",
66
- capabilities: {
67
- tools: {},
68
- resources: {},
69
- prompts: {},
70
- logging: {},
71
- },
72
- serverInfo: {
73
- name: "mctx-dev",
74
- version: "0.1.0",
75
- },
76
- },
77
- };
78
- }
79
-
80
- if (method === "initialized") {
81
- // Fix #3: Return special marker for notifications (no response per JSON-RPC 2.0)
82
- return { _notification: true };
83
- }
84
-
85
- if (method === "ping") {
86
- // Respond to ping
87
- return {
88
- jsonrpc: "2.0",
89
- id: rpcRequest.id,
90
- result: {},
91
- };
92
- }
93
-
94
- return null;
95
- }
96
-
97
51
  /**
98
52
  * Extract method name and arguments for logging
99
53
  */
@@ -364,45 +318,8 @@ export async function startDevServer(entryUrl, port) {
364
318
  }
365
319
 
366
320
  try {
367
- // Handle initialize handshake locally
368
- const initResponse = handleInitialize(rpcRequest);
369
- if (initResponse !== null) {
370
- const elapsed = Date.now() - startTime;
371
-
372
- // Fix #3: For notifications (initialized), send 204 No Content
373
- if (initResponse._notification === true) {
374
- res.writeHead(204);
375
- res.end();
376
- log(
377
- `${colors.green}←${colors.reset} 204 (${elapsed}ms)`,
378
- colors.dim,
379
- );
380
- return;
381
- }
382
-
383
- // Fix #5: Include app capabilities if available
384
- if (rpcRequest.method === "initialize" && app) {
385
- const capabilities = initResponse.result.capabilities;
386
-
387
- // Merge app capabilities if exposed
388
- if (app.tools && typeof app.tools.list === "function") {
389
- capabilities.tools = app.tools.capabilities || {};
390
- }
391
- if (app.resources && typeof app.resources.list === "function") {
392
- capabilities.resources = app.resources.capabilities || {};
393
- }
394
- if (app.prompts && typeof app.prompts.list === "function") {
395
- capabilities.prompts = app.prompts.capabilities || {};
396
- }
397
- }
398
-
399
- res.writeHead(200, { "Content-Type": "application/json" });
400
- res.end(JSON.stringify(initResponse));
401
- log(`${colors.green}←${colors.reset} 200 (${elapsed}ms)`, colors.dim);
402
- return;
403
- }
404
-
405
- // Delegate to app's fetch handler
321
+ // Delegate all requests to app's fetch handler (including initialize)
322
+ // The core SDK now handles initialize, initialized, and ping
406
323
  const request = createRequest(rpcRequest);
407
324
  const response = await app.fetch(request, {}, {});
408
325
 
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 mctx
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.