mcp -ddd-template
A template for MCP implementation using DDD structure with some APIs call as sample.
claude mcp add --transport stdio alexandresanlim-mcp-server-ddd-template node build/main.js
How to use
This MCP server is a Node.js/TypeScript implementation following a Domain-Driven Design (DDD) approach. It exposes MCP protocol-compliant tools over standard input/output (stdio), allowing clients to request Bitcoin-related information via external APIs. The server includes a minimal set of tools such as a traffic-light health check (ping) and a capability to fetch recommended Bitcoin transaction fees from Mempool.space (get-recommended-fees). After building, you run the server with node build/main.js and communicate with it using MCP messages through stdio, enabling integration with clients like automated services or chat clients that support the MCP protocol. The design adheres to a layered architecture (domain, application, infrastructure, interface) to demonstrate clean separation of concerns and testability while providing a practical tool-provider example for MCP clients.
How to install
Prerequisites:
- Node.js (LTS version) and npm or pnpm
- Git
Installation steps:
- Clone the repository git clone https://github.com/alexandresanlim/mcp-server-ddd-template.git
- Navigate to the project directory cd mcp-server-ddd-template
- Install dependencies npm install
- Build the TypeScript sources npm run build
- Run the server node build/main.js
Optional for local development:
- If you want to test as a binary, you can link the project and run the packaged binary after build: npm link mcp-server-ddd-template
Prerequisites mention:
- Ensure your environment has network access for external API calls (e.g., Mempool.space) if you plan to use the get-recommended-fees tool.
Additional notes
Notes and tips:
- The server uses the MCP protocol over stdio, so it expects MCP messages on standard input and writes responses to standard output.
- Tools exposed in this template include:
- get-recommended-fees: fetches recommended Bitcoin transaction fees via Mempool.space.
- ping: basic health check endpoint to verify responsiveness.
- Environment variables and configuration options can be extended in the future by adding more domain/application services or external API clients under infrastructure.
- If you customize or extend tools, ensure they conform to the MCP message schema used by the @modelcontextprotocol/sdk to avoid protocol mismatches.
- Typical build outputs will place the runtime in build/main.js; ensure you start the server with node build/main.js after a successful build.
Related MCP Servers
mcp-router
A Unified MCP Server Management App (MCP Manager).
conductor-tasks
A task management system designed for AI development
dev-to
A remote Model Context Protocol (MCP) server for interacting with the dev.to public API without requiring authentication.
mcp-sysoperator
MCP for Ansible, Terraform, LocalStack, and other IaC tools. Create and iterate IaC
ToolRAG
Unlimited LLM tools, zero context penalties — ToolRAG serves exactly the LLM tools your user-query demands.
mcp-quickstart
Setup an MCP server in 60 seconds.