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., "@Boilerplate MCP Servershow me the project structure for a weather API integration"
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.
Boilerplate MCP Server
A foundation for developing custom Model Context Protocol (MCP) servers in TypeScript. Provides a complete layered architecture pattern, working example tools, and developer infrastructure to connect AI assistants with external APIs and data sources.
Why Use This Boilerplate?
Production-Ready Architecture: Follows the same pattern used in published MCP servers, with clean separation between CLI, tools, controllers, and services
Type Safety: Built with TypeScript for improved developer experience, code quality, and maintainability
Working Example: Includes fully implemented tools demonstrating the complete pattern from CLI to API integration
Testing Framework: Ready-to-use testing infrastructure for unit and CLI integration tests, with coverage reporting
Complete Developer Tooling: Pre-configured ESLint, Prettier, TypeScript, and CI/CD workflows
Related MCP server: WithSeismic MCP
What is MCP?
Model Context Protocol (MCP) is an open standard for securely connecting AI systems to external tools and data sources. This boilerplate implements the MCP specification with a clean, layered architecture that can be extended to build custom MCP servers for any API or data source.
Prerequisites
Node.js (>=18.x): Download
Git: For version control
Quick Start
Architecture Overview
Layered Architecture
The boilerplate follows a clean, layered architecture that promotes maintainability and clear separation of concerns:
1. CLI Layer (src/cli/*.cli.ts)
Purpose: Command-line interfaces that parse arguments and call controllers
Pattern: Use
commanderfor argument parsing, call controllers, handle errors withhandleCliErrorNaming:
<feature>.cli.ts
2. Tools Layer (src/tools/*.tool.ts)
Purpose: MCP tool definitions exposed to AI assistants
Pattern: Use
zodfor schema validation, call controllers, format responses for MCPNaming:
<feature>.tool.tswith types in<feature>.types.ts
3. Controllers Layer (src/controllers/*.controller.ts)
Purpose: Business logic orchestration, error handling, response formatting
Pattern: Return standardized
ControllerResponseobjects, throw errors with contextNaming:
<feature>.controller.tswith optional<feature>.formatter.ts
4. Services Layer (src/services/*.service.ts)
Purpose: External API interactions and data handling
Pattern: Pure API calls with minimal logic, return raw data
Naming:
<feature>.service.tsorvendor.<vendor>.<feature>.service.ts
5. Utils Layer (src/utils/*.util.ts)
Purpose: Shared functionality across the application
Key Utils: Logging, error handling, formatting, configuration
Developer Guide
Development Scripts
Debugging Tools
MCP Inspector: Visual tool for testing your MCP tools
Run server with
npm run dev:serverOpen http://localhost:5173 in your browser
Server Logs: Enable with
DEBUG=true npm run dev:serveror in config
Create ~/.mcp/configs.json:
Building Custom Tools
1. Define Service Layer
Create a new service in src/services/ to interact with your external API:
2. Create Controller
Add a controller in src/controllers/ to handle business logic:
3. Implement MCP Tool
Create a tool definition in src/tools/:
4. Add CLI Support
Create a CLI command in src/cli/:
5. Register Components
Update the entry points to register your new components:
Publishing Your MCP Server
Update package.json with your details:
{ "name": "your-mcp-server-name", "version": "1.0.0", "description": "Your custom MCP server", "author": "Your Name", // Other fields... }Update README.md with your tool documentation
Build:
npm run buildTest:
npm run start:serverPublish:
npm publish
Testing Best Practices
Unit Tests: Test utils and pure functions in isolation
Controller Tests: Test business logic with mocked service calls
Integration Tests: Test CLI with real dependencies
Coverage Goal: Aim for >80% test coverage