@remembrance-ai/mcp-server 0.1.6 → 0.1.8
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/dist/server.js +18 -6
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/server.js
CHANGED
|
@@ -6164,9 +6164,10 @@ function resolveApiKey() {
|
|
|
6164
6164
|
return fromFile ? String(fromFile) : "";
|
|
6165
6165
|
}
|
|
6166
6166
|
var apiBase = (process.env.REMEMBRANCE_API_URL || readRemembranceConfig().apiUrl || "https://remembrance.dev").replace(/\/$/, "");
|
|
6167
|
-
var SERVER_VERSION = true ? "0.1.
|
|
6167
|
+
var SERVER_VERSION = true ? "0.1.8" : "0.0.0-dev";
|
|
6168
6168
|
var tools = toolDefinitions;
|
|
6169
6169
|
var inputBuffer = Buffer.alloc(0);
|
|
6170
|
+
var clientFraming = "ndjson";
|
|
6170
6171
|
process.stdin.on("data", (chunk) => {
|
|
6171
6172
|
inputBuffer = Buffer.concat([inputBuffer, chunk]);
|
|
6172
6173
|
processMessages().catch((error) => {
|
|
@@ -6179,6 +6180,9 @@ process.stdin.on("data", (chunk) => {
|
|
|
6179
6180
|
async function processMessages() {
|
|
6180
6181
|
const parsed = readJsonRpcMessages(inputBuffer);
|
|
6181
6182
|
inputBuffer = parsed.remaining;
|
|
6183
|
+
if (parsed.framing) {
|
|
6184
|
+
clientFraming = parsed.framing;
|
|
6185
|
+
}
|
|
6182
6186
|
for (const error of parsed.errors) {
|
|
6183
6187
|
writeResponse(null, null, error);
|
|
6184
6188
|
}
|
|
@@ -6189,6 +6193,7 @@ async function processMessages() {
|
|
|
6189
6193
|
function readJsonRpcMessages(buffer) {
|
|
6190
6194
|
const messages = [];
|
|
6191
6195
|
const errors = [];
|
|
6196
|
+
let framing;
|
|
6192
6197
|
let remaining = buffer;
|
|
6193
6198
|
while (true) {
|
|
6194
6199
|
const legacyHeader = /^content-length:/i.test(
|
|
@@ -6198,7 +6203,7 @@ function readJsonRpcMessages(buffer) {
|
|
|
6198
6203
|
if (legacyHeader) {
|
|
6199
6204
|
const headerEnd = remaining.indexOf("\r\n\r\n");
|
|
6200
6205
|
if (headerEnd < 0) {
|
|
6201
|
-
return { messages, remaining, errors };
|
|
6206
|
+
return { messages, remaining, errors, framing };
|
|
6202
6207
|
}
|
|
6203
6208
|
const header = remaining.slice(0, headerEnd).toString("utf8");
|
|
6204
6209
|
const length = Number.parseInt(
|
|
@@ -6210,26 +6215,29 @@ function readJsonRpcMessages(buffer) {
|
|
|
6210
6215
|
code: -32600,
|
|
6211
6216
|
message: "Invalid Content-Length header."
|
|
6212
6217
|
});
|
|
6218
|
+
framing = "content-length";
|
|
6213
6219
|
remaining = remaining.slice(headerEnd + 4);
|
|
6214
6220
|
continue;
|
|
6215
6221
|
}
|
|
6216
6222
|
const messageStart = headerEnd + 4;
|
|
6217
6223
|
const messageEnd = messageStart + length;
|
|
6218
6224
|
if (remaining.byteLength < messageEnd) {
|
|
6219
|
-
return { messages, remaining, errors };
|
|
6225
|
+
return { messages, remaining, errors, framing };
|
|
6220
6226
|
}
|
|
6221
6227
|
body = remaining.slice(messageStart, messageEnd).toString("utf8");
|
|
6222
6228
|
remaining = remaining.slice(messageEnd);
|
|
6229
|
+
framing = "content-length";
|
|
6223
6230
|
} else {
|
|
6224
6231
|
const newline = remaining.indexOf("\n");
|
|
6225
6232
|
if (newline < 0) {
|
|
6226
|
-
return { messages, remaining, errors };
|
|
6233
|
+
return { messages, remaining, errors, framing };
|
|
6227
6234
|
}
|
|
6228
6235
|
body = remaining.slice(0, newline).toString("utf8").trim();
|
|
6229
6236
|
remaining = remaining.slice(newline + 1);
|
|
6230
6237
|
if (!body) {
|
|
6231
6238
|
continue;
|
|
6232
6239
|
}
|
|
6240
|
+
framing = "ndjson";
|
|
6233
6241
|
}
|
|
6234
6242
|
try {
|
|
6235
6243
|
messages.push(JSON.parse(body));
|
|
@@ -6635,15 +6643,19 @@ function agentProviderForIdentity(provider) {
|
|
|
6635
6643
|
function writeResponse(id, result, error) {
|
|
6636
6644
|
process.stdout.write(formatJsonRpcResponse(id, result, error));
|
|
6637
6645
|
}
|
|
6638
|
-
function formatJsonRpcResponse(id, result, error) {
|
|
6646
|
+
function formatJsonRpcResponse(id, result, error, framing = clientFraming) {
|
|
6639
6647
|
const body = JSON.stringify({
|
|
6640
6648
|
jsonrpc: "2.0",
|
|
6641
6649
|
id: id ?? null,
|
|
6642
6650
|
...error ? { error } : { result }
|
|
6643
6651
|
});
|
|
6644
|
-
|
|
6652
|
+
if (framing === "content-length") {
|
|
6653
|
+
return `Content-Length: ${Buffer.byteLength(body, "utf8")}\r
|
|
6645
6654
|
\r
|
|
6646
6655
|
${body}`;
|
|
6656
|
+
}
|
|
6657
|
+
return `${body}
|
|
6658
|
+
`;
|
|
6647
6659
|
}
|
|
6648
6660
|
export {
|
|
6649
6661
|
callTool,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remembrance-ai/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"mcpName": "io.github.dreamarkinc/remembrance",
|
|
5
5
|
"description": "MCP server for discovering Remembrance skills/resources and submitting agent feedback with optional TOFU attestations.",
|
|
6
6
|
"license": "Apache-2.0",
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/dreamarkinc/remembrance-skills",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.8",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@remembrance-ai/mcp-server",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.8",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|