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 assists with managing database sharding strategies. It is activated when the user needs to implement horizontal database sharding to scale beyond single-server limitations. The skill supports designing sharding strategies, distributing data across multiple database instances, and implementing consistent hashing, automatic rebalancing, and cross-shard query coordination. Use this skill when the user mentions "database sharding", "sharding implementation", "scale database", or "horizontal partitioning". The plugin helps design and implement sharding for high-scale applications.
tools
This skill enables Claude to perform comprehensive database security scans using the database-security-scanner plugin. It is triggered when the user requests a security assessment of a database, including identifying vulnerabilities like weak passwords, SQL injection risks, and insecure configurations. The skill leverages OWASP guidelines to ensure thorough coverage and provides remediation suggestions. Use this skill when the user asks to "scan database security", "check database for vulnerabilities", "perform OWASP compliance check on database", or "assess database security posture". The plugin supports PostgreSQL and MySQL.
testing
This skill enables Claude to design and visualize database schemas. It leverages normalization guidance (1NF through BCNF), relationship mapping, and ERD generation to create efficient and well-structured databases. Use this skill when the user requests to "design a database schema", "create a database model", "generate an ERD", "normalize a database", or needs help with "database design best practices". The skill is triggered by terms like "database schema", "ERD diagram", "database normalization", and "relational database design".
tools
This skill enables Claude to manage database replication, failover, and high availability configurations using the database-replication-manager plugin. It is designed to assist with tasks such as setting up master-slave replication, configuring automatic failover, monitoring replication lag, and implementing read scaling. Use this skill when the user requests help with "database replication", "failover configuration", "high availability", "replication lag", or "read scaling" for databases like PostgreSQL or MySQL. The plugin facilitates both physical and logical replication strategies.