mcpField
M
MCP Server Example

MCP Server Example

Local
github.com/czy88840616Developer Tools0Updated 80w ago

About MCP Server Example

MCP Server Example is a basic Node.js MCP server example for developers learning server implementation with the official SDK. It demonstrates a hello-world tool over stdio, with Zod-based type-safe input validation.

Key features

  1. 01Official MCP SDK implementation
  2. 02Hello-world tool with optional name
  3. 03stdio transport
  4. 04Zod schema validation

Use cases

  1. 01Learning to build an MCP server
  2. 02Testing stdio-based MCP connections

MCP support

It implements an MCP server using the official SDK and exposes a hello-world tool to MCP clients over stdio.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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

  1. Clone this repository
  2. 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 implementation
  • package.json - Project configuration and dependencies

Dependencies

  • @modelcontextprotocol/sdk - Official MCP SDK
  • zod - 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.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.