Labsco
gvaibhav logo

Market Sizing MCP Server

β˜… 31

from gvaibhav

Provides market research and business analysis by integrating with multiple economic data sources like Alpha Vantage, BLS, and the World Bank.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

Market Sizing MCP Server

License TypeScript MCP Version

A Model Context Protocol server providing market research and business analysis capabilities through 28 tools, 15 business prompts, and integration with 8 economic data sources.

Overview

This MCP server provides comprehensive market research capabilities including:

  • 28 Tools: Market analysis, data access, and business intelligence tools
  • 15 Prompts: Professional business analysis templates for funding, strategy, and research
  • Data Integration: Alpha Vantage, BLS, Census, FRED, IMF, Nasdaq Data Link, OECD, World Bank
  • Smart Defaults: Pre-configured parameters for immediate use without setup
  • Multiple Transports: STDIO, Streamable HTTP, and SSE support

Capabilities

Market Analysis Tools

  • Total Addressable Market (TAM) and Serviceable Addressable Market (SAM) calculations
  • Market size estimation and forecasting
  • Industry analysis and competitive intelligence
  • Market segmentation and opportunity identification
  • Data validation and cross-source verification

Business Intelligence Prompts

  • Startup funding pitch preparation
  • Private equity investment analysis
  • Corporate strategy and market entry
  • Crisis management and regulatory impact assessment
  • ESG and sustainability analysis

Data Access

  • Real-time financial and economic data retrieval
  • Multi-source data aggregation and comparison
  • Intelligent routing based on data type and availability
  • Comprehensive caching for performance optimization

MCP Protocol Features

  • Real-time Notifications: 6 types of business-specific notifications for market intelligence, data source health, calculation milestones, and performance monitoring
  • Multiple Transports: Full support for STDIO, HTTP, and Server-Sent Events (SSE) protocols
  • Resource Access: Documentation and status information available through MCP resources
  • Tool Discovery: Complete tool catalog with smart defaults and validation

Project Structure

