Skip to content

Commit 72d4579

Browse files
committed
fix: correct ConfigLoader method names and add HTTP server tests
- Fix configLoader.listServers() -> configLoader.getAllServers() - Fix configLoader.getServerConfig() -> configLoader.getServer() - Add comprehensive test suite for HTTP/WebSocket server (33 tests) - Add test:http npm script
1 parent 210bf80 commit 72d4579

File tree

3 files changed

+442
-4
lines changed

3 files changed

+442
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
"setup": "npm install && pip install -r tools/requirements.txt",
1111
"configure": "python tools/server-manager.py",
1212
"test-connection": "python tools/test-connection.py",
13-
"test": "npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools",
13+
"test": "npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools && npm run test:http",
1414
"test:profiles": "node tests/test-profiles.js",
1515
"test:aliases": "node tests/test-command-aliases.js",
1616
"test:hooks": "node tests/test-hooks.js",
1717
"test:tools": "node tests/test-tool-registry.js",
18+
"test:http": "node tests/test-http-server.js",
1819
"test:all": "npm test && ./scripts/validate.sh",
1920
"validate": "./scripts/validate.sh",
2021
"lint": "eslint src/*.js",

src/server-http.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async function getConnection(serverName) {
6363
}
6464

6565
// Get server config
66-
const config = configLoader.getServerConfig(normalizedName);
66+
const config = configLoader.getServer(normalizedName);
6767
if (!config) {
6868
throw new Error(`Server not found: ${serverName}`);
6969
}
@@ -247,7 +247,7 @@ class McpSshServer {
247247
}
248248

249249
async listServers() {
250-
const servers = configLoader.listServers();
250+
const servers = configLoader.getAllServers();
251251
return {
252252
content: [{
253253
type: 'text',
@@ -472,7 +472,7 @@ async function main() {
472472
await transport.start();
473473

474474
console.error('');
475-
console.error('Available servers:', configLoader.listServers().map(s => s.name).join(', ') || '(none configured)');
475+
console.error('Available servers:', configLoader.getAllServers().map(s => s.name).join(', ') || '(none configured)');
476476
console.error('');
477477
console.error('Connect your Flutter app to: ws://' + host + ':' + port + '/mcp');
478478
console.error('');

0 commit comments

Comments
 (0)