A Model Context Protocol (MCP) server template for building AI and automation tool APIs.
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- Configuration
- Operations
- Tools
- Resources
- Prompts
- Transport
- Authentication
- Schemas
- Support
- Links
- License
This template starts Model Context Protocol servers. Each derived server owns its behavior and operating decisions.
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.
Create a repository from this template. Replace the package name, description, URLs, keywords, and sample tool.
Run npm ci from the repository root.
Follow this README and the user guide. Read release notes for release history.
Read AGENTS.md and the specifications index before you change files. Keep documents and records in the repository that owns them.
Run eliware-test before handoff. It runs the repository checks.
Keep credentials, secrets, private data, and runtime state out of Git. Use only approved secret stores for secret values.
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.
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.
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.
The starter registers no resources.
The starter registers no prompts.
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.
HTTP requires the bearer token in MCP_TOKEN. Keep the token secret.
Limit HTTP access to approved clients. Use HTTPS for remote access.
Define each tool input with a Zod schema. Test its input and response shape.
For help, questions, or to chat with the author and community, visit:


