MCP Server Demo
MCP Server Demo
Quick demo to show the local MCP client/server example.
Prerequisites
Node.js (16+)
Install (if you haven't already):
npm installRun the demo (spawns multiple clients):
npm run demoOr run a single client with a custom name:
node client.js StephenWhat it does
server.jsis a minimal newline-delimited JSON tool server exposingsay_hello.client.jsspawnsserver.js, sends{ tool: 'say_hello', args: { name } }, and logs the response.demo.jsruns severalclient.jsinstances concurrently to showcase multiple requests and responses.
Web demo
Start the web demo server and open the UI in your browser:
npm run web
# then open http://localhost:3000 in a browserThe web UI lets you type a name and click "Send say_hello" to demonstrate the MCP request/response flow over WebSocket.
Calling external APIs from the server
You can make the server call an external HTTP API via the
call_apitool.
Usage (CLI/stdin): send a request like:
{ "id": 1, "tool": "call_api", "args": { "path": "/status" } }If EXTERNAL_API_BASE is set in the environment the path will be resolved relative to that base. Example (PowerShell):
$env:EXTERNAL_API_BASE = 'https://api.example.com'
echo '{ "id": 1, "tool": "call_api", "args": { "path": "/status" } }' | node server.jsThe server will return a JSON response containing status, headers, and body (parsed JSON when possible).
Want a web-based demo or a demo that uses the installed @modelcontextprotocol/sdk transport? I can implement that next.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/srogouski/MCPServer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server