mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
feat: log local MCP requests to stderr by method
The stdio server writes each request's method, and the tool or resource it names, to stderr, which clients such as Claude Desktop copy into their logs. Arguments and results are never logged.
This commit is contained in:
1 parent
47ef168815
commit
5775eb9053
2 files changed
+39
-3
No files matched your search
@@ -87,3 +87,20 @@ test('command-line arguments are strict', () => {
|
||||
});
|
||||
assert.throws(() => parseArgs(['--port', '1']), /Unknown argument/);
|
||||
});
|
||||
|
||||
test('the stdio log names methods, tools and resources but never arguments', async () => {
|
||||
const { describeRequest } = await import('../../server/mcp/stdio.js');
|
||||
assert.equal(describeRequest({ method: 'tools/list' }), 'tools/list');
|
||||
assert.equal(
|
||||
describeRequest({
|
||||
method: 'tools/call',
|
||||
params: { name: 'get_weather', arguments: { location: { place: 'x' } } },
|
||||
}),
|
||||
'tools/call get_weather',
|
||||
);
|
||||
assert.equal(
|
||||
describeRequest({ method: 'resources/read', params: { uri: 'ui://a/b' } }),
|
||||
'resources/read ui://a/b',
|
||||
);
|
||||
assert.equal(describeRequest({ result: {} }), null);
|
||||
});
|
||||
Reference in new issue
Block a user