mcp-server-example
3.3
This project is a simple example of a Model Context Protocol (MCP) server implementation using the official SDK. It features a "hello world" tool demonstrating basic server functionality and communication via stdio transport.
MCP Server Example
A simple example of a Model Context Protocol (MCP) server implementation using the official SDK.
Overview
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.
Features
- 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
Prerequisites
- Node.js (version 14 or higher)
- npm or yarn package manager
Installation
- Clone this repository
- Install dependencies:
npm install
Usage
To start the MCP server:
npm start
The server will start and listen for incoming connections via stdio.
Project Structure
server.js
- Main server implementationpackage.json
- Project configuration and dependencies
Dependencies
@modelcontextprotocol/sdk
- Official MCP SDKzod
- Schema validation library
License
This project is open source and available under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.