@nekzus/mcp-server 1.24.0 → 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 CHANGED
@@ -59,12 +59,25 @@ To ensure data accuracy while maintaining high performance:
59
59
 
60
60
  ## Installation & Transports
61
61
 
62
- ### STDIO & Streamable HTTP Transports
62
+ ### Dual-Era MCP Architecture (v1 `2025-11-25` + v2 `2026-07-28`)
63
63
 
64
- This MCP server supports both **STDIO** (standard input/output) and **Streamable HTTP / SSE** transports out of the box.
64
+ This MCP server features native **Dual-Era Protocol Compatibility**, seamlessly serving both modern MCP v2 clients (`2026-07-28`) and legacy MCP v1 clients (`2025-11-25`) out of the box across both **STDIO** and **Streamable HTTP** transports:
65
65
 
66
- - **STDIO Mode**: Default transport for local execution via `npx` or Docker.
67
- - **Streamable HTTP / SSE Mode**: Decoupled `createServer({ config })` factory exported from `dist/index.js` and `dist/src/server.js` for mounting on Express, Hono, Cloudflare Workers, or Smithery.ai.
66
+ - **STDIO Mode (`npx @nekzus/mcp-server`)**: Powered by `serveStdio({ legacy: "serve" })`. Handles modern `server/discover` probes sessionlessly and conjoins seamlessly with legacy `initialize` handshakes for local execution (Claude Desktop, Cursor, Docker).
67
+ - **Streamable HTTP / SSE Mode (`@nekzus/mcp-server/http`)**: Powered by `createMcpHandler({ legacy: "stateless" })`. Designed for serverless and web-standard runtimes (Cloudflare Workers, Hono, Express, Vercel API Routes, Smithery.ai).
68
+
69
+ **Example: Mounting HTTP Handler (Cloudflare Workers / Hono / Express)**
70
+ ```typescript
71
+ import { createMcpHttpHandler } from '@nekzus/mcp-server/http';
72
+
73
+ const handleRequest = createMcpHttpHandler();
74
+
75
+ export default {
76
+ async fetch(request, env, ctx) {
77
+ return handleRequest(request);
78
+ }
79
+ };
80
+ ```
68
81
 
69
82
  **Development Commands:**
70
83
  ```bash
@@ -74,13 +87,13 @@ pnpm install
74
87
  # Compile TypeScript to dist/
75
88
  pnpm run build
76
89
 
77
- # Start STDIO server
90
+ # Start STDIO server (Dual-Era)
78
91
  pnpm run start
79
92
 
80
93
  # Development server with Smithery CLI playground
81
94
  pnpm run dev
82
95
 
83
- # Run unit and integration test suite (212+ tests)
96
+ # Run full unit and integration test suite (238 tests)
84
97
  pnpm test -- --run
85
98
 
86
99
  # Run full E2E tarball verification
@@ -147,34 +160,25 @@ docker build -t nekzus/npm-sentinel-mcp .
147
160
  docker run -i --rm -w /projects -v ${PWD}:/projects nekzus/npm-sentinel-mcp node dist/index.js
148
161
  ```
149
162
 
150
- ### Streamable HTTP (POST) & Cloudflare Workers Integration
163
+ ### Web Standard Streamable HTTP & Cloudflare Workers Integration
151
164
 
152
- The package exports a stateless HTTP handler `handleStreamableHttpRequest` designed for serverless platforms (Cloudflare Workers, Vercel, Express, Fastify, Next.js API routes) requiring Streamable HTTP POST transport under MCP v2:
165
+ The package exports `createMcpHttpHandler` and `WebStandardStreamableHTTPServerTransport` for serverless platforms (Cloudflare Workers, Hono, Vercel, Express, Fastify, Next.js API routes) requiring official Web Standard Streamable HTTP transport under MCP v2:
153
166
 
154
167
  ```typescript
155
- import { handleStreamableHttpRequest } from '@nekzus/mcp-server/http';
168
+ import { createMcpHttpHandler } from '@nekzus/mcp-server/http';
169
+
170
+ const handleMcpRequest = createMcpHttpHandler();
156
171
 
157
172
  export default {
158
173
  async fetch(request: Request): Promise<Response> {
159
- if (request.method !== 'POST') {
160
- return new Response('NPM Sentinel MCP v2 Streamable HTTP Server', { status: 200 });
161
- }
162
-
163
- try {
164
- const payload = await request.json();
165
- const mcpResponse = await handleStreamableHttpRequest(payload);
166
-
167
- return new Response(mcpResponse.body, {
168
- status: mcpResponse.status,
169
- headers: mcpResponse.headers,
170
- });
171
- } catch {
172
- return new Response(JSON.stringify({ error: 'Invalid JSON-RPC payload' }), { status: 400 });
173
- }
174
+ return handleMcpRequest(request);
174
175
  },
175
176
  };
176
177
  ```
177
178
 
179
+ **100% MCP v2 Compliance**: Powered by `WebStandardStreamableHTTPServerTransport`, this handler natively activates all 3 MCP primitives (**Tools**, **Resources**, and **Prompts**) with peak performance, SSE streaming support, and full Web Standard `Request` $\rightarrow$ `Response` compatibility.
180
+
181
+
178
182
  ## Configuration
179
183
 
180
184
  The server supports the following configuration parameters: