suryaraor/hello-world-mcp-server
If you are the rightful owner of hello-world-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A simple MCP (Model Context Protocol) server that demonstrates the basics of building custom tools for AI assistants.
Hello World MCP Server
A simple MCP (Model Context Protocol) server that demonstrates the basics of building custom tools for AI assistants.
What is MCP?
MCP (Model Context Protocol) allows AI assistants to:
- Connect to external data sources
- Use custom tools and functions
- Access real-time information
- Perform actions on your behalf
Features
This server provides three simple tools:
say_hello: Greets a person by nameget_time: Returns current date and timecalculate: Performs basic math operations (add, subtract, multiply, divide)
Setup
- Install dependencies:
npm install
- Build the project:
npm run build
- Run the server:
npm start
Development
For development with hot reload:
npm run dev
How it works
- The server defines available tools with their schemas
- AI assistants can discover these tools using the
tools/listrequest - When called via
tools/call, tools execute and return results - Results are sent back to the AI assistant in a standardized format
Testing
We've included several test scripts to verify your MCP server works correctly:
Automated Tests
# Run basic automated tests
npm test
# Run comprehensive test suite with performance metrics
npm run test:comprehensive
Interactive Testing
# Run interactive test client
npm run test:interactive
The interactive test allows you to manually test each tool and see the JSON-RPC requests/responses.
Manual Testing
You can also test the server manually by sending JSON-RPC requests via stdin:
npm start
Then send requests like:
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"say_hello","arguments":{"name":"World"}}}
Next Steps
- Add more complex tools (file operations, API calls, database queries)
- Implement resource providers for dynamic content
- Add proper error handling and logging
- Create configuration management