home / mcp / my first mcp server
A minimal MCP server with basic tools to learn MCP development and testing.
Configuration
View docs{
"mcpServers": {
"dh1789-my-first-mcp": {
"command": "claude",
"args": [
"mcp",
"add",
"my-first-mcp",
"--",
"node",
"/path/to/my-first-mcp/dist/index.js"
]
}
}
}This minimal MCP server lets you experiment with the Model Context Protocol by exposing a few practical tools you can call from an MCP client. Itβs designed for learning, quick testing, and building intuition around how an MCP server processes requests and returns results.
To use this MCP server from an MCP client, first register the server with your MCP client, then call the available tools to perform common tasks. You can test basic interactions locally using the built-in Inspector and by starting the server directly.
Connect the server to your MCP client and verify the connection, then run tools to perform tasks such as getting the current time, performing calculations, or inspecting server information. Use the MCP Inspector for interactive testing and debugging.
When you are ready to run the server on its own, start it and observe responses from the client as you request different operations.
# Register the MCP server with your client (example command)
claude mcp add my-first-mcp -- node /path/to/my-first-mcp/dist/index.js
# Verify the registered server
claude mcp listPrerequisites you need before installing:
- Node.js 20+
- npm or pnpm (your preferred package manager)Follow these concrete steps to set up the server locally.
# Clone the project
git clone https://github.com/dh1789/my-first-mcp.git
cd my-first-mcp
# Install dependencies
npm install
# Build the project
npm run buildAfter building, you can test and run the server in multiple ways. Use the MCP Inspector for quick in-browser testing, or start the server directly to run it as a standalone service.
# Run the inspector for interactive testing
npm run inspect
# Start the MCP server directly
npm startQuery the current system time from the MCP server.
Perform basic arithmetic operations (addition, subtraction, multiplication, division) on provided operands.
Generate a random number or a sequence of numbers as requested.
Return the reverse of a given string.
Retrieve information about the MCP server, such as version and status.
Analyze and describe the project structure or code layout.
Analyze project dependencies and their versions.
Count lines of code in a given set of files or a project.
Check the current operational status of the MCP server.