Skip to main content
Glama

OpenAI MCP Server

by bhjo0930
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();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bhjo0930/openai_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server