home / mcp / mcp sample server
A simple MCP server exposing time and calculation tools for easy integration with MCP clients.
Configuration
View docs{
"mcpServers": {
"happyteam-dx1-mcp-sample-server": {
"command": "node",
"args": [
"/path/to/mcp-sample-server/dist/index.js"
]
}
}
}You run a lightweight MCP server that exposes practical tools you can use from an MCP client. This server provides a current time tool and a simple calculator, making it easy to integrate natural language commands into your workflows and test MCP tooling locally.
Use an MCP client to interact with the server. You can ask for the current time in a specific timezone, or perform basic arithmetic operations like add, subtract, multiply, or divide. The server is designed to be simple to set up and to demonstrate how MCP tools behave in a real environment.
Prerequisites you need before installing: Node.js 18 or newer, and npm or yarn.
Step by step you can follow to get the server up and running locally:
# Clone the repository
git clone https://github.com/yukinaka/mcp-sample-server.git
cd mcp-sample-server
# Install dependencies
npm install
# Build the project
npm run buildIf you want to connect via an MCP client, you can use the built-in sample client that accompanies this server. Install and start the client to begin making natural language requests to the MCP server.
cd ../mcp-client
npm install
npm startReturns the current time. Optional parameter timezone allows you to specify a time zone, such as Asia/Tokyo or UTC.
Performs a simple calculation. Requires operation (add, subtract, multiply, divide) and two numeric operands a and b.