grove-mcp 1.0.2 → 1.0.3
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/index.js +10 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -21,6 +21,15 @@ const readline = require('readline');
|
|
|
21
21
|
const HOSTNAME = 'mcp.lyra.tg';
|
|
22
22
|
const SSE_PATH = '/sse';
|
|
23
23
|
|
|
24
|
+
// Per-user downstream service tokens from the MCP config env block.
|
|
25
|
+
// Forwarded as custom headers on every POST so the K8s pod can use them
|
|
26
|
+
// without storing tokens in the cluster environment.
|
|
27
|
+
const TOKEN_HEADERS = {};
|
|
28
|
+
if (process.env.GROVE_OUTLINE_TOKEN)
|
|
29
|
+
TOKEN_HEADERS['Grove-Outline-Token'] = process.env.GROVE_OUTLINE_TOKEN;
|
|
30
|
+
if (process.env.GROVE_MATTERMOST_TOKEN)
|
|
31
|
+
TOKEN_HEADERS['Grove-Mattermost-Token'] = process.env.GROVE_MATTERMOST_TOKEN;
|
|
32
|
+
|
|
24
33
|
let sessionPath = null;
|
|
25
34
|
let affinityCookie = null; // sticky-session cookie from SSE response headers
|
|
26
35
|
const pending = [];
|
|
@@ -122,6 +131,7 @@ function sendToServer(line) {
|
|
|
122
131
|
headers: {
|
|
123
132
|
'Content-Type': 'application/json',
|
|
124
133
|
'Content-Length': body.length,
|
|
134
|
+
...TOKEN_HEADERS,
|
|
125
135
|
...(affinityCookie ? { Cookie: affinityCookie } : {}),
|
|
126
136
|
},
|
|
127
137
|
},
|