Example MCP Server
Implements the MCP server in Node.js, allowing developers to create and expose custom tools for AI assistants
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Example MCP Server add 15 and 27"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Example MCP Server
This repository contains a minimal Model Context Protocol (MCP) server written in Node.js. The server exposes two simple tools that can be called from AI assistants (such as Claude Desktop or Cursor) via the MCP standard.
Tools provided
Tool name | Description | Parameters | Return value |
| Adds two numbers together |
| Text containing the sum |
| Returns the current server time in ISO format | none | Text with an ISO timestamp |
These tools are defined in the index.js file using the McpServer class from the official SDK. You can extend this server by registering your own tools with custom parameters and logic.
Related MCP server: MCP Server Basic Example
Installation
Install Node.js (version 20 or later is recommended).
Clone this repository and install dependencies:
npm installThe
@modelcontextprotocol/sdkpackage is published on npm. This example uses version1.17.0as referenced inpackage.json. MCP requires Node.js 18.x or higher to run properly【364465667226308†L72-L78】.
Running the server
Run the server with Node:
npm startBy default the server uses the StdioServerTransport to communicate. This means it will read JSON‑RPC 2.0 messages from stdin and write responses to stdout. Tools like Claude Desktop or Cursor will manage this communication for you.
Connecting with Claude Desktop
To connect this server to Claude Desktop, add an entry in your mcp.json configuration file (usually located in your ~/.claude/ or ~/.cursor/ directory depending on the client). An example configuration looks like this:
{
"mcpServers": {
"example-server": {
"command": "/absolute/path/to/node",
"args": [
"/absolute/path/to/index.js"
]
}
}
}Replace the command path with the absolute path to your Node binary (e.g. the output of which node) and update the args path to point to this project's index.js file.
After saving the config, restart your Claude Desktop app, grant permission to the tools when prompted, and you can invoke them by writing natural language instructions like:
“Add 3 and 5.” — Claude will call the add tool and return the sum.
“What’s the current time?” — Claude will call the getTime tool and return the timestamp.
References
The concept of MCP servers is described in Anthropic’s announcement【714031847317279†L20-L36】 and documented in several tutorials【67709559959600†L144-L178】.
For an example of defining tools with the official SDK, see the minimal server from the
mcp-server-nodeproject【966057210205090†L0-L18】.
License
This example is provided for educational purposes. Modify and adapt it to suit your own MCP workflows.
Available Tools
2 toolsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one performs a mathematical addition operation on two numbers, while the other retrieves the current server time. There is no overlap or ambiguity between these functions, making it impossible for an agent to confuse them.
The naming conventions are inconsistent: 'add' uses a simple verb form, while 'getTime' uses camelCase with a verb-object structure. This mixing of styles (no separator vs. camelCase) lacks a predictable pattern, though the names are still readable.
With only two tools, the server feels thin and under-scoped for a general-purpose MCP server. This minimal set suggests limited functionality that might not cover basic workflows or domain needs effectively, making it borderline too few for practical use.
The tool surface is severely incomplete; it lacks any coherent domain coverage. The tools are unrelated (math and time), with no CRUD operations, lifecycle management, or logical connections, leaving significant gaps that would cause agent failures in most scenarios.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseDqualityDmaintenanceA minimal Model Context Protocol server that provides a simple add(a, b) tool for computing the sum of two numbers.111 npmMIT
- AlicenseNot gradedqualityDmaintenanceA basic implementation of a Model Context Protocol server that demonstrates core functionality with simple math tools (add, subtract) and greeting resources for AI assistants like Claude.GPL 3.0
- AlicenseNot gradedqualityDmaintenanceA minimal, production-ready MCP server with a simple addition calculator tool that demonstrates integration with the Model Context Protocol.12 npm1MIT
- AlicenseAqualityDmaintenanceA beginner-friendly MCP server built in plain Node.js/JavaScript that exposes five tools (calculator, UUID generator, read notes, get weather, password generator) to teach how the Model Context Protocol works under the hood.5MIT