@ririaru/mcp-gpt5-server
Version:
Enhanced MCP server for GPT-5 with advanced features
40 lines (33 loc) • 1.18 kB
JavaScript
// Direct API test to debug MCP issue
console.log('🔧 Testing Direct API Call...');
const API_URL = 'https://mcpgpt5.vercel.app/api/messages-minimal';
async function testDirectCall() {
try {
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt: "Hello from direct test",
level: "low",
verbosity: "concise"
}),
});
console.log(`Status: ${response.status}`);
console.log(`OK: ${response.ok}`);
console.log(`Headers: ${JSON.stringify(Object.fromEntries(response.headers), null, 2)}`);
if (!response.ok) {
const error = await response.text();
console.log(`Error text: ${error}`);
throw new Error(`API error: ${response.status} - ${error}`);
}
const data = await response.json();
console.log(`Success response: ${JSON.stringify(data, null, 2)}`);
return data.content?.[0]?.text || data.content || 'No response';
} catch (error) {
console.error('Error in direct call:', error);
throw error;
}
}
testDirectCall();