@nekzus/mcp-server 1.19.0-alpha.24 → 1.19.0-alpha.25

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.
package/dist/src/http.js CHANGED
@@ -1,31 +1,26 @@
1
- import { WebStandardStreamableHTTPServerTransport, } from '@modelcontextprotocol/server';
1
+ import { createMcpHandler, WebStandardStreamableHTTPServerTransport, } from '@modelcontextprotocol/server';
2
2
  import { setNpmRegistryUrl } from './config.js';
3
- import createServer from './server.js';
4
- export { WebStandardStreamableHTTPServerTransport, };
3
+ import { createMcpServer } from './server.js';
4
+ export { createMcpHandler, WebStandardStreamableHTTPServerTransport, };
5
5
  /**
6
- * Creates an HTTP request handler utilizing WebStandardStreamableHTTPServerTransport
7
- * fully compliant with MCP v2 standards for all 3 primitives (Tools, Resources, Prompts).
6
+ * Creates an HTTP request handler utilizing createMcpHandler with Dual-Era support (MCP v1 2025-11-25 + MCP v2 2026-07-28).
8
7
  *
8
+ * Fully compliant with MCP v2 standards for all 3 primitives (Tools, Resources, Prompts).
9
9
  * Designed for serverless and web standard runtimes (Cloudflare Workers, Hono, Vercel API Routes, Express, etc.)
10
10
  */
11
11
  export function createMcpHttpHandler(options = {}) {
12
12
  if (options.npmRegistryUrl) {
13
13
  setNpmRegistryUrl(options.npmRegistryUrl);
14
14
  }
15
+ const handler = createMcpHandler(() => createMcpServer({
16
+ config: {
17
+ NPM_REGISTRY_URL: options.npmRegistryUrl,
18
+ },
19
+ }), {
20
+ legacy: options.legacy ?? 'stateless',
21
+ });
15
22
  return async function handleRequest(request) {
16
- const server = createServer({
17
- config: {
18
- NPM_REGISTRY_URL: options.npmRegistryUrl,
19
- },
20
- });
21
- const { npmRegistryUrl, ...transportOptions } = options;
22
- const finalTransportOptions = {
23
- enableJsonResponse: options.enableJsonResponse ?? true,
24
- ...transportOptions,
25
- };
26
- const transport = new WebStandardStreamableHTTPServerTransport(finalTransportOptions);
27
- await server.connect(transport);
28
- return transport.handleRequest(request);
23
+ return handler.fetch(request);
29
24
  };
30
25
  }
31
26
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wCAAwC,GAExC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,YAAY,MAAM,aAAa,CAAC;AAEvC,OAAO,EACN,wCAAwC,GAExC,CAAC;AAOF;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAO,GAAiC,EAAE;IAC9E,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5B,iBAAiB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,KAAK,UAAU,aAAa,CAAC,OAAgB;QACnD,MAAM,MAAM,GAAG,YAAY,CAAC;YAC3B,MAAM,EAAE;gBACP,gBAAgB,EAAE,OAAO,CAAC,cAAc;aACxC;SACD,CAAC,CAAC;QAEH,MAAM,EAAE,cAAc,EAAE,GAAG,gBAAgB,EAAE,GAAG,OAAO,CAAC;QAExD,MAAM,qBAAqB,GAAoD;YAC9E,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,IAAI,IAAI;YACtD,GAAG,gBAAgB;SACnB,CAAC;QAEF,MAAM,SAAS,GAAG,IAAI,wCAAwC,CAAC,qBAAqB,CAAC,CAAC;QACtF,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChC,OAAO,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,wCAAwC,GAExC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EACN,gBAAgB,EAChB,wCAAwC,GAExC,CAAC;AAOF;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAO,GAAiC,EAAE;IAC9E,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5B,iBAAiB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,OAAO,GAAG,gBAAgB,CAC/B,GAAG,EAAE,CACJ,eAAe,CAAC;QACf,MAAM,EAAE;YACP,gBAAgB,EAAE,OAAO,CAAC,cAAc;SACxC;KACD,CAAC,EACH;QACC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,WAAW;KACrC,CACD,CAAC;IAEF,OAAO,KAAK,UAAU,aAAa,CAAC,OAAgB;QACnD,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC;AACH,CAAC"}
@@ -1,6 +1,10 @@
1
+ import { McpServer } from '@modelcontextprotocol/server';
1
2
  import type { z } from 'zod';
2
3
  import { type configSchema } from './config.js';
3
4
  export { configSchema } from './config.js';
5
+ export declare function createMcpServer({ config }: {
6
+ config: z.infer<typeof configSchema>;
7
+ }): McpServer;
4
8
  export default function createServer({ config }: {
5
9
  config: z.infer<typeof configSchema>;
6
10
  }): import("@modelcontextprotocol/server").Server;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,YAAY,EAA+C,MAAM,aAAa,CAAC;AAK7F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;CAAE,iDAuBxF"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,YAAY,EAA+C,MAAM,aAAa,CAAC;AAK7F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;CAAE,aAuBnF;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;CAAE,iDAExF"}
@@ -4,7 +4,7 @@ import { registerAllPrompts } from './prompts/index.js';
4
4
  import { registerAllResources } from './resources/index.js';
5
5
  import { registerAllTools } from './tools/index.js';
6
6
  export { configSchema } from './config.js';
7
- export default function createServer({ config }) {
7
+ export function createMcpServer({ config }) {
8
8
  if (config.NPM_REGISTRY_URL) {
9
9
  setNpmRegistryUrl(config.NPM_REGISTRY_URL);
10
10
  }
@@ -18,6 +18,9 @@ export default function createServer({ config }) {
18
18
  registerAllResources(server, packageRoot);
19
19
  registerAllPrompts(server);
20
20
  registerAllTools(server);
21
- return server.server;
21
+ return server;
22
+ }
23
+ export default function createServer({ config }) {
24
+ return createMcpServer({ config }).server;
22
25
  }
23
26
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAqB,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;A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MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC7B,iBAAiB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,wBAAwB,EAAE,CAAC;IAElE,MAAM,MAAM,GAAG,IAAI,SAAS,CAC3B;QACC,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,aAAa;KACtB,EACD;QACC,YAAY,EACX,2VAA2V;KAC5V,CACD,CAAC;IAEF,oBAAoB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1C,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzB,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAA4C;IACxF,OAAO,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nekzus/mcp-server",
3
- "version": "1.19.0-alpha.24",
3
+ "version": "1.19.0-alpha.25",
4
4
  "mcpName": "io.github.Nekzus/npm-sentinel-mcp",
5
5
  "description": "NPM Sentinel MCP - A powerful Model Context Protocol (MCP) server that revolutionizes NPM package analysis through AI. Built to integrate with Claude and Anthropic AI, it provides real-time intelligence on package security, dependencies, and performance.",
6
6
  "type": "module",