mcp-server-ddd-template
A template MCP server using Domain-Driven Design, providing Bitcoin fee recommendations and a health check tool.
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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.