Integrated for environment variable management, allowing configuration of API keys, feature flags, cache settings, NLP and server settings through a .env file
Integrated for testing capabilities, supporting various test suites including integration tests, Exa Research API tests, and server tool registration tests
Required as the runtime environment for the MCP server, specifically version 20 or higher
Integrated for package management, handling dependencies and running scripts for building, testing, and demonstrating the server's capabilities
Core technology for implementing the server, providing type safety for analytical tools and NLP capabilities
Analytical MCP Server
Model Context Protocol server providing statistical analysis, decision support, logical reasoning, and research verification tools for Claude.
Setup
Prerequisites
Node.js >= 20.0.0
EXA_API_KEY environment variable (for research features)
Installation
Option 1: Direct Installation
Option 2: Docker
Configuration
Direct Installation Configuration
Copy
.env.exampleto.envAdd your EXA_API_KEY to
.envAdd to Claude Desktop configuration:
Docker Configuration
Copy
.env.exampleto.envAdd your EXA_API_KEY to
.envAdd to Claude Desktop configuration:
Related MCP server: CodeAnalysis MCP Server
Available Tools
Statistical Analysis
analytical:analyze_dataset- Statistical analysis of datasetsanalytical:advanced_regression_analysis- Linear, polynomial, and logistic regressionanalytical:hypothesis_testing- Statistical hypothesis testing (t-tests, chi-square, ANOVA)analytical:data_visualization_generator- Generate data visualization specifications
Decision Analysis
analytical:decision_analysis- Multi-criteria decision analysis with weighted scoring
Logical Reasoning
analytical:logical_argument_analyzer- Analyze argument structure and validityanalytical:logical_fallacy_detector- Detect logical fallacies in textanalytical:perspective_shifter- Generate alternative perspectives on problems
Research Verification
analytical:verify_research- Cross-verify research claims from multiple sources
Observability & Metrics
The Analytical MCP Server includes built-in observability features for monitoring circuit breakers and cache performance.
Metrics Endpoint
When enabled, the server exposes metrics via HTTP on port 9090 (configurable):
http://localhost:9090/metrics- Prometheus-style metricshttp://localhost:9090/metrics?format=json- JSON format metricshttp://localhost:9090/health- Health check endpointhttp://localhost:9090/- Metrics server status page
Available Metrics
Circuit Breaker Metrics
analytical_mcp_circuit_breaker_state- Current state (0=CLOSED, 1=HALF_OPEN, 2=OPEN)analytical_mcp_circuit_breaker_total_calls_total- Total calls through circuit breakeranalytical_mcp_circuit_breaker_rejected_calls_total- Rejected calls by circuit breakeranalytical_mcp_circuit_breaker_failure_count- Current failure countanalytical_mcp_circuit_breaker_success_count- Current success count
Cache Metrics
analytical_mcp_cache_hits_total- Cache hits by namespaceanalytical_mcp_cache_misses_total- Cache misses by namespaceanalytical_mcp_cache_puts_total- Cache puts by namespaceanalytical_mcp_cache_evictions_total- Cache evictions by namespaceanalytical_mcp_cache_size- Current cache size by namespace
System Metrics
analytical_mcp_uptime_seconds- Server uptime in secondsanalytical_mcp_memory_usage_bytes- Memory usage (RSS, heap, external)analytical_mcp_cpu_usage_microseconds- CPU time usage (user, system)
Configuration
Enable metrics by setting environment variables:
Usage Examples
Usage Examples
Dataset Analysis
Decision Analysis
Logical Analysis
Development
Testing
Scripts
npm run build- Build TypeScript to JavaScriptnpm run watch- Watch for changes and rebuildnpm run test- Run Jest testsnpm run inspector- Start MCP inspector for debugging
Project Structure
Tool Categories
Statistical Analysis
Descriptive statistics: mean, median, standard deviation, quartiles
Correlation analysis
Regression analysis: linear, polynomial, logistic
Hypothesis testing: t-tests, chi-square, ANOVA
Decision Support
Multi-criteria decision analysis
Weighted scoring
Trade-off analysis
Risk assessment
Logical Reasoning
Argument structure analysis
Fallacy detection
Perspective generation
Critical analysis
Research Integration
Multi-source verification
Fact extraction
Consistency checking
Confidence scoring
Security and Privacy
All processing occurs locally
Research features use Exa API (optional, requires API key)
No permanent data storage
Optional file-based caching stored locally only
API keys managed via environment variables
License
MIT License. See LICENSE file for details.
Contributing
Fork the repository
Create feature branch:
git checkout -b feature/your-featureMake changes and commit:
git commit -m 'Add feature description'Push to branch:
git push origin feature/your-featureOpen pull request
See docs/DEVELOPMENT.md for detailed development guidelines, code standards, and testing requirements.
Troubleshooting
Common Issues
JSON parsing errors: All logging must go to stderr, not stdout. MCP protocol uses stdout for communication. Use the Logger class, not console.log.
Tools not appearing: Verify server configuration in Claude Desktop settings and restart Claude Desktop application.
Research features disabled: Set EXA_API_KEY in your environment or .env file.
Server not starting: Check Node.js version is 20 or higher and all dependencies are installed with npm install.
See docs/TROUBLESHOOTING.md for detailed troubleshooting guidance.
Debug Mode
Start the server with the MCP inspector: