simple_test.jsโข2.48 kB
const { OpenAIStdioMCPServer } = require('./dist/server.js');
async function testDirectCall() {
console.log('๐งช OpenAI MCP Server ์ง์ ํ
์คํธ\n');
const server = new OpenAIStdioMCPServer();
// ์ง์ ๋ด๋ถ ๋ฉ์๋ ํ
์คํธ
try {
console.log('๐ ํ
์คํธ 1: ์น ํ๋ก ํธ์๋ ํ๋ ์์ํฌ ๋ถ์');
const result1 = await server.callGPT5({
prompt: "๋ชจ๋ ์น ํ๋ก ํธ์๋ ๊ฐ๋ฐ์์ React์ Vue.js ์ค ์ด๋ค ๊ฒ์ ์ ํํด์ผ ํ ๊น์? ๊ฐ๊ฐ์ ์ฅ๋จ์ ์ ๋น๊ต ๋ถ์ํด์ฃผ์ธ์.",
taskType: "analysis",
domain: "frontend",
context: {
projectType: "enterprise",
teamSize: "medium",
timeline: "6months"
},
optimizationLevel: "balanced"
});
console.log('โ
์๋ต ๊ธธ์ด:', result1.content.length, '๋ฌธ์');
console.log('๐ ์๋ต ๋ฏธ๋ฆฌ๋ณด๊ธฐ:');
console.log(result1.content.substring(0, 300) + '...\n');
console.log('๐ ํ
์คํธ 2: React ์ธ์ฆ ์ฝ๋ ์์ฑ');
const result2 = await server.callGPT5({
prompt: "React์์ JWT ํ ํฐ์ ๊ด๋ฆฌํ๋ ์ปค์คํ
ํ
useAuth๋ฅผ ์์ฑํด์ฃผ์ธ์. ๋ก๊ทธ์ธ, ๋ก๊ทธ์์, ํ ํฐ ๊ฐฑ์ ๊ธฐ๋ฅ์ ํฌํจํด์ผ ํฉ๋๋ค.",
taskType: "coding",
domain: "implementation",
optimizationLevel: "precise"
});
console.log('โ
์๋ต ๊ธธ์ด:', result2.content.length, '๋ฌธ์');
console.log('๐ ์๋ต ๋ฏธ๋ฆฌ๋ณด๊ธฐ:');
console.log(result2.content.substring(0, 300) + '...\n');
console.log('๐ ํ
์คํธ 3: ์ฐฝ์์ ์ธ UI/UX ์์ด๋์ด');
const result3 = await server.callGPT5({
prompt: "์น ์ ๊ทผ์ฑ(a11y)์ ๊ณ ๋ คํ ํ์ ์ ์ด๊ณ ์ฐฝ์์ ์ธ UI/UX ํจํด์ 3๊ฐ์ง ์ ์ํด์ฃผ์ธ์.",
taskType: "generation",
domain: "design",
optimizationLevel: "creative"
});
console.log('โ
์๋ต ๊ธธ์ด:', result3.content.length, '๋ฌธ์');
console.log('๐ ์๋ต ๋ฏธ๋ฆฌ๋ณด๊ธฐ:');
console.log(result3.content.substring(0, 300) + '...\n');
console.log('๐ ๋ชจ๋ ํ
์คํธ ์ฑ๊ณต!');
// ์ฑ๋ฅ ๋ถ์
console.log('\n๐ ์ฑ๋ฅ ๋ถ์:');
console.log('- ๋ชจ๋ธ:', result1.model);
console.log('- ํ๊ท ํ ํฐ ์ฌ์ฉ๋:', Math.round((result1.usage?.totalTokens + result2.usage?.totalTokens + result3.usage?.totalTokens) / 3), 'ํ ํฐ');
} catch (error) {
console.error('โ ํ
์คํธ ์คํจ:', error.message);
}
}
testDirectCall();