Skip to main content
Glama

School Attendance MCP Server

by Sadaf987
test-simple.jsโ€ข1.98 kB
// Simple HTTP-based testing using fetch (Node.js 18+ built-in) // For older Node versions, install: npm install node-fetch const MCP_URL = 'http://localhost:3001/mcp'; async function callTool(toolName, arguments) { try { const response = await fetch(MCP_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'tools/call', params: { name: toolName, arguments }, id: Date.now() }) }); const data = await response.json(); return data; } catch (error) { return { error: error.message }; } } async function listTools() { try { const response = await fetch(MCP_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'tools/list', id: 1 }) }); const data = await response.json(); return data; } catch (error) { return { error: error.message }; } } // Run tests async function test() { console.log('='.repeat(50)); console.log('HTTP-based MCP Tool Testing'); console.log('='.repeat(50)); // List tools console.log('\n๐Ÿ“‹ Listing available tools...'); const toolsList = await listTools(); console.log(JSON.stringify(toolsList, null, 2)); // Test mark_attendance console.log('\n๐Ÿงช Testing mark_attendance...'); const result1 = await callTool('mark_attendance', { studentId: '12345', date: '2024-01-15', status: 'present' }); console.log(JSON.stringify(result1, null, 2)); // Test get_repo_info console.log('\n๐Ÿงช Testing get_repo_info...'); const result2 = await callTool('get_repo_info', { repoOwner: 'sadaf987', repoName: 'test_MCP' }); console.log(JSON.stringify(result2, null, 2)); console.log('\n' + '='.repeat(50)); console.log('Testing Complete'); console.log('='.repeat(50)); } test().catch(console.error);

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/Sadaf987/github_sdk'

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