Insight Digger MCP
An enterprise-grade data analysis system that enables users to discover data sources, configure analyses, and execute workflows through Claude Desktop. It features intelligent caching, session isolation, and secure JWT authentication for streamlined multi-user data orchestration.
README
Disclaimer: this project and documentation were created with active usage of AI with basic code and content review and are in the "beta" state as a part of POC project. There can be errors in documentation.
Insight Digger MCP
Enterprise-grade Model Context Protocol (MCP) system for data analysis with Claude Desktop integration.
Architecture Overview
This project provides a sophisticated 3-layer MCP architecture designed for enterprise environments:
- MCP Bridge ↔ MCP Client Flask API (Custom HTTP REST endpoints)
- MCP Client Flask API ↔ MCP Server subprocess (Standard MCP protocol)
- MCP Server ↔ Backend Data API (HTTP calls to enterprise backend)
Key Enterprise Features
- 🔐 Dynamic JWT Authentication: 14-day JWT tokens with session management
- 🧠 Intelligent Caching: Parameter caching and auto-injection for efficient workflows
- 📋 Workflow Guidance: LLM-optimized tool orchestration with conversation management
- 👥 Multi-User Support: Centralized service with session isolation
- 🏢 Enterprise Integration: Compatible with existing authentication and monitoring systems
Setup Options
Option 1: Claude Desktop Integration (Recommended)
For end users who want to use Claude Desktop with Insight Digger:
1. Install the NPX Bridge
npx @sandsiv/data-narrator-mcp
2. Configure Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"data-narrator": {
"command": "npx",
"args": ["-y", "@sandsiv/data-narrator-mcp@1.0.0"],
"env": {
"MCP_CLIENT_URL": "https://your-mcp-service.com"
}
}
}
}
Note: The MCP_CLIENT_URL environment variable is optional. By default, the system will use Sandsiv's hosted MCP service. Only provide this variable if you're deploying your own version of the data-narrator-mcp service.
3. Usage in Claude Desktop
- Authenticate first: Use the
setup_authenticationtool with your API URL and JWT token - Start analysis: Begin with
list_sourcesto see available data - Follow the workflow: The system guides you through multi-step analysis processes
Option 2: Direct API Integration (For developers)
For custom integrations or testing:
1. Start the MCP Services
# Install dependencies
./scripts/setup/install_dependencies.sh
# Activate virtual environment
source venv/bin/activate
# Start the Flask API service
npm run dev:flask
# OR
python src/python/scripts/start_flask_api.py
2. Use the REST API
# Initialize session
curl -X POST http://localhost:5000/init \
-H "Content-Type: application/json" \
-d '{"session_id": "test-session", "apiUrl": "https://your-api.com", "jwtToken": "your-jwt"}'
# Get available tools
curl -X POST http://localhost:5000/tools \
-H "Content-Type: application/json" \
-d '{"session_id": "test-session"}'
# Call a tool
curl -X POST http://localhost:5000/call-tool \
-H "Content-Type: application/json" \
-d '{"session_id": "test-session", "tool": "list_sources", "params": {}}'
Development Setup
Prerequisites
- Python 3.8+
- Node.js 18+ (for NPX bridge)
- Access to Insight Digger backend API
Local Development
# Clone the repository
git clone <repository-url>
cd insight_digger_mcp
# Install all dependencies
./scripts/setup/install_dependencies.sh --dev
# Activate virtual environment
source venv/bin/activate
# Run tests
npm test
# OR separately:
npm run test:python
npm run test:nodejs
Testing the NPX Bridge Locally
# Start your MCP client service
npm run dev:flask
# In another terminal, test the bridge
npm run dev:bridge
# Use the MCP Inspector or Claude Desktop to test
Authentication Flow
JWT Token Management
- Lifetime: 14 days
- Refresh: Through the main platform web UI (outside MCP scope)
- Validation: Bridge handles expired tokens by requesting re-authentication
Session Management
- Single Session: One active session per bridge instance
- Session ID: UUID generated for each bridge startup
- Isolation: Multiple Claude Desktop instances use separate sessions
Tools & Workflow
Available Analysis Tools
The system provides LLM-optimized tools for:
- 📊 Data Source Discovery:
list_sources,get_source_structure - ⚙️ Analysis Configuration:
prepare_analysis_configuration - 🚀 Execution:
execute_analysis_from_config - 📈 Results: Interactive dashboards and summaries
Intelligent Caching
- Parameter Injection: Previously fetched data automatically included in subsequent calls
- Workflow Memory: System remembers source selections, configurations, and analysis state
- Efficiency: LLM doesn't need to repeat large data structures between steps
Error Handling
- Authentication Errors: Clear guidance for JWT/URL validation failures
- Tool Errors: Contextual error messages from backend systems
- Session Errors: Automatic cleanup and re-authentication prompts
Configuration
Environment Variables
MCP_CLIENT_URL: URL of the MCP Client Flask API serviceINSIGHT_DIGGER_API_URL: Backend API URL (configured in MCP server layer)
Service Configuration
The MCP Server (mcp_server.py) connects to your backend API using configuration provided during the /init call.
Documentation
docs/mcp_bridge_implementation_guide.md- Detailed bridge architecturedocs/integration_guide.md- Integration patternsdocs/mcp_client_development_plan.md- Client development guidedocs/mcp_server_development_plan.md- Server development guide
Production Deployment
Service Deployment
# Install as systemd service (Linux)
sudo cp data-narrator-mcp.service /etc/systemd/system/
sudo systemctl enable data-narrator-mcp
sudo systemctl start data-narrator-mcp
NPX Package Publishing
# Build and publish the bridge package
npm version patch
npm publish --access public
Monitoring
- Service logs:
journalctl -u data-narrator-mcp -f - Bridge logs: Console output in Claude Desktop
- Session tracking: All sessions logged with UUIDs
Security & Production Readiness
✅ Status: Ready for external publication
🔐 Security: Comprehensive credential validation implemented
📊 Performance: Optimized with session reuse and direct validation
Security Features
- Immediate credential validation during
/initendpoint - Session reuse optimization - no redundant validation calls
- Proper HTTP status codes (401 for auth failures, 500 for server errors)
- Input validation for API URLs and JWT tokens
- Resource efficiency - MCP servers created only for valid credentials
- 5-second timeout for validation requests
Security Considerations
- JWT Tokens: Never logged or stored permanently
- Session Isolation: Proper cleanup prevents cross-session data leakage
- HTTPS Required: All production communications must use HTTPS
- Enterprise Auth: Integrates with existing authentication systems
- Immediate Auth Feedback: Invalid credentials rejected in <5 seconds
- Resource Protection: No MCP instances created for invalid credentials
See SECURITY.md for detailed security documentation.
Support
For issues or questions:
- Check the documentation in the
docs/folder - Review the service logs for error details
- Verify JWT token validity and API connectivity
- Ensure MCP Client service is running and accessible
License
MIT License - See LICENSE file for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。