koladev32/mcp-echo-server
If you are the rightful owner of mcp-echo-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The MCP Echo Input Server is a simple JavaScript-based server that utilizes the Model Context Protocol (MCP) to provide an echo service.
MCP Echo Input Server
A simple Model Context Protocol (MCP) server written in JavaScript that provides a single echo tool.
Features
- Single
echotool that returns the input text with a "[user] said: " prefix - Configurable user name via
USER_NAMEenvironment variable - Built using the official MCP SDK
- Runs on stdio transport
Installation
Using npx (Recommended - No installation required)
You can use the package directly without installing it:
npx -y mcp-echo-input-server
From Source
- Clone the repository:
git clone https://github.com/yourusername/mcp-echo-server.git
cd mcp-echo-server
- Install dependencies:
npm install
Usage
Running the Server
Using npx (No installation required):
npx -y mcp-echo-input-server
If running from source:
npm start
The server will run on stdio and can be connected to by MCP clients.
Environment Variables
- USER_NAME: The name to use in the echo output (defaults to "user" if not set)
Example:
# Using npx
USER_NAME="Alice" npx -y mcp-echo-input-server
# If running from source
USER_NAME="Alice" npm start
Tool Description
The server provides one tool:
- echo: Echoes back the input text
- Input:
text(string) - The text to echo back - Output: Text with "[user] said: " prefix (user name from USER_NAME environment variable)
- Input:
Example Usage
When connected to an MCP client, you can call the echo tool with:
{
"name": "echo",
"arguments": {
"text": "Hello, World!"
}
}
This will return:
John said: Hello, World!
Development
Running Tests
npm test
Claude Desktop Configuration
You can configure both options in your Claude Desktop config:
{
"mcpServers": {
"echo-server": {
"command": "npx",
"args": ["-y", "mcp-echo-input-server"],
"env": {
"USER_NAME": "YourName"
}
},
"echo-server-local-build": {
"command": "node",
"args": ["/path/to/your/mcp-echo-server/index.js"],
"env": {
"USER_NAME": "YourName"
}
}
}
}
Server Options:
echo-server: Uses npx (no installation required, always latest version)echo-server-local-build: Uses local build (faster startup, requires local source code)
The -y flag ensures npx automatically answers "yes" to any prompts during package execution.
Project Structure
index.js- Main server implementationtest.js- Test suite for the echo toolpackage.json- Project configuration and dependenciesLICENSE- MIT License
Requirements
- Node.js 18 or higher
- MCP SDK (@modelcontextprotocol/sdk)
Publishing
This package is published to the NPM registry. To publish updates:
- Update the version in
package.json - Run
npm testto ensure all tests pass - Run
npm publishto publish to NPM
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request