Skip to main content
Glama
Aditya201206

AI Competitive Research Assistant (NitroStack MCP)

by Aditya201206
README.md
# AI Competitive Research Assistant (NitroStack MCP)

> **Hackathon Edition**: An end-to-end AI agent & interactive widget platform built on NitroStack MCP for automated startup competitive intelligence, web discovery, feature matrix comparison, and strategic market gap analysis.

---

## ๐ŸŒŸ Overview

The **AI Competitive Research Assistant** takes a raw startup or product idea and automatically executes a **7-step competitive research pipeline** over the Model Context Protocol (MCP):

1. **`understand_idea`**: Analyzes the idea into category, core problem, target audience, value prop, and search terms.
2. **`discover_competitors`**: Performs deterministic web search (Tavily) to discover real competitors.
3. **`extract_competitor_profiles`**: Gathers deep company profiles (pricing, features, tech stack, funding, strengths/weaknesses, USP).
4. **`compare_competitors`**: Builds comparative feature matrix tables and identifies market leaders.
5. **`market_gap_analysis`**: Identifies unaddressed customer problems and whitespace opportunities.
6. **`innovation_scoring`**: Calculates an Innovation Potential Index score across 4 key dimensions.
7. **`generate_report`**: Synthesizes a C-level executive strategy report.

All 7 steps are orchestratable via a single master tool: **`run_competitive_research`**!

---

## ๐Ÿ—๏ธ Architecture

```text
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚            End User / LLM (NitroStudio / MCP)          โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚           run_competitive_research (Orchestrator)      โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  IdeaService  โ”‚   โ”‚ TavilyClient   โ”‚   โ”‚  GeminiService       โ”‚
โ”‚  (NLP Parsing)โ”‚   โ”‚ (Live Search)  โ”‚   โ”‚  (Structured Output) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ”‚                       โ”‚                       โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚           NitroStack UI Widgets (@Widget SDK)          โ”‚
 โ”‚  - /idea-summary           - /competitor-list           โ”‚
 โ”‚  - /competitor-profile     - /competitor-comparison    โ”‚
 โ”‚  - /pipeline-progress                                  โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

---

## ๐Ÿš€ Quick Start

### 1. Prerequisites
- **Node.js**: v18 or higher
- **npm**: v9 or higher

### 2. Environment Variables Setup
Create a `.env` file in the root directory:

```env
GEMINI_API_KEY=your_gemini_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
```

*(Note: If `TAVILY_API_KEY` is omitted or set to a placeholder, the system gracefully uses high-quality simulated competitor search data).*

### 3. Installation
```bash
npm install
```

### 4. Build Workspace
```bash
npm run build
```

### 5. Run Development Server with Widgets
```bash
npm run dev
```

---

## ๐Ÿ› ๏ธ MCP Tools Reference

| Tool Name | Input Schema | Interactive Widget | Description |
| :--- | :--- | :--- | :--- |
| **`run_competitive_research`** | `{ idea, industry?, geography?, targetAudience? }` | `/pipeline-progress` | Master orchestrator tool executing the entire 7-step pipeline. |
| **`understand_idea`** | `{ idea, industry?, geography?, targetAudience? }` | `/idea-summary` | Deconstructs startup idea into structured components. |
| **`discover_competitors`** | `{ idea, category?, coreProblem?, valueProposition?, keywords? }` | `/competitor-list` | Live web search (Tavily) to discover competitors. |
| **`extract_competitor_profiles`** | `{ competitors, ideaAnalysis? }` | `/competitor-profile` | Extracts pricing, features, tech stack, funding, strengths/weaknesses. |
| **`compare_competitors`** | `{ profiles }` | `/competitor-comparison` | Generates feature comparison table, winner badges, and market leader rankings. |

---

## ๐Ÿ“‚ Project Structure

```text
c:\Nitroooo\
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ api/                  # External API clients (TavilyClient with retry logic)
โ”‚   โ”œโ”€โ”€ modules/              # MCP Tool Controllers (@Tool & @Widget decorators)
โ”‚   โ”œโ”€โ”€ services/             # Core Business Logic & AI Pipeline Services
โ”‚   โ”œโ”€โ”€ types/                # Strict Zod Schemas & TypeScript interfaces
โ”‚   โ”œโ”€โ”€ widgets/              # Next.js 14 Interactive Frontend Widgets
โ”‚   โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ idea-summary/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ competitor-list/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ competitor-profile/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ competitor-comparison/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ pipeline-progress/
โ”‚   โ”‚   โ”œโ”€โ”€ widget-manifest.json
โ”‚   โ”‚   โ””โ”€โ”€ next.config.js
โ”‚   โ”œโ”€โ”€ app.module.ts         # Root AppModule
โ”‚   โ””โ”€โ”€ index.ts              # Server Entry Point
โ”œโ”€โ”€ dist/                     # Compiled Production Server
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md
```

---

## ๐Ÿงช Testing in NitroStudio

1. Download & open **NitroStudio** ([https://nitrostack.ai/studio](https://nitrostack.ai/studio)).
2. Connect to local project (`c:\Nitroooo`).
3. Select `run_competitive_research` under **Tools**.
4. Enter input:
   ```json
   {
     "idea": "An AI-powered interview prep platform with live mock interviews and feedback"
   }
   ```
5. Click **Execute Tool** to view the live 7-step progress tracker and synthesized executive report widget!

---

## ๐Ÿ“œ License
MIT License. Built for the NitroStack MCP Hackathon.

TDQS

B3.3/5.0

Scored across 8 tools

Disambiguation5/5

Each tool targets a distinct stage of the research pipeline, from idea understanding through competitor discovery, profiling, comparison, gap analysis, scoring, and final report generation. The only potential overlap is run_competitive_research, but that is clearly positioned as an orchestrator of the full pipeline, not a duplicate.

Naming Consistency4/5

Most tools follow a verb_noun pattern (understand_idea, discover_competitors, extract_competitor_profiles, compare_competitors, generate_report, run_competitive_research). Two tools (market_gap_analysis, innovation_scoring) deviate with a noun_noun style, creating a minor inconsistency but no real confusion.

Tool Count5/5

Eight tools map cleanly onto the seven-step research pipeline, with the orchestrating run_competitive_research earning its place for automation. This is a well-scoped count for a specialized research assistant.

Completeness5/5

The full lifecycle of competitive research is covered: idea analysis, competitor discovery, profiling, comparison, gap identification, scoring, and report generation. No obvious missing stage, and the pipeline even includes an automated end-to-end runner, making the surface self-sufficient.

Maintenance

ActivitySlowing
ResponsivenessNo issues