Major refactor: Multi-user Chrome MCP extension with remote server architecture

This commit is contained in:
nasir@endelospay.com
2025-08-21 20:09:57 +05:00
parent d97cad1736
commit 5d869f6a7c
125 changed files with 16249 additions and 11906 deletions

View File

@@ -0,0 +1,58 @@
/**
* Simple MCP endpoint test
*/
import fetch from 'node-fetch';
const SERVER_URL = 'http://localhost:3001';
async function testMcpEndpoint() {
try {
console.log('🔍 Testing MCP endpoint with simple request...');
const initMessage = {
jsonrpc: '2.0',
id: 1,
method: 'initialize',
params: {
protocolVersion: '2024-11-05',
capabilities: {
tools: {},
},
clientInfo: {
name: 'test-simple-mcp-client',
version: '1.0.0',
},
},
};
console.log('📤 Sending:', JSON.stringify(initMessage, null, 2));
const response = await fetch(`${SERVER_URL}/mcp`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json, text/event-stream',
},
body: JSON.stringify(initMessage),
});
console.log('📥 Status:', response.status);
console.log('📥 Headers:', Object.fromEntries(response.headers.entries()));
if (response.ok) {
const sessionId = response.headers.get('mcp-session-id');
console.log('🆔 Session ID:', sessionId);
const text = await response.text();
console.log('📥 SSE Response:', text);
} else {
const text = await response.text();
console.log('📥 Error response:', text);
}
} catch (error) {
console.error('❌ Error:', error);
}
}
testMcpEndpoint();