Skip to main content
Glama
alexandresanlim

mcp-server-ddd-template

šŸš€ 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.

Related MCP server: Bitcoin-MCP-Server

šŸ“ 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!

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready

  • MCP server for Blockscout

  • A paid remote MCP for hosted MCP server, built to return verdicts, receipts, usage logs, and audit-r

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexandresanlim/mcp-server-ddd-template'

If you have feedback or need assistance with the MCP directory API, please join our Discord server