@nekzus/mcp-server 1.19.0-alpha.14 → 1.19.0-alpha.16
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 +28 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/src/http.d.ts +16 -0
- package/dist/src/http.d.ts.map +1 -0
- package/dist/src/http.js +109 -0
- package/dist/src/http.js.map +1 -0
- package/dist/src/tools/index.d.ts +2 -1
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +1 -1
- package/dist/src/tools/index.js.map +1 -1
- package/llms-full.txt +30 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,6 +137,34 @@ docker build -t nekzus/npm-sentinel-mcp .
|
|
|
137
137
|
docker run -i --rm -w /projects -v ${PWD}:/projects nekzus/npm-sentinel-mcp node dist/index.js
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
### Streamable HTTP (POST) & Cloudflare Workers Integration
|
|
141
|
+
|
|
142
|
+
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:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
import { handleStreamableHttpRequest } from '@nekzus/mcp-server/http';
|
|
146
|
+
|
|
147
|
+
export default {
|
|
148
|
+
async fetch(request: Request): Promise<Response> {
|
|
149
|
+
if (request.method !== 'POST') {
|
|
150
|
+
return new Response('NPM Sentinel MCP v2 Streamable HTTP Server', { status: 200 });
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
try {
|
|
154
|
+
const payload = await request.json();
|
|
155
|
+
const mcpResponse = await handleStreamableHttpRequest(payload);
|
|
156
|
+
|
|
157
|
+
return new Response(mcpResponse.body, {
|
|
158
|
+
status: mcpResponse.status,
|
|
159
|
+
headers: mcpResponse.headers,
|
|
160
|
+
});
|
|
161
|
+
} catch {
|
|
162
|
+
return new Response(JSON.stringify({ error: 'Invalid JSON-RPC payload' }), { status: 400 });
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
```
|
|
167
|
+
|
|
140
168
|
## Configuration
|
|
141
169
|
|
|
142
170
|
The server supports the following configuration parameters:
|