TAM-MCP-Server/
β”œβ”€β”€ config/                     # Configuration files
β”‚   β”œβ”€β”€ jest.config.json       # Jest test configuration  
β”‚   β”œβ”€β”€ vitest.config.ts       # Vitest test configuration
β”‚   └── redis.conf             # Redis configuration
β”œβ”€β”€ doc/                       # Documentation
β”‚   β”œβ”€β”€ README.md              # Documentation hub
β”‚   β”œβ”€β”€ consumer/              # Consumer documentation
β”‚   β”‚   β”œβ”€β”€ getting-started.md # Getting started guide
β”‚   β”‚   β”œβ”€β”€ default-values-guide.md # Default values guide
β”‚   β”‚   β”œβ”€β”€ mcp-prompts-guide.md # MCP prompts guide
β”‚   β”‚   β”œβ”€β”€ tools-guide.md     # Tools reference
β”‚   β”‚   └── api-reference.md   # API documentation
β”‚   β”œβ”€β”€ contributor/           # Contributor documentation
β”‚   β”‚   β”œβ”€β”€ contributing.md    # Development guidelines
β”‚   β”‚   └── security.md        # Security policy
β”‚   β”œβ”€β”€ reference/             # Reference documentation
β”‚   β”‚   β”œβ”€β”€ RELEASE-NOTES.md   # Version history
β”‚   β”‚   β”œβ”€β”€ CHANGELOG.md       # Technical changes
β”‚   β”‚   └── requirements.md    # Technical specifications
β”‚   β”œβ”€β”€ reports/               # Technical reports and validation
β”‚   β”‚   β”œβ”€β”€ SEMANTIC-VALIDATION-COMPLETE.md # Validation results
β”‚   β”‚   └── DEFAULT-VALUES-SUMMARY.md # Default values analysis
β”‚   └── archive/               # Historical documents
β”œβ”€β”€ examples/                  # Examples and demos
β”‚   β”œβ”€β”€ README.md              # Examples documentation
β”‚   β”œβ”€β”€ demo-default-values.mjs # Default values demonstration
β”‚   β”œβ”€β”€ demo-integration.mjs   # Integration examples
β”‚   └── TAM-MCP-Server-Postman-Collection.json # API testing
β”œβ”€β”€ scripts/                   # Build and development scripts
β”‚   β”œβ”€β”€ build.sh               # Production build script
β”‚   β”œβ”€β”€ dev-setup.sh          # Development environment setup
β”‚   └── dev.sh                # Development helper script
β”œβ”€β”€ src/                       # Source code
β”‚   β”œβ”€β”€ index.ts               # Main entry point
β”‚   β”œβ”€β”€ server.ts              # Core MCP server
β”‚   β”œβ”€β”€ http.ts                # HTTP transport
β”‚   β”œβ”€β”€ sse-new.ts            # SSE transport
β”‚   β”œβ”€β”€ stdio-simple.ts       # STDIO transport
β”‚   β”œβ”€β”€ config/               # Configuration modules
β”‚   β”œβ”€β”€ services/             # Data source services
β”‚   β”œβ”€β”€ tools/                # MCP tool implementations
β”‚   β”œβ”€β”€ prompts/              # Business prompt templates
β”‚   β”œβ”€β”€ notifications/        # Notification system
β”‚   β”œβ”€β”€ types/                # TypeScript definitions
β”‚   └── utils/                # Utility functions
β”œβ”€β”€ tests/                     # Test suite
β”‚   β”œβ”€β”€ unit/                 # Unit tests
β”‚   β”œβ”€β”€ integration/          # Integration tests
β”‚   β”œβ”€β”€ e2e/                  # End-to-end tests
β”‚   β”œβ”€β”€ scripts/              # Test and validation scripts
β”‚   β”‚   β”œβ”€β”€ test-comprehensive.mjs # Comprehensive testing
β”‚   β”‚   β”œβ”€β”€ test-semantic-validation.mjs # Semantic validation
β”‚   β”‚   └── *.mjs             # Additional test utilities
β”‚   β”œβ”€β”€ fixtures/             # Test data and mock objects
β”‚   β”œβ”€β”€ utils/                # Test utilities and helpers
β”‚   └── setup.ts              # Test configuration
β”œβ”€β”€ logs/                      # Application logs
β”œβ”€β”€ dist/                      # Compiled JavaScript (built)
β”œβ”€β”€ .env.example              # Environment template
β”œβ”€β”€ package.json              # Node.js dependencies
β”œβ”€β”€ tsconfig.json             # TypeScript configuration
└── README.md                 # Main documentation

Tools Reference

MCP Data Access Tools (17 tools)

Direct Data Source Access (13 tools)

SourceToolsDescription
Alpha VantagealphaVantage_getCompanyOverview, alphaVantage_searchSymbolsCompany financials and stock data
BLSbls_getSeriesDataBureau of Labor Statistics data
Censuscensus_fetchIndustryData, census_fetchMarketSizeIndustry and demographic data
FREDfred_getSeriesObservationsFederal Reserve economic data
IMFimf_getDataset, imf_getLatestObservationInternational economic data
Nasdaqnasdaq_getDatasetTimeSeries, nasdaq_getLatestDatasetValueFinancial datasets
OECDoecd_getDataset, oecd_getLatestObservationInternational statistics
World BankworldBank_getIndicatorDataDevelopment indicators

Basic Market Tools (4 tools)

ToolDescription
industry_searchBasic industry data search from sources
tam_calculatorBasic Total Addressable Market calculations
market_size_calculatorMarket size estimation and calculations
company_financials_retrieverEnhanced company financial data retrieval

Business Analysis Tools (11 tools)

ToolDescription
industry_analysisEnhanced multi-source industry analysis
industry_dataDetailed industry intelligence with trends and key players
market_sizeAdvanced market size estimation with confidence scoring
tam_analysisAdvanced Total Addressable Market calculations
sam_calculatorServiceable Addressable Market analysis
market_segmentsHierarchical market segmentation
market_forecastingTime series forecasting with scenarios
market_comparisonMulti-market comparative analysis
data_validationCross-source data quality validation
market_opportunitiesMarket gap identification
generic_data_queryDirect data source service access

