A modular TypeScript Model Context Protocol (MCP) server for specialized software development analysis and prompt engineering with programmatic prompt assembly
npm install @n0zer0d4y/mercury-spec-opsbash
git clone https://github.com/n0zer0d4y/mercury-spec-ops.git
cd mercury-spec-ops
npm install
npm run build
`
2. Run the server locally:
`bash
npm run mcp
`
$3
`bash
npm install -g @n0zer0d4y/mercury-spec-ops
`
Or use directly with npx (no installation required):
`bash
npx @n0zer0d4y/mercury-spec-ops
`
Usage
$3
Configure the server in your MCP client (Claude Desktop, Cursor, etc.):
#### Using npx (Recommended - No Installation)
For Claude Desktop (claude_desktop_config.json):
`json
{
"mcpServers": {
"mercury-spec-ops": {
"command": "npx",
"args": ["-y", "@n0zer0d4y/mercury-spec-ops"]
}
}
}
`
For Cursor (~/.cursor/mcp.json):
`json
{
"mcpServers": {
"mercury-spec-ops": {
"timeout": 60,
"type": "stdio",
"command": "npx",
"args": ["-y", "@n0zer0d4y/mercury-spec-ops"]
}
}
}
`
#### Using Local Installation
For Claude Desktop (claude_desktop_config.json):
`json
{
"mcpServers": {
"mercury-spec-ops": {
"command": "node",
"args": ["/path/to/mercury-spec-ops/dist/src/server.js"]
}
}
}
`
For Cursor (~/.cursor/mcp.json):
`json
{
"mcpServers": {
"mercury-spec-ops": {
"timeout": 60,
"type": "stdio",
"command": "node",
"args": ["/path/to/mercury-spec-ops/dist/src/server.js"]
}
}
}
`
Windows Local Path Example (Cursor):
`json
{
"mcpServers": {
"mercury-spec-ops": {
"timeout": 60,
"type": "stdio",
"command": "node",
"args": [
"C:\\Development\\Projects\\MCP-Servers\\mercury-spec-ops\\dist\\src\\server.js"
]
}
}
}
`
Important Notes:
- npx: Automatically fetches the latest version from npm (recommended for most users)
- Local: Replace the path with your actual project location and run npm run build first
- Restart: Restart your MCP client after configuration changes
Workflow Examples
$3
1. User Prompt: "Analyze this Node.js/TypeScript codebase focusing on security and performance"
2. Claude Desktop Action:
- Calls the codebase-analysis-prompt with technology_stack: "node.js,typescript" and analysis_focus: "security,performance"
- System programmatically assembles: base prompt + Node.js module + TypeScript module + security module + performance module
- The prompt instructs Claude to first read the resource://codebase-analysis-template
- Template builder assembles: base template + Node.js sections + TypeScript sections + security sections + performance sections
- Claude reads the dynamically assembled template
- Claude analyzes the codebase and generates a comprehensive technology-specific report
$3
1. User Prompt: "Analyze this critical security bug in React application"
2. Claude Desktop Action:
- Calls the bug-analysis-prompt with technology_stack: "react", severity_level: "critical", and bug_type: "security"
- System assembles: base prompt + React module + security module + critical severity module
- Template includes: general sections + React-specific + security-specific + critical-severity sections
- Claude reads the bug analysis template
- Claude analyzes the bug and generates a comprehensive technology and severity-specific report
$3
1. User Prompt: "Help me create a PRD for a React-based task management application"
2. Claude Desktop Action:
- Calls the prd-prompt with project details and technology_stack: "react"
- System assembles: base prompt + React module
- Template builder includes: base PRD template + React-specific considerations
- Claude reads the technology-enhanced PRD template
- Claude generates a comprehensive PRD with React-specific sections
Prompt Details
$3
- Name: prd-prompt
- Arguments:
- project_name (required): Name of the software project
- project_description (required): Brief description of the project
- target_audience (optional): Target audience for the product (enum values)
- project_type (optional): Type of project (enum values)
- key_features (optional): Key features to include in the PRD
- technology_stack (optional): Technology stack to be used (enum values)
- custom_instructions (optional): Custom instructions for PRD generation
$3
- Name: codebase-analysis-prompt
- Arguments:
- repository_path (required): Path to the repository to analyze
- technology_stack (required): Technology stack used in the codebase (enum values)
- analysis_focus (optional): Focus areas for analysis (enum values)
- custom_instructions (optional): Custom instructions for codebase analysis
$3
- Name: bug-analysis-prompt
- Arguments:
- repository_path (required): Path to the repository with bugs to analyze
- bug_description (required): Description of the bug or issue to analyze
- affected_components (optional): Components affected by the bug
- severity_level (optional): Severity level of the bug (enum values)
- bug_type (optional): Type of bug (enum values)
- technology_stack (optional): Technology stack used in the affected components (enum values)
- custom_instructions (optional): Custom instructions for bug analysis
Resource Details
$3
- URI: resource://prd-template
- Format: Markdown
- Content: Modular PRD template with technology-specific sections that dynamically assemble based on input parameters
$3
- URI: resource://codebase-analysis-template
- Format: Markdown
- Content: Modular codebase analysis template with technology and focus-specific sections that assemble based on analysis parameters
$3
- URI: resource://bug-analysis-template
- Format: Markdown
- Content: Modular bug analysis template with severity and technology-specific sections that assemble based on bug parameters
Development
$3
`
src/
├── server.ts # Main MCP server implementation
├── types/
│ ├── enums.ts # All enum definitions (31 tech + 10 focus)
│ └── index.ts # Type definitions and exports
├── prompts/
│ ├── modules/ # 45 modular prompt components
│ │ ├── technology/ # 31 technology-specific modules
│ │ │ ├── languages/ # 11 language modules
│ │ │ ├── runtimes/ # 1 runtime module
│ │ │ ├── frameworks/ # 10 framework modules (3 frontend, 7 backend)
│ │ │ ├── databases/ # 4 database modules
│ │ │ ├── cloud/ # 3 cloud platform modules
│ │ │ └── tools/ # 2 DevOps tool modules
│ │ ├── analysis-focus/ # 10 focus-area modules
│ │ └── bug-severity/ # 4 severity-specific modules
│ ├── base-prompts/ # Base prompt templates
│ └── prompt-builder.ts # Programmatic prompt assembly
├── resources/
│ ├── templates/ # Modular template components
│ │ ├── prd/ # 10 PRD template modules
│ │ ├── codebase-analysis/ # 8 codebase analysis modules
│ │ └── bug-analysis/ # 4 bug analysis modules
│ └── template-builder.ts # Programmatic template assembly
└── __tests__/ # Comprehensive test suite (66 tests)
├── utils/ # Utility function tests (enum parser)
├── prompts/ # Prompt builder tests
├── resources/ # Template builder tests
└── types/ # Enum and type tests
`
$3
The project includes a comprehensive test suite with 88% coverage:
`bash
Run all tests
npm test
Run tests in watch mode
npm run test:watch
Run tests with coverage report
npm run test:coverage
Run tests with interactive UI
npm run test:ui
Test MCP integration
npm run test:mcp
`
Test Statistics:
- 66 tests (100% passing)
- 88.48% overall coverage
- Statement coverage: 88.48%
- Line coverage: 88.70%
$3
`bash
npm run build
`
$3
`bash
npm run lint
`
Extending the System
$3
1. Add the technology to the TechnologyStack enum in src/types/enums.ts
2. Create a new module file in the appropriate category:
- Languages: src/prompts/modules/technology/languages/
- Frameworks: src/prompts/modules/technology/frameworks/frontend/ or backend/
- Databases: src/prompts/modules/technology/databases/
- Cloud: src/prompts/modules/technology/cloud/
- Tools: src/prompts/modules/technology/tools/
3. Implement the TechnologyPromptModule interface
4. Export from the category's index.ts
5. Register it in prompt-builder.ts
6. Add corresponding template sections in src/resources/templates/
7. Write tests in src/__tests__/
$3
1. Add the focus area to the AnalysisFocus enum in src/types/enums.ts
2. Create a new module file in src/prompts/modules/analysis-focus/
3. Implement the AnalysisFocusPromptModule interface
4. Export from analysis-focus/index.ts
5. Register it in prompt-builder.ts
6. Add corresponding template sections
7. Write tests
$3
1. Add the severity to the BugSeverity enum in src/types/enums.ts
2. Create a new module file in src/prompts/modules/bug-severity/
3. Implement the BugSeverityPromptModule` interface