About Simple MCP Server
A TypeScript example MCP server for developers, with one echo tool and stdio communication.
Key features
- 01TypeScript implementation
- 02Echo tool
- 03stdio communication
- 04npm publishing setup
Use cases
- 01Testing an MCP client connection
- 02Learning a minimal MCP server setup
MCP support
Exposes an `echo` tool to MCP clients over stdio; clients launch it through their MCP configuration.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMESimple MCP Server
A basic example of an MCP (Model Context Protocol) server built with TypeScript and @modelcontextprotocol/sdk.
This server provides a simple echo tool that repeats back any message sent to it.
Features
- Built with TypeScript
- Uses
@modelcontextprotocol/sdk - Includes a basic
echotool - Configured for npm publishing
- Communicates over stdio
Prerequisites
- Node.js (version 16 or higher recommended)
- npm (usually comes with Node.js)
Installation (as a developer)
- Clone the repository:
git clone <repository-url> cd simple-mcp-server - Install dependencies:
npm install - Build the server:
npm run build
Running the Server Locally
After building, you can run the compiled server directly using Node:
node build/index.js
The server will start and listen for MCP communication over standard input/output. You'll see a message like "Simple MCP Server running on stdio" in your terminal's standard error.
Usage with an MCP Client (e.g., Claude Desktop)
To use this server with an MCP client like Claude for Desktop, you need to configure the client to launch this server.
-
Build the server: Make sure you have run
npm run buildin the server's project directory. -
Find the absolute path: Get the absolute path to the compiled entry point, which is
build/index.jswithin your project directory.- On macOS/Linux, you can use
pwdin thebuilddirectory or combinepwdfrom the root with/build/index.js. - On Windows, navigate to the
builddirectory in Explorer and copy the path, or usecd buildand thencdin Command Prompt.
- On macOS/Linux, you can use
-
Edit the client configuration: Open the MCP client's configuration file (e.g.,
claude_desktop_config.jsonfor Claude Desktop).- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the server entry: Add an entry for your server under
mcpServers. Replace/ABSOLUTE/PATH/TO/YOUR/PROJECT/simple-mcp-serverwith the actual absolute path you found in step 2.{ "mcpServers": { "simple-server": { // Use the name defined in src/index.ts "command": "node", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/simple-mcp-server/build/index.js" ] } // ... other servers might be listed here } } -
Restart the client: Save the configuration file and restart your MCP client application.
Now, the client should be able to see and use the "simple-server" and its echo tool.
Publishing to npm (Optional)
- Make sure your
package.jsonhas the correct details (name, version, author, repository, etc.). - Ensure you are logged into npm (
npm login). - Run the publish command:
npm publish --access public # Use --access public for public packages
Once published, users could potentially use npx to run it, similar to the filesystem example, if the package.json were configured with a bin entry.
Development
- Build:
npm run build(compiles TypeScript to JavaScript inbuild/) - Watch:
npm run build -- --watch(continuously watches for changes and recompiles)
Comments
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.