rules-mcp-server
MCP server providing interactive prompts for designing and reviewing microfrontend and microservice architectures, with embedded development rules and best practices.
README
rules-mcp-server
MCP (Model Context Protocol) server providing development prompts with embedded rules for microfrontend and microservice applications.
Overview
This MCP server provides interactive prompts for designing and reviewing microfrontend and microservice architectures. All prompts have direct access to development rules and best practices.
Architecture: This server implements the standard three-step MCP server pattern:
- Create a Server instance and register prompts
- Create a transport (stdio for local, HTTP for remote)
- Connect the server to the transport
Content Management: All prompts and rules are defined in markdown files with YAML frontmatter metadata in the content/ directory:
content/prompts/- Interactive prompt templatescontent/rules/- Development rules organized by system
This approach makes it easy to add, edit, and organize content without modifying code. See content/README.md for details on the markdown format and how to add new content.
Features
Prompts
The server provides interactive prompts that guide you through:
- design-microfrontend: Design a new microfrontend application with architectural guidance
- design-microservice: Design a new microservice with best practices
- review-architecture: Review existing architecture against established patterns
Each prompt has access to the complete rule set and provides contextual guidance based on your specific needs
Example queries:
// Get TypeScript-specific microfrontend architecture rules
{
"name": "get-microfrontend-rules",
"arguments": {
"category": "architecture",
"language": "typescript",
"codeType": "source"
}
}
// Get all microservice testing rules
{
"name": "get-microservice-rules",
"arguments": {
"category": "testing",
"codeType": "test"
}
}
Rules
The server has access to comprehensive development rules organized by:
Systems:
- Microfrontend architecture
- Microservice architecture
Categories:
- Architecture patterns and decisions
- Performance optimization
- Security best practices
- Testing strategies
Languages:
- TypeScript, JavaScript, Python, Java, Go, Rust
Rules are embedded in prompt responses and provided contextually based on your design needs.
Installation
Prerequisites
- Node.js v24.x or later (latest version recommended)
- npm v11.x or later
From GitHub Packages
This package is published to GitHub Packages. To install it, you need to configure npm to use GitHub Packages for the @yurykabernik scope.
Setup authentication (one-time):
- Create a GitHub Personal Access Token with
read:packagesscope - Add to your
~/.npmrc(replace<YOUR_GITHUB_TOKEN>with your actual token):
@yurykabernik:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<YOUR_GITHUB_TOKEN>
Global installation:
npm install -g @yurykabernik/rules-mcp-server
rules-mcp-server
Use with npx (no installation):
npx @yurykabernik/rules-mcp-server
As NPM Package (Public Registry)
If published to npm public registry:
Global installation:
npm install -g rules-mcp-server
rules-mcp-server
Use with npx (no installation):
npx -y rules-mcp-server
From Source
- Clone the repository:
git clone https://github.com/YuryKabernik/rules-mcp-server.git
cd rules-mcp-server
- Install dependencies and build:
npm install
npm run build
Using Dev Container (Recommended for Development)
This project includes a VS Code Dev Container configuration for a consistent development environment:
- Install Docker and VS Code
- Install the Dev Containers extension
- Clone the repository and open in VS Code
- Click "Reopen in Container" when prompted (or use F1 ā "Dev Containers: Reopen in Container")
- The environment will be automatically set up with all dependencies
See .devcontainer/README.md for more details.
Usage
Running the Server
Development Mode (with auto-reload)
npm run dev
Production Mode
npm start
Watch Mode (auto-rebuild on changes)
npm run watch
Using with MCP Clients
The server uses stdio transport and can be integrated with any MCP-compatible client.
Claude Desktop Configuration
Add to your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"rules-mcp-server": {
"command": "npx",
"args": ["@yurykabernik/rules-mcp-server"]
}
}
}
Or if installed globally:
{
"mcpServers": {
"rules-mcp-server": {
"command": "rules-mcp-server"
}
}
}
Or from source:
{
"mcpServers": {
"rules-mcp-server": {
"command": "node",
"args": ["/absolute/path/to/rules-mcp-server/build/index.js"]
}
}
}
See mcp-config.example.json for reference.
Development
Project Structure
rules-mcp-server/
āāā content/ # š All MCP content (markdown files)
ā āāā rules/ # Development rules by system
ā ā āāā microfrontend/
ā ā āāā microservice/
ā āāā tools/ # Tool definitions
ā āāā prompts/ # Prompt templates
ā āāā resources/ # Documentation resources
āāā build/ # Compiled JavaScript (generated)
āāā package.json # Project metadata and dependencies
āāā tsconfig.json # TypeScript configuration
āāā README.md # This file
Content Management: All server content is in the content/ directory as markdown files with frontmatter metadata. See content/README.md for details on how to add or modify content.
Available Scripts
Development:
npm run build- Compile TypeScript to JavaScriptnpm run watch- Watch mode for development (auto-rebuild)npm run dev- Run server in development mode with tsxnpm start- Run the compiled servernpm run prepare- Automatically builds before npm publish
Testing:
npm test- Run all unit tests (fast, ~1 second)npm run test:watch- Run tests in watch modenpm run test:ui- Open visual test UInpm run test:coverage- Generate coverage report
Code Quality:
npm run lint- Run ESLint to check code qualitynpm run lint:fix- Auto-fix ESLint issuesnpm run format- Format code with Prettiernpm run format:check- Check code formatting
Code Quality Tools
This project uses ESLint and Prettier for consistent code styling:
- ESLint: Enforces code quality rules and catches common errors
- Prettier: Ensures consistent code formatting
- EditorConfig: Maintains consistent coding styles across different editors
IDE Integration:
- VS Code settings are pre-configured in
.vscode/settings.json - Install recommended extensions from
.vscode/extensions.json - Code is auto-formatted on save
Adding Content
Rules are now stored as markdown files with frontmatter metadata in the rules/ directory. This makes it easy to add and edit content without modifying TypeScript code.
1. Adding Rules
Quick Start:
-
Create a new markdown file in the appropriate directory:
rules/microfrontend/for microfrontend rulesrules/microservice/for microservice rules
-
Add frontmatter metadata at the top:
---
id: mfe-arch-002
title: Your Rule Title
description: Brief description
category: architecture
system: microfrontend
language: typescript # optional
codeType: source # optional
tags:
- tag1
- tag2
---
# Your Rule Content
Write your rule content in markdown...
- Build and test:
npm run build
npm start
Detailed Guide: See content/rules/README.md for complete documentation on:
- Markdown format and frontmatter fields
- Naming conventions
- Adding examples and code snippets
- Best practices for writing rules
Adding a new project system:
To add support for a new system (e.g., "monolith"):
- Create a new directory:
content/rules/monolith/ - Add markdown rule files in that directory following the frontmatter format
- Create a new tool definition in
content/tools/get-monolith-rules.md - Restart the server - new content is automatically loaded
See content/README.md for detailed instructions.
2. Adding Resources
Resources provide documentation and guides. Add new markdown files in content/resources/ with proper frontmatter:
---
uri: rules://monolith/architecture
name: Monolith Architecture Guide
description: Guide for building monolithic applications
mimeType: text/markdown
---
# Your resource content here...
3. Adding Prompts
Prompts provide interactive templates. Add new markdown files in content/prompts/ with proper frontmatter:
---
name: design-monolith
description: Help design a monolithic application
arguments:
- name: app_name
description: Name of the application
required: true
---
# Your prompt template here with {{variables}}...
Technical Details
Built With
- Runtime: Node.js v24.x (ESM modules)
- Language: TypeScript 5.x
- SDK: @modelcontextprotocol/sdk v1.26.0 (latest stable)
- š v2 Migration Guide - v2 planned for Q1 2026, architecture ready for smooth migration
- Build Tool: TypeScript compiler (tsc)
- Dev Runner: tsx (TypeScript execute)
MCP Capabilities
This server implements the following MCP capabilities:
- ā Tools (for rules and best practices)
- ā Resources (for documentation)
- ā Prompts (for interactive guidance)
Transport
Uses stdio transport for communication with MCP clients. The server follows the standard MCP three-step architecture pattern:
- Create Server: Instantiate MCP Server and register handlers
- Create Transport: Set up stdio transport for local integrations
- Connect: Wire the server to the transport
For detailed architecture documentation, see docs/ARCHITECTURE.md.
Continuous Integration
This project uses GitHub Actions for automated testing and quality checks:
- CI Workflow: Runs on every push to every branch and all pull requests
- Build verification (TypeScript compilation)
- Unit tests (Vitest)
- Build artifact upload
See CI_WORKFLOW.md for detailed documentation.
Contributing
This is a proof-of-concept project for aggregating rules across multiple similar projects. Contributions for rules, resources, and prompts are welcome!
License
ISC
Troubleshooting
Server Not Starting
-
Ensure Node.js v24.x or later is installed:
node --version -
Rebuild the project:
npm run build -
Check for errors in the console output
MCP Client Not Connecting
- Verify the path to the build/index.js file is correct
- Ensure the build directory exists and contains compiled files
- Check MCP client logs for connection errors
Build Errors
-
Clean and reinstall dependencies:
rm -rf node_modules package-lock.json npm install -
Verify TypeScript version:
npx tsc --version
Future Enhancements
- [ ] Add comprehensive microfrontend rules (Module Federation, routing, state management, etc.)
- [ ] Add comprehensive microservice rules (API design, service mesh, resilience patterns, etc.)
- [ ] Add detailed architectural guides
- [ ] Include code examples and templates
- [ ] Add validation rules and linting recommendations
- [ ] Include testing strategies and examples
- [ ] Add CI/CD pipeline recommendations
Links
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.