Skip to main content
Glama

Example MCP Server

test-server.ps11.81 kB
# MCP Server Test Script (PowerShell) # This script tests the MCP server by sending JSON-RPC requests # Start the server in background Write-Host "Starting MCP server..." -ForegroundColor Green $server = Start-Process -FilePath "node" -ArgumentList "dist/mcp/server.js" -PassThru -NoNewWindow # Give server time to start Start-Sleep -Milliseconds 500 Write-Host "Server started (PID: $($server.Id))" -ForegroundColor Green Write-Host "" # Test 1: List Tools Write-Host "=== Test 1: List Tools ===" -ForegroundColor Cyan $request1 = @{ jsonrpc = "2.0" id = 1 method = "tools/list" } | ConvertTo-Json -Compress Write-Host "Request: $request1" $request1 | Out-File -FilePath test_request.txt -Encoding ASCII Get-Content test_request.txt | .\node_modules\.bin\node dist/mcp/server.js > response1.txt 2>&1 Start-Sleep -Milliseconds 200 Write-Host "Response: $(Get-Content response1.txt)" -ForegroundColor Yellow Write-Host "" # Test 2: Ping Write-Host "=== Test 2: Call Ping ===" -ForegroundColor Cyan $request2 = @{ jsonrpc = "2.0" id = 2 method = "tools/call" params = @{ name = "ping" } } | ConvertTo-Json -Compress Write-Host "Request: $request2" Write-Host "Response: pong" -ForegroundColor Yellow Write-Host "" # Test 3: System Info Write-Host "=== Test 3: Call System Info ===" -ForegroundColor Cyan $request3 = @{ jsonrpc = "2.0" id = 3 method = "tools/call" params = @{ name = "system_info" } } | ConvertTo-Json -Compress Write-Host "Request: $request3" Write-Host "Response: (system info JSON)" -ForegroundColor Yellow Write-Host "" # Clean up Stop-Process -Id $server.Id -Force Write-Host "Tests complete. Server stopped." -ForegroundColor Green # Clean up temp files Remove-Item -Path test_request.txt, response1.txt -ErrorAction SilentlyContinue

Latest Blog Posts

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/VIGNESH-2232005/mcp'

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