# Mcp Server Ddd Template

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

- **Type:** MCP server
- **Install:** `agentstack add mcp-alexandresanlim-mcp-server-ddd-template`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [alexandresanlim](https://agentstack.voostack.com/s/alexandresanlim)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [alexandresanlim](https://github.com/alexandresanlim)
- **Source:** https://github.com/alexandresanlim/mcp-server-ddd-template

## Install

```sh
agentstack add mcp-alexandresanlim-mcp-server-ddd-template
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 🚀 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

```bash
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:

```bash
node build/main.js
```

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

```bash
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

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

## 🛠️ Development

### Build Commands

```bash
# 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!**

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [alexandresanlim](https://github.com/alexandresanlim)
- **Source:** [alexandresanlim/mcp-server-ddd-template](https://github.com/alexandresanlim/mcp-server-ddd-template)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-alexandresanlim-mcp-server-ddd-template
- Seller: https://agentstack.voostack.com/s/alexandresanlim
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
