mcp-server-ddd-template

mcp-server-ddd-template

A template MCP server using Domain-Driven Design, providing Bitcoin fee recommendations and a health check tool.

Category
Visit Server

README

šŸš€ MCP Server DDD Template

This repository is a template implementation of a Model Context Protocol (MCP) server in Node.js/TypeScript, designed to demonstrate a clean, layered architecture using Domain-Driven Design (DDD) principles. It provides tools to obtain Bitcoin-related information via external APIs.

✨ Key Features

  • šŸ—ļø Template Project: This codebase serves as a reference template for structuring MCP servers with DDD, ready for customization and production use.
  • šŸ”Œ MCP Protocol: Communicates via stdio using the MCP protocol (@modelcontextprotocol/sdk).
  • šŸ›ļø Layered DDD Architecture: Clear separation of domain, application, infrastructure, and interface layers.
  • ⚔ TypeScript: Fully typed with modern TypeScript for better development experience.

šŸ“ Project Structure

src/
ā”œā”€ā”€ domain/                  # šŸ›ļø Domain models and response interfaces
│   └── models/
│       └── responses/
│           ā”œā”€ā”€ ** interfaces responses **
ā”œā”€ā”€ infrastructure/          # šŸ”Œ External API clients and request services
│   ā”œā”€ā”€ interfaces/
│   │   └── IApiClient.ts
│   └── services/
│       ā”œā”€ā”€ clients/
│       │   └── ** client api
│       └── requests/
│           ā”œā”€ā”€ ** requests services **
ā”œā”€ā”€ application/             # āš™ļø Business logic and helpers
│   ā”œā”€ā”€ services/
│   │   ā”œā”€ā”€ ** services implementation **
│   └── helpers/
│       └── ** helpers **
ā”œā”€ā”€ interface/               # šŸŽ® Controllers (MCP tool registration)
│   └── controllers/
│       ā”œā”€ā”€ base/
│       │   └── BaseToolsController.ts
│       ā”œā”€ā”€ **controllers to inteface**
│       └── index.ts
ā”œā”€ā”€ shared/                  # šŸ”— Shared types/parameters
│   └── parameters/
│       └── **interfaces parameters**
└── main.ts                  # šŸš€ Application entry point

šŸš€ Getting Started

git clone https://github.com/alexandresanlim/mcp-server-ddd-template.git
cd mcp-server-ddd-template
npm install
npm run build

šŸŽÆ Usage

After building, you can run the server directly:

node build/main.js

Or, if registered as a binary (for example, mcp-server-ddd-template):

npm link
mcp-server-ddd-template

The server will start on standard output (stdio) and wait for MCP requests.

šŸ› ļø Available Tools in this sample

  • šŸ’° get-recommended-fees: Get recommended Bitcoin transaction fees from Mempool.space
  • šŸ”— ping: Simple health check endpoint

šŸ”— Integration Example

To use this MCP server as a tool provider in a client (e.g., Claude client), you can either reference a local build or use the published npm package.

šŸ“‚ Using Local Build Path

"btc-server": {
    "command": "node",
    "args": [
        "{your project path}/mcp-server-ddd-template/build/main.js"
    ]
}

šŸ› ļø Development

Build Commands

# Build for Unix/Linux/macOS
npm run build

# Build for Windows
npm run build:windows

# Run the server
npm run server

Dependencies

  • @modelcontextprotocol/sdk: MCP protocol implementation
  • zod: Runtime type validation
  • typescript: Type safety and compilation

šŸ¤ Contributing

Pull requests are welcome! Feel free to open issues or suggest improvements for this template repository.

⭐ Star this repository if you find it helpful!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured