ai-code-analyzer / MCP_SETUP_GUIDE.md
arun3676
Initial commit: AI Code Analyzer with fine-tuned model support
5c6379b
|
raw
history blame
5.05 kB

MCP Tools Setup Guide for AI Code Analyzer Project

🎯 Configured MCP Tools

I've set up the following MCP tools in your ~/.cursor/mcp.json file:

Essential for ML/AI Projects:

  1. πŸ€— Hugging Face - Model management and dataset access

  2. πŸ—„οΈ DuckDB - Local analytics database (no API key needed)

    • Perfect for: Analyzing your analyst_dataset.jsonl file
    • No setup required - ready to use!

Development & Deployment:

  1. πŸ™ GitHub - Version control and collaboration

  2. πŸš€ Vercel - Deploy web interfaces

  3. πŸš‚ Railway - Full-stack deployment

Data Storage:

  1. πŸƒ MongoDB - Database for structured data
    • Connection String: Get from MongoDB Atlas (https://cloud.mongodb.com/)
    • Format: mongodb+srv://username:password@cluster.mongodb.net/database
    • Replace: YOUR_MONGODB_CONNECTION_STRING_HERE

Monitoring & Error Tracking:

  1. 🚨 Sentry - Error tracking and performance monitoring

Security & Code Quality:

  1. πŸ”’ Snyk - Vulnerability scanning

  2. πŸ” Semgrep - Static analysis (no API key needed)

    • Ready to use - no setup required!
  3. πŸ—οΈ SonarQube - Code analysis

    • Setup: You need a SonarQube instance (cloud or self-hosted)
    • Token: Generate in your SonarQube instance
    • Replace:
      • YOUR_SONARQUBE_URL_HERE (e.g., https://your-org.sonarcloud.io)
      • YOUR_SONARQUBE_TOKEN_HERE

πŸš€ Quick Start (Recommended Order)

Phase 1: Essential Tools (Start Here)

  1. Hugging Face - Most important for your ML project
  2. DuckDB - Already ready, no API key needed
  3. GitHub - For version control

Phase 2: Development Tools

  1. Vercel or Railway - For deployment
  2. Sentry - For monitoring

Phase 3: Advanced Tools (Optional)

  1. MongoDB - If you need structured data storage
  2. Snyk - For security scanning
  3. Semgrep - For static analysis
  4. SonarQube - For comprehensive code analysis

πŸ“ How to Add API Keys

  1. Open your MCP config: c:\Users\arunk\.cursor\mcp.json
  2. Find the placeholder (e.g., YOUR_HUGGINGFACE_API_KEY_HERE)
  3. Replace with your actual API key/token
  4. Save the file
  5. Restart Cursor for changes to take effect

πŸ”§ Installation Commands

Run these commands to ensure all MCP servers are installed:

# Install all MCP servers
npm install -g @modelcontextprotocol/server-huggingface
npm install -g @modelcontextprotocol/server-github
npm install -g @modelcontextprotocol/server-duckdb
npm install -g @modelcontextprotocol/server-sentry
npm install -g @modelcontextprotocol/server-vercel
npm install -g @modelcontextprotocol/server-mongodb
npm install -g @modelcontextprotocol/server-railway
npm install -g @modelcontextprotocol/server-snyk
npm install -g @modelcontextprotocol/server-semgrep
npm install -g @modelcontextprotocol/server-sonarqube

βœ… Testing Your Setup

After adding API keys, test each tool in Cursor Composer:

  • Hugging Face: "Search for code analysis models on Hugging Face"
  • DuckDB: "Analyze my training dataset using DuckDB"
  • GitHub: "Show me my recent commits"
  • Sentry: "Check for errors in my project"

πŸ›‘οΈ Security Notes

  • Never commit API keys to version control
  • Use environment variables for sensitive data
  • Regularly rotate your API keys
  • Use minimal required permissions for each service

πŸ†˜ Troubleshooting

If a tool doesn't work:

  1. Check if the MCP server is installed: npm list -g @modelcontextprotocol/server-*
  2. Verify API keys are correct and have proper permissions
  3. Restart Cursor after making changes
  4. Check Cursor's MCP settings in Settings > Features > MCP

πŸ“š Useful Commands for Your Project

Once set up, you can use these commands in Cursor Composer:

  • "Use Hugging Face to find the best code analysis models"
  • "Analyze my analyst_dataset.jsonl with DuckDB"
  • "Check my code for vulnerabilities with Snyk"
  • "Deploy my analyzer to Vercel"
  • "Monitor errors with Sentry"