template MCP server
Commit Oct 27, 2026Provides a foundational template for building and deploying Model Context Protocol servers for AI and automation tool APIs.
Also known as eliware/mcp-server-template
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Oct 27, 2026
- License
- MIT
What is template MCP?
template provides a foundational template for building and deploying Model Context Protocol servers for AI and automation tool APIs.
Summary generated from the project's README
About template MCP server
This template provides a foundation for developers to build and deploy Model Context Protocol servers for AI and automation tool APIs. It is designed for users working with Node.js 26 or later and requires an MCP client that supports protocol revision 2026-07-28. The starter kit includes an echo tool that returns input text as JSON to demonstrate basic functionality.
Users can run the server using two different transport methods. The default is HTTP, which listens on port 1234 and requires an MCP_TOKEN for authentication. Alternatively, developers can use stdio mode by passing the --stdio flag, which does not require a token or open an HTTP listener. The template supports containerization via Docker and allows for custom configuration of the port and log level.
To build a custom server, developers replace the sample tool and package details. Tool logic is organized within the src/tools/ directory, and input validation is handled using Zod schemas. This structure ensures that each derived server maintains its own specific behaviors and operating decisions.
What you can do with it
- 1Initialize a new MCP serverCreate a new repository from this template to start building custom AI tool APIs.
- 2Run a local stdio serverStart the server in stdio mode to avoid needing an authentication token.
- 3Deploy via Docker containersBuild a container image to prepare the server for deployment.
- 4Validate tool inputsUse Zod schemas to define and test the shape of tool inputs and responses.
Written from the project's README. Every use case is checked against a quote from it.
README
View on GitHub@eliware/mcp-server-template

A Model Context Protocol (MCP) server template for building AI and automation tool APIs.
Table of Contents
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- Configuration
- Operations
- Tools
- Resources
- Prompts
- Transport
- Authentication
- Schemas
- Support
- Links
- License
Features
This template starts Model Context Protocol servers. Each derived server owns its behavior and operating decisions.
Requirements
Use Node.js 26 or later. Use an MCP client that supports protocol revision 2026-07-28.
Use npm 12 or later for repository validation.
Setup
Create a repository from this template. Replace the package name, description, URLs, keywords, and sample tool.
Run npm ci from the repository root.
Usage
Follow this README and the user guide. Read release notes for release history.
Development
Read AGENTS.md and the specifications index before you change files. Keep documents and records in the repository that owns them.
Testing
Run npm test before handoff. It runs the repository checks.
Troubleshooting
If HTTP startup reports a missing token, set MCP_TOKEN in your environment or .env file.
If a container health check fails, confirm that MCP_TOKEN and PORT match the container settings. See the server guide.
Security
Keep credentials, secrets, private data, and runtime state out of Git. Use only approved secret stores for secret values.
Configuration
Set MCP_TOKEN before HTTP startup. Stdio mode does not require this token.
PORT defaults to 1234. LOG_LEVEL defaults to info.
Store the token in an untracked .env file or an approved secret store.
Operations
Run node bin/mcp-server-template.mjs for HTTP. Run node bin/mcp-server-template.mjs --stdio for stdio.
The HTTP listener uses 1234 by default. Build the image with docker build -t mcp-server-template ..
Set MCP_TOKEN in .env before you run docker compose up --build.
Set HOST_PORT to change the host listener number.
Deploy a released image by version tag and recorded SHA-256 digest. Publication does not deploy the server.
Tools
The server discovers tool adapters from tools/. Keep tool logic in src/tools/.
The starter provides an echo tool. It returns the input text as JSON.
Resources
The starter registers no resources.
Prompts
The starter registers no prompts.
Transport
HTTP is the default transport. Use PORT to set the listener number.
Pass --stdio to start stdio. Stdio mode does not open an HTTP listener or require MCP_TOKEN.
Use a client that supports protocol revision 2026-07-28.
Authentication
HTTP requires the bearer token in MCP_TOKEN. Keep the token secret.
Limit HTTP access to approved clients. Use HTTPS for remote access.
Schemas
Define each tool input with a Zod schema. Test its input and response shape.
Support
For help, questions, or to chat with the author and community, visit:
Links
License
template MCP questions
How do I start the server in stdio mode?
You can start the server in stdio mode by running the command: node bin/mcp-server-template.mjs --stdio.
Does stdio mode require an authentication token?
No, stdio mode does not require an MCP_TOKEN.
What are the requirements for the Node.js version?
You must use Node.js version 26 or later.
How can I change the default port for the HTTP listener?
You can use the PORT environment variable to set the listener number.


