MCP Hello World Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Hello World Serversay hello to Alice"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Hello World Server
A simple hello world MCP (Model Context Protocol) server built with Node.js and TypeScript. This project is configured for easy deployment on Railway.
Features
✅ Simple hello world tool endpoint
✅ TypeScript for type safety
✅ Docker containerization
✅ Railway deployment ready
✅ MCP SDK integration
Prerequisites
Node.js 18.0.0 or higher
npm 9.0.0 or higher
Setup
Install dependencies:
npm installBuild the project:
npm run build
Development
Stdio Mode (Default)
Start the server in stdio mode:
npm run devor with the compiled build:
npm startThe server will start and listen on stdio for incoming MCP protocol messages.
HTTP Mode
Start the server in HTTP mode by setting the PORT environment variable:
PORT=8080 npm startThe server will start on the specified port and expose:
POST /mcp- MCP protocol endpointGET /health- Health check endpoint
Example health check:
curl http://localhost:8080/health
# Response: {"status":"ok"}Building for Production
Build the TypeScript code:
npm run buildRun the compiled server:
npm startProject Structure
.
├── src/
│ └── index.ts # Main server implementation
├── dist/ # Compiled JavaScript (generated)
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
├── Dockerfile # Docker configuration
├── railway.toml # Railway deployment config
└── README.md # This fileMCP Server Tools
hello
A simple tool that returns a personalized greeting.
Parameters:
name(string, optional): The name to greet. Defaults to "World"
Example:
{
"name": "hello",
"arguments": {
"name": "Alice"
}
}Response:
{
"content": [
{
"type": "text",
"text": "Hello, Alice! Welcome to the MCP server."
}
]
}Deployment on Railway
Prerequisites
Railway account (sign up at https://railway.app)
Railway CLI installed locally (optional, but recommended)
GitHub repository (optional, for easier deployment)
How It Works
This MCP server can run in two modes:
Stdio Mode - Default, for local development or direct integration
HTTP Mode - For cloud deployment (Railway, Render, etc.)
When a PORT environment variable is set, the server automatically switches to HTTP mode and exposes:
POST /mcp- MCP protocol endpoint for clientsGET /health- Health check endpoint for load balancers
Deploy Using GitHub
Push your code to a GitHub repository
Go to railway.app
Click "Create New Project"
Select "GitHub Repo"
Authorize Railway and select your repository
Railway will automatically detect the Node.js project and set
PORTfor youClick "Deploy"
Railway will automatically:
Set the
PORTenvironment variableBuild your TypeScript code
Start the server in HTTP mode
Deploy Using Railway CLI
Install Railway CLI: https://docs.railway.app/cli/quick-start
Login to Railway:
railway loginCreate a new project in the current directory:
railway initDeploy:
railway up
Using the Deployed Server
Once deployed to Railway, you'll get a public URL like https://your-service.railway.app.
To use it with an MCP client:
// Example: POST request to the MCP endpoint
const response = await fetch('https://your-service.railway.app/mcp', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'initialize',
params: {
protocolVersion: '2024-11-05',
capabilities: {},
clientInfo: { name: 'my-client', version: '1.0.0' }
}
})
});
const data = await response.json();
console.log(data);Environment Variables
The server automatically detects its running environment:
With
PORTset - Runs in HTTP mode (Railway, Render, etc.)Without
PORT- Runs in stdio mode (local development, Docker exec)
No additional configuration needed!
Testing
To test the MCP server, you'll need an MCP client. The server communicates via:
Stdio - Direct pipe communication for local integration
HTTP Streamable - HTTP endpoint for cloud deployment
Local Testing with Claude Desktop
Configure Claude Desktop to use the local server in stdio mode:
Create or edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"hello-world": {
"command": "node",
"args": ["C:\\path\\to\\mcp\\dist\\index.js"]
}
}
}Then restart Claude Desktop and the hello tool will be available.
Cloud Testing with Railway
Once deployed to Railway, you can make HTTP requests to your server:
# Health check
curl https://your-service.railway.app/health
# MCP protocol request
curl -X POST https://your-service.railway.app/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "hello",
"arguments": {"name": "Alice"}
}
}'Troubleshooting
Port Already in Use
If you see an error about the port being in use, the server may still be running. Kill it with:
# On Windows
taskkill /F /IM node.exe
# On macOS/Linux
pkill -f "node"Module Not Found Errors
Make sure all dependencies are installed:
npm install
npm run buildTypeScript Errors
Run type checking:
npm run typecheckLicense
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/qsopht/mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server