市场规模
STDIO具有28个工具、15个业务提示和8个经济数据源的市场研究MCP服务器
具有28个工具、15个业务提示和8个经济数据源的市场研究MCP服务器
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.
This MCP server provides comprehensive market research capabilities including:
Market Analysis Tools
Business Intelligence Prompts
Data Access
MCP Protocol Features
# Clone repository git clone https://github.com/your-username/TAM-MCP-Server.git cd TAM-MCP-Server # Install dependencies npm install # Configure environment cp .env.example .env # Edit .env with your API keys # Build and start (HTTP - recommended) npm run build npm run start:http
# Use development script chmod +x scripts/dev-setup.sh ./scripts/dev-setup.sh # Or manual setup npm install npm run build npm run start # HTTP server npm run start:stdio # STDIO transport
# Build image docker build -t tam-mcp-server . # Run container with environment file docker run -p 3000:3000 --env-file .env tam-mcp-server # Or run with individual environment variables docker run -p 3000:3000 \ -e ALPHA_VANTAGE_API_KEY=your_key_here \ -e FRED_API_KEY=your_key_here \ -e NODE_ENV=production \ tam-mcp-server
HTTP Transport (Recommended) For Claude Desktop, add to your configuration:
{ "mcpServers": { "tam": { "command": "npm", "args": ["run", "start:http"], "cwd": "/path/to/TAM-MCP-Server" } } }
STDIO Transport (Alternative)
{ "mcpServers": { "tam": { "command": "npm", "args": ["run", "start:stdio"], "cwd": "/path/to/TAM-MCP-Server" } } }
For MCP Inspector:
# HTTP mode npm run start:http # STDIO mode npx @modelcontextprotocol/inspector npm run start:stdio
Get professional market insights instantly - no parameter research required!
All 28 tools include intelligent default values that let you start analyzing immediately:
// Call any tool with empty parameters - defaults automatically applied { "name": "alphaVantage_getCompanyOverview", "arguments": {} // Server provides: symbol="AAPL" (Apple Inc.) } { "name": "tam_analysis", "arguments": {} // Server provides: $10B market, 15% growth, 5-year projection }
Professional Defaults Include:
Perfect for:
// Market analysis with defaults { "name": "tam_analysis", "arguments": {} } // Company overview with default symbol (AAPL) { "name": "alphaVantage_getCompanyOverview", "arguments": {} } // Custom parameters { "name": "market_size", "arguments": { "industryId": "technology", "region": "north-america" } }
Access professional templates through the prompts interface:
// List available prompts { "method": "prompts/list" } // Get startup funding prompt { "method": "prompts/get", "params": { "name": "startup_funding_pitch", "arguments": { "company_name": "TechCorp", "industry": "SaaS" } } }
The TAM MCP Server provides 28 total MCP tools organized in three complementary tiers:
Purpose: Raw access to external data sources
Target Users: Developers, data engineers, custom analytics builders
alphaVantage_getCompanyOverview: Get detailed company overview and financialsalphaVantage_searchSymbols: Search for stock symbols and company namesbls_getSeriesData: Retrieve Bureau of Labor Statistics employment datacensus_fetchIndustryData: Access U.S. Census Bureau industry statisticscensus_fetchMarketSize: Get market size data from Census surveysfred_getSeriesObservations: Fetch Federal Reserve economic data seriesimf_getDataset: Access International Monetary Fund datasetsimf_getLatestObservation: Get latest IMF economic observationsnasdaq_getDatasetTimeSeries: Retrieve Nasdaq Data Link time seriesnasdaq_getLatestDatasetValue: Get latest values from Nasdaq datasetsoecd_getDataset: Access OECD statistical datasetsoecd_getLatestObservation: Get latest OECD economic observationsworldBank_getIndicatorData: Fetch World Bank development indicatorsPurpose: Foundational market analysis capabilities
Target Users: Business analysts starting with basic market research
industry_search: Basic industry data retrieval from multiple sourcestam_calculator: Basic Total Addressable Market calculationsmarket_size_calculator: Basic market size estimation with methodology explanationscompany_financials_retriever: Basic company financial data retrievalPurpose: Advanced market intelligence and comprehensive business analysis
Target Users: Senior analysts, market researchers, investment teams
industry_analysis: Enhanced multi-source industry analysis with intelligent rankingindustry_data: Detailed industry intelligence with trends, ESG, and key playersmarket_size: Advanced market size estimation and analysis with confidence scoringtam_analysis: Advanced Total Addressable Market calculations with scenario projectionssam_calculator: Serviceable Addressable Market with constraint analysismarket_segments: Hierarchical market segmentation analysismarket_forecasting: Time series forecasting with scenario analysismarket_comparison: Multi-market comparative analysis and rankingsdata_validation: Cross-source data quality validation and scoringmarket_opportunities: Market gap and growth opportunity identificationgeneric_data_query: Direct access to any data source service and methodThe server integrates with 8 data sources:
HTTP Server (Recommended)
npm run start:http # Server available at http://localhost:3000
STDIO Transport
npm run start:stdio
Server-Sent Events
npm run start:sse
Copy .env.example to .env and configure as needed:
# Server Configuration PORT=3000 NODE_ENV=development LOG_LEVEL=info # API Keys (Optional - tools work without keys but with limited data) ALPHA_VANTAGE_API_KEY=your_key_here CENSUS_API_KEY=your_key_here FRED_API_KEY=your_key_here NASDAQ_DATA_LINK_API_KEY=your_key_here BLS_API_KEY=your_key_here # Cache Configuration (Optional) CACHE_TTL_DEFAULT_MS=86400000 CACHE_TTL_ALPHA_VANTAGE_MS=86400000 CACHE_TTL_FRED_MS=86400000
Required Keys:
No Key Required:
All tools include professional defaults. See Default Values Guide for complete parameter lists.
Example Defaults:
In-Memory Cache (Default)
Redis Cache (Production)
const dataService = new EnhancedDataService({ cache: { type: 'redis' }, apiKeys: { /* your keys */ } });
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
| Source | Tools | Description | 
|---|---|---|
| Alpha Vantage | alphaVantage_getCompanyOverview, alphaVantage_searchSymbols | Company financials and stock data | 
| BLS | bls_getSeriesData | Bureau of Labor Statistics data | 
| Census | census_fetchIndustryData, census_fetchMarketSize | Industry and demographic data | 
| FRED | fred_getSeriesObservations | Federal Reserve economic data | 
| IMF | imf_getDataset, imf_getLatestObservation | International economic data | 
| Nasdaq | nasdaq_getDatasetTimeSeries, nasdaq_getLatestDatasetValue | Financial datasets | 
| OECD | oecd_getDataset, oecd_getLatestObservation | International statistics | 
| World Bank | worldBank_getIndicatorData | Development indicators | 
| Tool | Description | 
|---|---|
industry_search | Basic industry data search from sources | 
tam_calculator | Basic Total Addressable Market calculations | 
market_size_calculator | Market size estimation and calculations | 
company_financials_retriever | Enhanced company financial data retrieval | 
| Tool | Description | 
|---|---|
industry_analysis | Enhanced multi-source industry analysis | 
industry_data | Detailed industry intelligence with trends and key players | 
market_size | Advanced market size estimation with confidence scoring | 
tam_analysis | Advanced Total Addressable Market calculations | 
sam_calculator | Serviceable Addressable Market analysis | 
market_segments | Hierarchical market segmentation | 
market_forecasting | Time series forecasting with scenarios | 
market_comparison | Multi-market comparative analysis | 
data_validation | Cross-source data quality validation | 
market_opportunities | Market gap identification | 
generic_data_query | Direct data source service access | 
15 Professional Business Analysis Prompts designed for real-world business scenarios:
Designed for AI applications serving business analysts, developers, and market researchers with deep market intelligence and data access tools.
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
# 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
Import the comprehensive Postman collection for testing both MCP endpoints and backend API integrations:
MCP Server Testing Collection
examples/TAM-MCP-Server-Postman-Collection.jsonserverUrl: http://localhost:3000sessionId: (automatically set after initialization)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
Code coverage reports are generated in the coverage/ directory.
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
Use the included Postman collection:
# Import collection examples/TAM-MCP-Server-Postman-Collection.json # Or run with Newman npm run test:postman
Services showing as disabled despite API keys
.env file is in project rootMCP Inspector connection issues
npx @modelcontextprotocol/inspector node dist/stdio-simple.jsBuild errors
npm install to update dependenciesrm -rf dist && npm run buildNo data returned from tools
generic_data_query toolAll 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:
Contributions welcome! See Contributing Guidelines for requirements.
MIT License - see LICENSE file for details.
Created by Vaibhav Gupta