DEV Community

Emma Xiang
Emma Xiang

Posted on

How I Built a Production MCP Server with Kiro

How I Built a Production MCP Server with Kiro IDE

TL;DR: I built FeedMob AdPilot, a production-ready MCP server with 6 AI-powered tools, interactive UI components, and PostgreSQL persistence using Kiro IDE. This is the story of how Specs, Steering Docs, Agent Hooks, and MCP integration transformed my development workflow.

🎯 The Challenge

Creating effective advertising campaigns requires expertise across multiple domainsβ€”understanding audiences, crafting copy, designing visuals, and optimizing for platforms. I wanted to build an AI system that could handle this entire workflow conversationally.

The technical challenge? Stitching together technologies that weren't designed to work together:

  • FastMCP for the MCP server
  • @mcp-ui/server for interactive components
  • Claude Agent SDK for AI processing
  • PostgreSQL for data persistence
  • Next.js for the client UI

πŸ—οΈ What I Built

FeedMob AdPilot transforms natural language campaign descriptions into complete advertising assets:

  1. Parse Requirements β†’ Extract campaign parameters from conversation
  2. Conduct Research β†’ Generate comprehensive market reports
  3. Generate Copy β†’ Create platform-optimized variations
  4. Generate Images β†’ Produce visual concepts
  5. Create Mixed Media β†’ Combine assets into final creatives
  6. Campaign Management β†’ Store everything in PostgreSQL

Live Demo: https://sc80sggw884kw448kc0sckw0.coolify-dev-pa.tonob.net/

🎨 The Kiro Difference

Spec-Driven Development (10 Features)

I created formal specifications with three documents each:

.kiro/specs/generate-ad-copy/
β”œβ”€β”€ requirements.md    # User stories + acceptance criteria
β”œβ”€β”€ design.md          # Architecture + correctness properties
└── tasks.md           # Implementation checklist
Enter fullscreen mode Exit fullscreen mode

Impact: Every line of code traces back to a requirement. Zero missed edge cases.

Steering Documents (7 Persistent Contexts)

I taught Kiro once through always-included docs:

  • tech.md - Technology stack and commands
  • fastmcp-integration.md - FastMCP patterns
  • mcp-ui-integration.md - UI component creation
  • agent-tool-patterns.md - Claude SDK integration
  • claude-agent-skills.md - Agent skill development
  • color-guidelines.md - Design system

Impact: Saved 8+ hours of repetitive context across 100+ conversations.

Agent Hooks (4 Automated Workflows)

{
  "name": "Security Pre-Commit Scanner",
  "when": { "type": "fileEdited", "patterns": ["**/*"] },
  "then": {
    "type": "askAgent",
    "prompt": "Scan for API keys, tokens, credentials..."
  }
}
Enter fullscreen mode Exit fullscreen mode

Hooks I automated:

  1. Security scanning on every file edit
  2. MCP-UI docs checker for API changes
  3. MCP builder guidance for server files
  4. Agent skill builder for new tools

Impact: Prevented 3+ major bugs before they reached production.

MCP Integration (6 Servers)

Extended Kiro with specialized capabilities:

  • mcp-ui-docs - Always-current mcp-ui documentation
  • agent-skills - Skill creator and MCP builder
  • context7 - Instant library docs (FastMCP, Zod)
  • exa - Code examples and patterns
  • fetch - External documentation
  • sequential-thinking - Complex problem decomposition

Impact: The mcp-ui-docs server alone saved days of debugging outdated APIs.

πŸ’‘ The Most Impressive Moment

I told Kiro:

"Create a new MCP tool for generating ad images based on the pattern in #File src/tools/generate-ad-copy.ts"

Kiro generated in ONE response:

  • βœ… Complete Zod schema with validation
  • βœ… Agent service with Claude SDK integration
  • βœ… UI factory with interactive components
  • βœ… Error handling with all edge cases
  • βœ… Proper FastMCP registration

It understood the entire project pattern from steering docsβ€”no repeated explanations needed.

🎭 The Frankenstein Architecture

This project is a Frankenstein's monster in the best wayβ€”incompatible technologies brought to life:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MCP Tools (FastMCP)                    β”‚
β”‚  - parseAdRequirements                  β”‚
β”‚  - conductAdResearch                    β”‚
β”‚  - generateAdCopy                       β”‚
β”‚  - generateAdImages                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Agent Services (Claude Agent SDK)      β”‚
β”‚  - 6 specialized agents                 β”‚
β”‚  - Custom skill plugins                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  UI Factories (mcp-ui)                  β”‚
β”‚  - Interactive components               β”‚
β”‚  - Real-time updates                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Data Layer (PostgreSQL)                β”‚
β”‚  - Campaign persistence                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

🚧 Real Challenges I Faced

  1. Gateway Timeouts: Long-running AI operations hitting limits
  2. Tool Call Timeouts: Optimizing agent processing times
  3. Docker Dependencies: Image generation missing libraries
  4. Chatbot Compatibility: Existing mcp-ui clients didn't workβ€”built custom Next.js interface
  5. Agent Skill Design: Getting consistent JSON output from LLMs

Each challenge was solved through iterative fixes with Kiro's help.

πŸ“Š By The Numbers

  • 🎯 6 MCP tools built and deployed
  • πŸ€– 6 agent services with custom skills
  • πŸ“ 10 formal specs with complete traceability
  • πŸ“š 7 steering docs for persistent context
  • πŸͺ 4 agent hooks for automated workflows
  • πŸ”Œ 6 MCP servers integrated
  • ⏱️ 6 days from concept to production
  • πŸ’¬ 100+ conversations with Kiro

πŸŽ“ What I Learned

1. Hybrid Vibe + Spec Wins

Spec Mode for complex features β†’ Structure, traceability, testing
Vibe Mode for iterations β†’ 10x faster bug fixes and adjustments

Neither alone is optimal. The combination is magic.

2. Steering Docs Are Superpowers

Teaching Kiro once vs. teaching it every conversation:

  • Before: 5 minutes/conversation Γ— 100 = 500 minutes wasted
  • After: 0 minutes repetition = 8+ hours saved

3. MCP Integration Enables The Impossible

Without mcp-ui-docs, I would have:

  • Manually searched documentation
  • Used outdated API patterns
  • Spent days debugging production issues

With it: Zero breaking changes, always-current APIs.

4. Hooks Catch Issues Early

The Security Pre-Commit Scanner found issues immediately, not in code review days later.

πŸš€ What's Next

Immediate priorities:

  • Fix gateway timeout issues
  • Optimize agent processing times
  • Complete Docker image generation setup

Future features:

  • Video ad generation for TikTok/Reels
  • A/B testing integration
  • Multi-platform campaigns
  • Real-time analytics
  • Template library

🏁 Final Thoughts

Kiro isn't just an AI coding assistant. It's a development environment where AI understands your project deeply and assists at every stageβ€”from requirements to deployment.

The combination of:

  • βœ… Specs for structured planning
  • βœ… Steering for persistent context
  • βœ… Hooks for automation
  • βœ… MCP for extended capabilities
  • βœ… Vibe for natural iteration

...enabled me to build in 6 days what would have taken 2+ months traditionally.

This isn't incremental improvement. This is transformation.

πŸ”— Links

Built for Kiroween 2025 πŸŽƒ


What's your experience with AI-assisted development? Have you tried spec-driven development with AI? Drop your thoughts in the comments! πŸ‘‡

kiro #mcp #ai #devtools #hackathon #fastmcp #claude

Top comments (0)