Business Prompts (15 templates)

15 Professional Business Analysis Prompts designed for real-world business scenarios:

Strategic Business Analysis

  • startup_funding_pitch - Series A-C funding presentations with TAM/SAM analysis
  • private_equity_research - Investment committee packages for PE deals
  • corporate_strategy_entry - Fortune 500 market entry strategy analysis
  • venture_capital_thesis - VC investment thesis development
  • asset_management_research - Institutional asset management research

Crisis & Specialized Analysis

  • crisis_management_analysis - Emergency market analysis for crisis response
  • regulatory_impact_assessment - Regulatory change impact analysis
  • international_expansion - Global market entry strategy analysis
  • technology_disruption_analysis - Technology disruption impact assessment
  • esg_sustainability_analysis - ESG and sustainability market analysis

Quick Analysis & Guidance

  • market_opportunity_scan - Rapid market opportunity identification
  • competitive_intelligence - Competitive landscape analysis
  • investment_screening - Investment opportunity screening
  • tool_guidance - Interactive guide to TAM MCP Server tools
  • best_practices_guide - Best practices for market analysis

Designed for AI applications serving business analysts, developers, and market researchers with deep market intelligence and data access tools.

Development

Testing

The project uses a comprehensive test structure with Vitest as the primary testing framework:

tests/
β”œβ”€β”€ unit/                    # Fast, isolated component tests
β”œβ”€β”€ integration/            # Component interaction tests
β”œβ”€β”€ e2e/                   # End-to-end workflow tests
β”œβ”€β”€ scripts/               # Integration test scripts
β”‚   β”œβ”€β”€ test-comprehensive.mjs # Comprehensive testing
β”‚   β”œβ”€β”€ test-http-streaming.mjs # HTTP streaming transport
β”‚   β”œβ”€β”€ test-simple-mcp.mjs # Basic MCP functionality
β”‚   └── test-mcp-tool-calls.mjs # Individual tool validation
β”œβ”€β”€ fixtures/              # Test data and mock objects
β”œβ”€β”€ utils/                 # Test utilities and helpers
└── setup.ts              # Vitest global configuration

Running Tests

# Run all tests
npm test

# Run by category
npm run test:unit          # Fast unit tests
npm run test:integration   # Integration tests
npm run test:e2e          # End-to-end tests

# Advanced options
npm run test:coverage     # With coverage report
npm run test:watch       # Watch mode for development
npm run test:ui          # Vitest UI mode
npm run test:ci          # CI-optimized test run

# Run integration scripts
npm run test:scripts              # Comprehensive backend integration
npm run test:scripts:http         # HTTP streaming transport  
npm run test:scripts:simple       # Basic MCP functionality
npm run test:scripts:tools        # Individual tool validation
npm run test:scripts:inspector    # MCP Inspector compatibility

# Or run directly
node tests/scripts/test-comprehensive.mjs
node tests/scripts/test-http-streaming.mjs

API Testing with Postman

Import the comprehensive Postman collection for testing both MCP endpoints and backend API integrations:

MCP Server Testing Collection

  1. Import Collection: examples/TAM-MCP-Server-Postman-Collection.json
  2. Set Environment Variables:
  3. Run Tests:
    • Health check and server status
    • MCP session initialization
    • All 28 tools (11 market analysis + 17 data access)
    • Resource access endpoints
    • Session management and cleanup

Newman CLI Testing Automate Postman tests from command line:

# Install Newman
npm install -g newman

# Run backend API tests
newman run examples/TAM-MCP-Server-Postman-Collection.json \
  -e tests/postman/environments/TAM-MCP-Server-Environment.postman_environment.json \
  --reporters cli,json

# Or use npm script
npm run test:postman

