A simple example of a Model Context Protocol (MCP) server implementation using the official SDK.
This project demonstrates how to create a basic MCP server with a simple "hello world" tool. The server uses the official MCP SDK and communicates via stdio transport.
- MCP server implementation using
@modelcontextprotocol/sdk
- Simple "hello world" tool with optional name parameter
- Stdio-based communication transport
- Type-safe tool definitions using Zod schema validation
- Node.js (version 14 or higher)
- npm or yarn package manager
- Clone this repository
- Install dependencies:
npm install
To start the MCP server:
npm start
The server will start and listen for incoming connections via stdio.
-
server.js
- Main server implementation -
package.json
- Project configuration and dependencies
-
@modelcontextprotocol/sdk
- Official MCP SDK -
zod
- Schema validation library
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.