@interopio/mcp-http 0.1.0-beta.0 → 1.0.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.
- package/changelog.md +2 -0
- package/dist/index.cjs +68568 -68565
- package/dist/index.mjs +70704 -70704
- package/package.json +5 -4
- package/readme.md +8 -36
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interopio/mcp-http",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Node.js Express server with TypeScript and Rollup bundling",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "rollup --config rollup.config-prebuild.js && rollup --config rollup.config-cjs.js && rollup --config rollup.config-esm.js"
|
|
17
|
+
"build": "rollup --config rollup.config-prebuild.js && rollup --config rollup.config-cjs.js && rollup --config rollup.config-esm.js",
|
|
18
|
+
"build:docker": "rollup --config rollup.config-prebuild.js && rollup --config rollup.config-cjs.js && rollup --config rollup.config-esm.js"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@interopio/desktop": "^6.0.0",
|
|
21
|
-
"@interopio/mcp-core": "^
|
|
22
|
+
"@interopio/mcp-core": "^1.0.0",
|
|
22
23
|
"@modelcontextprotocol/sdk": "^1.19.1",
|
|
23
24
|
"express": "^5.1.0"
|
|
24
25
|
},
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"access": "public"
|
|
46
47
|
},
|
|
47
48
|
"license": "MIT",
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "48eed5aba906bcf98b959d15a43f2306acf3d292"
|
|
49
50
|
}
|
package/readme.md
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
- [Examples](#examples)
|
|
25
25
|
- [Basic HTTP Server](#basic-http-server)
|
|
26
26
|
- [Custom Port and CORS](#custom-port-and-cors)
|
|
27
|
-
- [With Session Management](#with-session-management)
|
|
28
27
|
- [With DNS Rebinding Protection](#with-dns-rebinding-protection)
|
|
29
28
|
- [Custom Server Configuration](#custom-server-configuration)
|
|
30
29
|
- [Complete io.Connect Desktop Integration](#complete-ioconnect-desktop-integration)
|
|
@@ -35,6 +34,8 @@
|
|
|
35
34
|
|
|
36
35
|
`@interopio/mcp-http` is a TypeScript library that provides HTTP transport implementation for Model Context Protocol (MCP) servers in the io.Intelligence ecosystem. It enables MCP functionality from `@interopio/mcp-core` to be delivered over HTTP, making it ideal for integration with io.Connect Desktop and other HTTP-based clients.
|
|
37
36
|
|
|
37
|
+
**Important:** Unlike `@interopio/mcp-web`, this package provides **server-side functionality only** and does not include client-side capabilities. This is by design: `@interopio/mcp-http` implements the HTTP transport definition from the MCP Standard itself, ensuring compatibility with any standard-compliant MCP HTTP client as described in the Model Context Protocol specification.
|
|
38
|
+
|
|
38
39
|
### Key Features
|
|
39
40
|
|
|
40
41
|
- **Express-based HTTP Server**: Built-in HTTP server with automatic middleware configuration
|
|
@@ -82,13 +83,15 @@ All endpoints require a `mcp-session-id` header except for the initial initializ
|
|
|
82
83
|
|
|
83
84
|
### Session Management
|
|
84
85
|
|
|
85
|
-
Each MCP client connection is represented by a session with a unique session ID. Sessions are:
|
|
86
|
+
Session management is **configured and working out of the box** with secure defaults. Each MCP client connection is represented by a session with a unique session ID. Sessions are:
|
|
86
87
|
|
|
87
|
-
- **Generated**: Automatically using `randomUUID()`
|
|
88
|
+
- **Generated**: Automatically using cryptographically secure `randomUUID()`
|
|
88
89
|
- **Tracked**: Stored internally and mapped to transport instances
|
|
89
90
|
- **Lifecycle-managed**: Created on initialization, closed on DELETE request
|
|
90
91
|
- **Multi-instance**: Each session can manage multiple MCP server instances
|
|
91
92
|
|
|
93
|
+
The default configuration works without manual setup, though you can customize session behavior for advanced use cases such as logging or tracking.
|
|
94
|
+
|
|
92
95
|
### SSE vs JSON Response Modes
|
|
93
96
|
|
|
94
97
|
The library supports two response modes:
|
|
@@ -358,7 +361,7 @@ mcpWorkingContext: {
|
|
|
358
361
|
}
|
|
359
362
|
```
|
|
360
363
|
|
|
361
|
-
Optional working context integration. See `@interopio/
|
|
364
|
+
Optional working context integration. See `@interopio/working-context` documentation for configuration details.
|
|
362
365
|
|
|
363
366
|
---
|
|
364
367
|
|
|
@@ -448,37 +451,6 @@ await IoIntelMCPHttpFactory(desktop, {
|
|
|
448
451
|
});
|
|
449
452
|
```
|
|
450
453
|
|
|
451
|
-
### With Session Management
|
|
452
|
-
|
|
453
|
-
```typescript
|
|
454
|
-
import { randomUUID } from "crypto";
|
|
455
|
-
|
|
456
|
-
const sessionRegistry = new Map();
|
|
457
|
-
|
|
458
|
-
await IoIntelMCPHttpFactory(desktop, {
|
|
459
|
-
licenseKey: process.env.IO_LICENSE_KEY!,
|
|
460
|
-
transportOptions: {
|
|
461
|
-
sessionIdGenerator: () => {
|
|
462
|
-
return `session-${randomUUID()}`;
|
|
463
|
-
},
|
|
464
|
-
onsessioninitialized: async (sessionId) => {
|
|
465
|
-
sessionRegistry.set(sessionId, {
|
|
466
|
-
createdAt: new Date(),
|
|
467
|
-
messageCount: 0,
|
|
468
|
-
});
|
|
469
|
-
console.log(`Session ${sessionId} registered`);
|
|
470
|
-
},
|
|
471
|
-
onsessionclosed: async (sessionId) => {
|
|
472
|
-
const session = sessionRegistry.get(sessionId);
|
|
473
|
-
console.log(
|
|
474
|
-
`Session ${sessionId} closed after ${session.messageCount} messages`,
|
|
475
|
-
);
|
|
476
|
-
sessionRegistry.delete(sessionId);
|
|
477
|
-
},
|
|
478
|
-
},
|
|
479
|
-
});
|
|
480
|
-
```
|
|
481
|
-
|
|
482
454
|
### With DNS Rebinding Protection
|
|
483
455
|
|
|
484
456
|
```typescript
|
|
@@ -535,7 +507,7 @@ await IoIntelMCPHttpFactory(desktop, {
|
|
|
535
507
|
import IoIntelMCPHttpFactory from "@interopio/mcp-http";
|
|
536
508
|
import IODesktop from "@interopio/desktop";
|
|
537
509
|
import IOWorkspaces from "@interopio/workspaces-api";
|
|
538
|
-
import { IoIntelWorkingContextFactory } from "@interopio/
|
|
510
|
+
import { IoIntelWorkingContextFactory } from "@interopio/working-context";
|
|
539
511
|
|
|
540
512
|
const desktop = await IODesktop({
|
|
541
513
|
logger: "info",
|