Get the FREE Ultimate OpenClaw Setup Guide →

mcp -ddd-template

A template for MCP implementation using DDD structure with some APIs call as sample.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository git clone https://github.com/alexandresanlim/mcp-server-ddd-template.git
  2. Navigate to the project directory cd mcp-server-ddd-template
  3. Install dependencies npm install
  4. Build the TypeScript sources npm run build
  5. 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

Sponsor this space

Reach thousands of developers