Test Coverage

  • Unit Level: Individual tool functionality and business logic
  • Integration Level: MCP protocol compliance and server behavior
  • System Level: Complete workflows through real transports
  • API Level: REST endpoints and session management
  • Performance: Response time and resource usage monitoring

Code coverage reports are generated in the coverage/ directory.

Project Structure

src/
β”œβ”€β”€ index.ts              # Main entry point
β”œβ”€β”€ server.ts             # MCP server implementation
β”œβ”€β”€ http.ts               # HTTP transport
β”œβ”€β”€ sse-new.ts           # SSE transport
β”œβ”€β”€ stdio-simple.ts      # STDIO transport
β”œβ”€β”€ config/              # Configuration modules
β”‚   └── apiConfig.ts     # API endpoint configurations
β”œβ”€β”€ services/            # Data source services
β”‚   β”œβ”€β”€ dataService.ts   # Main data orchestrator
β”‚   β”œβ”€β”€ cache/           # Caching services
β”‚   β”‚   β”œβ”€β”€ cacheService.ts # In-memory caching
β”‚   β”‚   └── persistenceService.ts # File persistence
β”‚   └── dataSources/     # Individual data source clients
β”‚       β”œβ”€β”€ alphaVantageService.ts
β”‚       β”œβ”€β”€ blsService.ts
β”‚       β”œβ”€β”€ censusService.ts
β”‚       β”œβ”€β”€ fredService.ts
β”‚       β”œβ”€β”€ imfService.ts
β”‚       β”œβ”€β”€ nasdaqDataService.ts
β”‚       β”œβ”€β”€ oecdService.ts
β”‚       └── worldBankService.ts
β”œβ”€β”€ tools/               # MCP tool implementations
β”‚   └── market-tools.ts  # MarketAnalysisTools class
β”œβ”€β”€ prompts/             # Business prompt templates
β”œβ”€β”€ notifications/       # Notification system
β”œβ”€β”€ types/               # TypeScript definitions
β”‚   β”œβ”€β”€ index.ts         # Core schemas and types
β”‚   β”œβ”€β”€ dataSources.ts   # Data source interfaces
β”‚   └── cache.ts         # Cache-related types
└── utils/               # Utility functions
    β”œβ”€β”€ dataTransform.ts # Data transformation
    β”œβ”€β”€ envHelper.ts     # Environment parsing
    β”œβ”€β”€ rateLimit.ts     # Rate limiting
    └── logger.ts        # Winston logging

tests/
β”œβ”€β”€ unit/                # Unit tests
β”œβ”€β”€ integration/         # Integration tests
β”œβ”€β”€ e2e/                 # End-to-end tests
└── scripts/             # Test automation scripts

API Testing

Use the included Postman collection:

# Import collection
examples/TAM-MCP-Server-Postman-Collection.json

# Or run with Newman
npm run test:postman

Technology Stack

  • Language: TypeScript 5.x
  • Protocol: MCP 2025-03-26
  • Framework: Express.js 4.x
  • Validation: Zod schemas
  • Testing: Vitest + Postman
  • Cache: NodeCache (Redis optional)
  • Logging: Winston

Documentation

Complete Documentation

Development Documentation

Testing Documentation

Examples & Scripts

Implementation Guides

MCP Resources Access

All documentation is also accessible through the MCP protocol:

// Discover all available documentation
{
  "method": "resources/list",
  "params": {}
}

// Read specific documentation
{
  "method": "resources/read", 
  "params": {
    "uri": "file:///README.md"
  }
}

Available Documentation Resources:

  • README.md - Complete project overview and feature documentation
  • Getting Started Guide - Quick setup and first-use instructions
  • Configuration Guide - Environment setup and API key management
  • Tools Reference - Complete tool documentation and usage examples
  • Prompts Guide - Business analysis prompt templates and scenarios
  • API Reference - Complete API documentation and integration guides
  • Security Policy - Security guidelines and best practices
  • Contributing Guide - Development and contribution instructions

Contributing

Contributions welcome! See Contributing Guidelines for requirements.

License

MIT License - see LICENSE file for details.


Created by Vaibhav Gupta