@proofofprotocol/inscribe-mcp 0.3.6 → 0.3.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/package.json +1 -1
- package/src/server.js +24 -12
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -82,7 +82,17 @@ function debugLog(phase, data = {}) {
|
|
|
82
82
|
args: data.args,
|
|
83
83
|
status: data.status,
|
|
84
84
|
duration: data.duration,
|
|
85
|
-
error: data.error
|
|
85
|
+
error: data.error,
|
|
86
|
+
// LAN analyzer style fields
|
|
87
|
+
method: data.method,
|
|
88
|
+
requestId: data.requestId,
|
|
89
|
+
argsKeys: data.argsKeys,
|
|
90
|
+
argsPreview: data.argsPreview,
|
|
91
|
+
action: data.action,
|
|
92
|
+
direction: data.direction,
|
|
93
|
+
resultPreview: data.resultPreview,
|
|
94
|
+
responseSize: data.responseSize,
|
|
95
|
+
errorType: data.errorType
|
|
86
96
|
});
|
|
87
97
|
}
|
|
88
98
|
|
|
@@ -151,14 +161,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
151
161
|
const startTime = Date.now();
|
|
152
162
|
const requestId = request.id || `req_${Date.now()}`;
|
|
153
163
|
|
|
154
|
-
// Debug: Agent → MCP (request received) -
|
|
164
|
+
// Debug: Agent → MCP (request received) - sequence diagram style
|
|
165
|
+
// 往路: Agent → MCP → Chain (all →OUT)
|
|
166
|
+
// 復路: Chain → MCP → Agent (all ←IN)
|
|
155
167
|
debugLog('agent_to_mcp', {
|
|
156
168
|
tool: name,
|
|
157
169
|
method: 'tools/call',
|
|
158
170
|
requestId,
|
|
159
171
|
argsKeys: args ? Object.keys(args) : [],
|
|
160
172
|
argsPreview: args ? JSON.stringify(args).slice(0, 100) : null,
|
|
161
|
-
direction: '
|
|
173
|
+
direction: 'OUT' // 往路: →
|
|
162
174
|
});
|
|
163
175
|
|
|
164
176
|
const tool = allTools.find(t => t.name === name);
|
|
@@ -198,24 +210,24 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
198
210
|
type: result.type
|
|
199
211
|
} : null;
|
|
200
212
|
|
|
201
|
-
// Debug: Chain → MCP (response)
|
|
213
|
+
// Debug: Chain → MCP (response) - 復路: ←
|
|
202
214
|
debugLog('chain_to_mcp', {
|
|
203
215
|
tool: name,
|
|
204
216
|
requestId,
|
|
205
217
|
status: 'SUCCESS',
|
|
206
218
|
duration,
|
|
207
219
|
resultPreview,
|
|
208
|
-
direction: 'IN'
|
|
220
|
+
direction: 'IN' // 復路: ←
|
|
209
221
|
});
|
|
210
222
|
|
|
211
|
-
// Debug: MCP → Agent (returning result)
|
|
223
|
+
// Debug: MCP → Agent (returning result) - 復路: ←
|
|
212
224
|
debugLog('mcp_to_agent', {
|
|
213
225
|
tool: name,
|
|
214
226
|
requestId,
|
|
215
227
|
status: 'SUCCESS',
|
|
216
228
|
duration,
|
|
217
229
|
responseSize: JSON.stringify(result).length,
|
|
218
|
-
direction: '
|
|
230
|
+
direction: 'IN' // 復路: ←
|
|
219
231
|
});
|
|
220
232
|
|
|
221
233
|
return {
|
|
@@ -224,7 +236,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
224
236
|
} catch (error) {
|
|
225
237
|
const duration = Date.now() - startTime;
|
|
226
238
|
|
|
227
|
-
// Debug: Chain → MCP (error)
|
|
239
|
+
// Debug: Chain → MCP (error) - 復路: ←
|
|
228
240
|
debugLog('chain_to_mcp', {
|
|
229
241
|
tool: name,
|
|
230
242
|
requestId,
|
|
@@ -232,17 +244,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
232
244
|
duration,
|
|
233
245
|
error: error.message,
|
|
234
246
|
errorType: error.constructor.name,
|
|
235
|
-
direction: 'IN'
|
|
247
|
+
direction: 'IN' // 復路: ←
|
|
236
248
|
});
|
|
237
249
|
|
|
238
|
-
// Debug: MCP → Agent (returning error)
|
|
250
|
+
// Debug: MCP → Agent (returning error) - 復路: ←
|
|
239
251
|
debugLog('mcp_to_agent', {
|
|
240
252
|
tool: name,
|
|
241
253
|
requestId,
|
|
242
254
|
status: 'ERROR',
|
|
243
255
|
duration,
|
|
244
256
|
error: error.message,
|
|
245
|
-
direction: '
|
|
257
|
+
direction: 'IN' // 復路: ←
|
|
246
258
|
});
|
|
247
259
|
|
|
248
260
|
return {
|
|
@@ -264,7 +276,7 @@ async function main() {
|
|
|
264
276
|
if (isDebugEnabled()) {
|
|
265
277
|
console.error('Debug mode is currently ON (hot-reloadable)');
|
|
266
278
|
debugLog('server_start', {
|
|
267
|
-
version: '0.3.
|
|
279
|
+
version: '0.3.8',
|
|
268
280
|
tools: allTools.map(t => t.name)
|
|
269
281
|
});
|
|
270
282
|
}
|