Example MCP Server
Implements the MCP server in Node.js, allowing developers to create and expose custom tools for AI assistants
Click on "Install 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 Serveradd 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 toolsaddC
Add two numbers together
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic function without mentioning error handling, precision limits, or output format, leaving significant gaps for a tool that performs a mathematical operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded in a single sentence with zero waste. Every word directly contributes to understanding the tool's purpose without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations, output schema, and low schema description coverage, the description is incomplete. It doesn't address behavioral aspects like error cases or result format, making it inadequate for a tool with two parameters and no structured support.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, but the description implies the parameters are numbers to be added. It doesn't specify parameter roles or constraints beyond what the schema's type hints provide, resulting in a baseline score due to minimal added value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Add') and resource ('two numbers'), making it immediately understandable. However, it doesn't distinguish from sibling tools (like 'getTime'), which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives or in what context it should be applied. It simply states what it does without any usage context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
getTimeB
Get the current server time
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states what the tool does ('Get the current server time') but doesn't disclose behavioral traits like whether this requires authentication, has rate limits, returns a specific format, or has any side effects. For a tool with zero annotation coverage, this is a significant gap in behavioral transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for this simple tool. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is minimally complete—it states what the tool does. However, without annotations or output schema, it lacks information about return format or behavioral constraints that would be helpful for an agent. It's adequate but has clear gaps for a tool that returns data.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to explain parameters since there are none, and it correctly doesn't mention any. This exceeds the baseline of 3 for high schema coverage by being perfectly appropriate for a parameterless tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get the current server time' clearly states the verb ('Get') and resource ('current server time'), making the purpose immediately understandable. It's not tautological with the name 'getTime' since it specifies 'server time' rather than just 'time'. However, it doesn't differentiate from sibling tools beyond the obvious domain difference.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance about when to use this tool versus alternatives. While the sibling tool 'add' appears unrelated (likely mathematical), there's no explicit comparison or context about when this time-fetching operation is appropriate versus other time-related operations that might exist in a broader context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- Changed
getTime1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
2 tool updates
- First observed
add - First observed
getTime
TDQS
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.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.119MIT
- 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.151MIT
- FlicenseNot gradedqualityDmaintenanceA minimal Model Context Protocol server that provides basic arithmetic tools and a comprehensive meeting analysis prompt template for processing transcripts. It serves as a clean example for developers to learn how to build, test, and integrate MCP servers with Claude Desktop.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mtar786/mcpServer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server