@reproapp/mcp 0.0.6 → 0.0.7
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/package.json +1 -1
- package/src/index.js +43 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -16,6 +16,7 @@ const SERVER_INSTRUCTIONS = [
|
|
|
16
16
|
'For Repro-scoped questions about sessions, requests, traces, privacy policies, apps, or configuration, use the Repro MCP tools only.',
|
|
17
17
|
'Do not create local scripts, read cached Repro auth files, or call Repro HTTP APIs directly for Repro data or policy workflows.',
|
|
18
18
|
'For privacy policy writes, inspect first and then use exact statementSid(s) or blockerSetId. Broad natural-language policy update queries are read-only.',
|
|
19
|
+
'When a Repro tool returns valuePreview/valueLink for a large payload, return that preview and link to the user and stop there. Do not automatically follow the link or re-query for the full value unless the user explicitly asks for the full payload or raw value. Exact large-value expansion requires expandLargeValue=true and explicit user intent.',
|
|
19
20
|
].join(' ');
|
|
20
21
|
const DEFAULT_REPRO_AI_BASE_URL = 'https://repro-ai-u8lhw.ondigitalocean.app';
|
|
21
22
|
const DEFAULT_REPRO_API_BASE_URL = 'https://repro-api-d7288.ondigitalocean.app/api';
|
|
@@ -1222,9 +1223,51 @@ function formatLocalToolContentText(name, value) {
|
|
|
1222
1223
|
const text = renderPrivacyCoverageText(value);
|
|
1223
1224
|
if (text) return text;
|
|
1224
1225
|
}
|
|
1226
|
+
if (name === 'get_kafka_messages') {
|
|
1227
|
+
const text = renderKafkaMessagesText(value);
|
|
1228
|
+
if (text) return text;
|
|
1229
|
+
}
|
|
1225
1230
|
return JSON.stringify(value, null, 2);
|
|
1226
1231
|
}
|
|
1227
1232
|
|
|
1233
|
+
function renderKafkaMessagesText(value) {
|
|
1234
|
+
if (!value || typeof value !== 'object') {
|
|
1235
|
+
return null;
|
|
1236
|
+
}
|
|
1237
|
+
const data = value.data && typeof value.data === 'object' ? value.data : null;
|
|
1238
|
+
const items = Array.isArray(data?.items) ? data.items : [];
|
|
1239
|
+
if (!items.length) {
|
|
1240
|
+
return null;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
const lines = [`Found ${items.length} Kafka message${items.length === 1 ? '' : 's'}.`];
|
|
1244
|
+
let omittedCount = 0;
|
|
1245
|
+
|
|
1246
|
+
for (const item of items.slice(0, 3)) {
|
|
1247
|
+
const request = item?.request && typeof item.request === 'object' ? item.request : {};
|
|
1248
|
+
const message = item?.message && typeof item.message === 'object' ? item.message : {};
|
|
1249
|
+
lines.push(
|
|
1250
|
+
[
|
|
1251
|
+
typeof request.rid === 'string' ? `RID ${request.rid}` : null,
|
|
1252
|
+
typeof message.topic === 'string' ? `topic ${message.topic}` : null,
|
|
1253
|
+
typeof message.offset !== 'undefined' ? `offset ${message.offset}` : null,
|
|
1254
|
+
typeof message.key !== 'undefined' ? `key ${message.key}` : null,
|
|
1255
|
+
].filter(Boolean).join(' | '),
|
|
1256
|
+
);
|
|
1257
|
+
if (message.valueOmitted === true || message.rawValueOmitted === true) {
|
|
1258
|
+
omittedCount += 1;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
if (omittedCount > 0) {
|
|
1263
|
+
lines.push(
|
|
1264
|
+
'Large Kafka payload preview returned. Do not fetch the full value automatically. Only follow valueLink if the user explicitly asks for the full payload or raw value. Exact expansion requires expandLargeValue=true.'
|
|
1265
|
+
);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
return lines.filter(Boolean).join('\n');
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1228
1271
|
function mergeLocalTools(remoteTools) {
|
|
1229
1272
|
const byName = new Map();
|
|
1230
1273
|
for (const tool of LOCAL_TOOL_DEFINITIONS) {
|