003-skills/.claude/skills/nixtla-mcp-server-builder/SKILL.md
Generate production-ready MCP server implementations from PRD tool specifications with schema validation, error handling, and testing infrastructure. Use when building MCP servers for Nixtla plugins, implementing tool handlers, or scaffolding server infrastructure. Trigger with 'build MCP server', 'generate MCP implementation', or 'scaffold MCP tools'.
npx skillsauth add intent-solutions-io/plugins-nixtla nixtla-mcp-server-builderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate complete, production-ready MCP (Model Context Protocol) server implementations from PRD tool specifications, enabling rapid development of Claude Code plugin backends.
This skill automates MCP server development by:
Key Benefits:
pip install mcp)pip install pydantic)Expected PRD Structure:
## Functional Requirements
### FR-X: MCP Server Tools
Expose N tools to Claude Code:
1. `tool_name` - Tool description
2. `another_tool` - Another description
...
The script automatically:
Usage:
python {baseDir}/scripts/build_mcp_server.py \
--prd /path/to/PRD.md \
--output /path/to/mcp_server/ \
--plugin-name nixtla-plugin-name
Creates complete MCP server with:
mcp_server.py - Main server implementation:
from mcp.server import Server
from mcp.server.stdio import stdio_server
from pydantic import BaseModel
# Tool schemas
class ToolNameInput(BaseModel):
param1: str
param2: int = 14
class ToolNameOutput(BaseModel):
status: str
result: dict
# Server initialization
app = Server("plugin-name")
@app.call_tool()
async def tool_name(arguments: dict) -> dict:
"""Tool description from PRD"""
# Validate input
input_data = ToolNameInput(**arguments)
# TODO: Implement tool logic
result = {"data": "placeholder"}
# Return validated output
return ToolNameOutput(
status="success",
result=result
).dict()
Key Features:
For each tool, creates handler stub with:
Example Handler:
@app.call_tool()
async def calculate_roi(arguments: dict) -> dict:
"""Calculate ROI comparing TimeGPT vs. build-in-house."""
try:
# Validate input
input_data = CalculateRoiInput(**arguments)
# TODO: Implement ROI calculation logic
# 1. Parse input parameters
# 2. Calculate 5-year TCO
# 3. Generate comparison metrics
# Placeholder result
result = {
"roi": 245.0,
"payback_months": 6,
"total_savings": 500000
}
# Return validated output
return CalculateRoiOutput(
status="success",
roi_percentage=result["roi"],
details=result
).dict()
except ValidationError as e:
return {"status": "error", "message": str(e)}
except Exception as e:
logging.error(f"calculate_roi failed: {e}")
return {"status": "error", "message": "Internal server error"}
Generates Pydantic models for all tools:
schemas.py:
from pydantic import BaseModel, Field
from typing import Optional, List, Dict
class CalculateRoiInput(BaseModel):
"""Input schema for calculate_roi tool."""
current_infrastructure_cost: float = Field(..., description="Annual cost in USD")
forecast_volume: int = Field(..., description="Number of series to forecast")
team_size: int = Field(default=0, description="Current data science team size")
class CalculateRoiOutput(BaseModel):
"""Output schema for calculate_roi tool."""
status: str
roi_percentage: float
payback_months: int
details: Dict
Creates comprehensive test suite:
test_mcp_server.py:
import pytest
from mcp_server import app, calculate_roi
class TestCalculateRoiTool:
"""Test calculate_roi MCP tool."""
@pytest.mark.asyncio
async def test_valid_input(self):
"""Test with valid ROI calculation inputs."""
result = await calculate_roi({
"current_infrastructure_cost": 100000,
"forecast_volume": 1000,
"team_size": 5
})
assert result["status"] == "success"
assert "roi_percentage" in result
@pytest.mark.asyncio
async def test_invalid_input(self):
"""Test with missing required fields."""
result = await calculate_roi({})
assert result["status"] == "error"
@pytest.mark.asyncio
async def test_edge_cases(self):
"""Test edge cases (zero cost, large volumes)."""
result = await calculate_roi({
"current_infrastructure_cost": 0,
"forecast_volume": 1000000
})
assert result["status"] == "success"
Creates plugin.json for server metadata:
{
"name": "nixtla-plugin-name",
"version": "0.1.0",
"description": "Plugin description from PRD",
"mcp_server": {
"command": "python",
"args": ["mcp_server.py"],
"env": {
"NIXTLA_API_KEY": "${NIXTLA_API_KEY}"
}
},
"tools": [
{
"name": "calculate_roi",
"description": "Calculate ROI comparing TimeGPT vs. build-in-house",
"inputSchema": {
"type": "object",
"properties": {
"current_infrastructure_cost": {"type": "number"},
"forecast_volume": {"type": "integer"}
},
"required": ["current_infrastructure_cost", "forecast_volume"]
}
}
]
}
Generates supporting files:
requirements.txt:
mcp>=1.0.0
pydantic>=2.0.0
python-dotenv>=1.0.0
README.md:
# Plugin MCP Server
## Installation
pip install -r requirements.txt
## Running
python mcp_server.py
## Testing
pytest test_mcp_server.py -v
.env.example:
NIXTLA_API_KEY=nixak-your-api-key-here
The script generates:
Directory Structure:
mcp_server/
├── mcp_server.py # Main server
├── schemas.py # Validation schemas
├── test_mcp_server.py # Tests
├── plugin.json # Configuration
├── requirements.txt # Dependencies
├── README.md # Documentation
└── .env.example # Environment template
Missing PRD File:
Error: PRD not found at /path/to/PRD.md
Solution: Verify PRD path and ensure file exists
No MCP Tools Found:
Warning: No MCP tools section found in PRD
Solution: Ensure PRD has "### FR-X: MCP Server Tools" section
Invalid Tool Definition:
Error: Tool 'calculate_roi' missing description
Solution: Ensure all tools have format: `tool_name` - Description
Server Startup Failure:
Error: MCP server failed to start on port 3000
Solution: Check port availability, verify dependencies installed
python {baseDir}/scripts/build_mcp_server.py \
--prd 000-docs/000a-planned-plugins/implemented/nixtla-roi-calculator/02-PRD.md \
--output 005-plugins/nixtla-roi-calculator/mcp_server \
--plugin-name nixtla-roi-calculator \
--verbose
Output:
✓ Parsed PRD: Found 4 MCP tools
- calculate_roi
- generate_report
- compare_scenarios
- export_salesforce
✓ Generated mcp_server.py (412 lines)
✓ Generated schemas.py (8 Pydantic models)
✓ Generated test_mcp_server.py (16 test functions)
✓ Generated plugin.json
✓ Generated supporting files (README, requirements.txt, .env.example)
Server ready! Start with: python mcp_server.py
python {baseDir}/scripts/build_mcp_server.py \
--prd PRD.md \
--output mcp_server/ \
--dry-run
Output:
[DRY RUN] Would generate:
- mcp_server/mcp_server.py (estimate: 350 lines)
- mcp_server/schemas.py (4 tools, 8 models)
- mcp_server/test_mcp_server.py (12 test functions)
- mcp_server/plugin.json
- mcp_server/README.md
- mcp_server/requirements.txt
- mcp_server/.env.example
python {baseDir}/scripts/build_mcp_server.py \
--prd PRD.md \
--output mcp_server/ \
--no-tests
python {baseDir}/scripts/build_mcp_server.py \
--prd updated_PRD.md \
--output existing_mcp_server/ \
--update \
--backup
Output:
⚠️ Existing server detected. Creating backup...
✓ Backup created: existing_mcp_server.backup.20251221_223000/
✓ Updated mcp_server.py (added 2 new tools)
✓ Updated schemas.py (added 4 new models)
✓ Updated test_mcp_server.py (added 8 new tests)
{baseDir}/scripts/build_mcp_server.py{baseDir}/assets/templates/mcp_server_template.py{baseDir}/references/EXAMPLE_MCP_SERVER.pytools
This skill enables Claude to create and execute load tests for performance validation. It is designed to generate load test scripts using tools like k6, JMeter, and Artillery, based on specified test scenarios. Use this skill when the user requests to create a "load test", conduct "performance testing", validate "application performance", or needs a "stress test" to identify breaking points in the application. The skill helps define performance thresholds and provides execution instructions.
testing
This skill enables Claude to collect comprehensive infrastructure performance metrics across compute, storage, network, containers, load balancers, and databases. It is triggered when the user requests "collect infrastructure metrics", "monitor server performance", "set up performance dashboards", or needs to analyze system resource utilization. The skill configures metrics collection, sets up aggregation, and helps create infrastructure dashboards for health monitoring and capacity tracking. It supports configuration for Prometheus, Datadog, and CloudWatch.
tools
This skill enables Claude to monitor and analyze application error rates to improve reliability. It is used when the user needs to track and understand errors occurring in their application, including HTTP errors, application exceptions, database errors, external API errors, background job errors, and client-side errors. Use this skill when the user asks to "monitor errors", "analyze error rates", "track application errors", or requests help with "error monitoring". It sets up comprehensive error tracking and alerting based on defined thresholds.
development
This skill automates the setup of distributed tracing for microservices. It helps developers implement end-to-end request visibility by configuring context propagation, span creation, trace collection, and analysis. Use this skill when the user requests to set up distributed tracing, implement observability, or troubleshoot performance issues in a microservices architecture. The skill is triggered by phrases such as "setup tracing", "implement distributed tracing", "configure opentelemetry", or "add observability to microservices".