@nekzus/mcp-server 1.24.1 → 1.25.0-alpha.1
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/README.md +19 -6
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -23
- package/dist/index.js.map +1 -1
- package/dist/src/http.d.ts +6 -5
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +13 -18
- package/dist/src/http.js.map +1 -1
- package/dist/src/server.d.ts +4 -0
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +5 -2
- package/dist/src/server.js.map +1 -1
- package/llms-full.txt +2 -2
- package/package.json +2 -1
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
|
|
4
|
-
export { WebStandardStreamableHTTPServerTransport, };
|
|
3
|
+
import { createMcpServer } from './server.js';
|
|
4
|
+
export { createMcpHandler, WebStandardStreamableHTTPServerTransport, };
|
|
5
5
|
/**
|
|
6
|
-
* Creates an HTTP request handler utilizing
|
|
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
|
-
|
|
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
|
package/dist/src/http.js.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/src/server.d.ts
CHANGED
|
@@ -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;
|
package/dist/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/src/server.js
CHANGED
|
@@ -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
|
|
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
|
|
21
|
+
return server;
|
|
22
|
+
}
|
|
23
|
+
export default function createServer({ config }) {
|
|
24
|
+
return createMcpServer({ config }).server;
|
|
22
25
|
}
|
|
23
26
|
//# sourceMappingURL=server.js.map
|
package/dist/src/server.js.map
CHANGED
|
@@ -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;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EA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|
1
1
|
# NPM Sentinel MCP Server - Full Protocol & Technical Documentation
|
|
2
2
|
|
|
3
3
|
## Protocol Specification
|
|
4
|
-
Version: MCP
|
|
5
|
-
Transport: stdio / Streamable HTTP (
|
|
4
|
+
Version: MCP Dual-Era (2025-11-25 & 2026-07-28 Specs via @modelcontextprotocol/server & @modelcontextprotocol/core)
|
|
5
|
+
Transport: Dual-Era stdio (serveStdio) / Streamable HTTP (createMcpHandler)
|
|
6
6
|
Capabilities: resources, prompts, tools, logging, structuredOutput
|
|
7
7
|
|
|
8
8
|
### Indirect Prompt Injection Safeguards (OWASP LLM01)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nekzus/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0-alpha.1",
|
|
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",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"@types/node": "26.1.1",
|
|
117
117
|
"@vitest/coverage-v8": "4.1.10",
|
|
118
118
|
"chalk": "^5.6.2",
|
|
119
|
+
"conventional-changelog-conventionalcommits": "^10.2.1",
|
|
119
120
|
"cors": "^2.8.6",
|
|
120
121
|
"cz-conventional-changelog": "3.0.1",
|
|
121
122
|
"express": "^5.2.1",
|