build-clean-mcp-architecture

Audit TypeScript MCP servers against canonical layered architecture boundaries.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur-secondary --skill build-clean-mcp-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-clean-mcp-architecture
Source: https://github.com/yigitkonur/skills-by-yigitkonur-secondary/tree/main/skills/build-clean-mcp-architecture
Command: npx skills add https://github.com/yigitkonur/skills-by-yigitkonur-secondary --skill build-clean-mcp-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps teams place, refactor, and audit TypeScript MCP-Use/Server code to enforce Clean Architecture layer boundaries, guard import flows, and ensure a single, canonical bootstrap.

Core Features & Use Cases

  • Enforces canonical folder layout (domain, application, handlers, gateways, presenters, infrastructure, resources, prompts, shared) and boundary rules.
  • Provides a structured refactor playbook to move monolithic tool definitions into per-tool handlers and per-feature use cases, with a single composition root.
  • Documents audit practices, dependency rules, and a strict config seam that centralizes environment reads.

Quick Start

Audit an existing MCP server and refactor it toward the canonical layered architecture.

Frequently Asked Questions about build-clean-mcp-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce clean architecture boundaries in an MCP server?

You can enforce clean architecture boundaries in an MCP server by validating separation of concerns across domain, application, handlers, and infrastructure layers using dependency-cruiser gates and strict import path rules.

What is the best way to refactor monolithic tool definitions in a TypeScript MCP server?

The best way to refactor monolithic tool definitions in a TypeScript MCP server is to follow a structured playbook that moves logic into per-tool handlers and per-feature use cases, wiring them through a single composition root.

How does dependency-cruiser work with MCP server folder layouts?

Dependency-cruiser works with MCP server folder layouts by auditing import flows between canonical directories like gateways, presenters, and shared code, ensuring type-safety and preventing unauthorized cross-layer dependencies.

Can I centralize environment reads when bootstrapping an MCP server?

Yes, you can centralize environment reads when bootstrapping an MCP server by enforcing a strict config seam that isolates configuration logic from domain and application layers during the canonical bootstrap wiring process.

When do I need a canonical layered architecture for my MCP server?

You need a canonical layered architecture for your MCP server when monolithic tool definitions and unmanaged import paths begin threatening type-safety, code maintainability, and clear separation of concerns across features.

What are the limitations of bootstrapping an MCP server without clean architecture?

Bootstrapping an MCP server without clean architecture risks circular dependencies, scattered environment reads, and uncontrolled infrastructure coupling, making type-safety validation and feature refactoring significantly harder as the codebase scales.