Skip to main content

Connect AI2Fin MCP in Cursor

Connect AI2Fin’s Finance MCP Server to Cursor IDE to access your financial data directly in your code editor. Ask questions about expenses, tax deductions, bills, and more—all from within Cursor.
Before you start: You’ll need an API key from AI2Fin. Get one at app.ai2fin.com/#/api (it’s free!).

Quick Setup (3 Steps)

  1. Get API KeyGenerate at app.ai2fin.com/#/api
  2. Copy Configuration → Use the copy buttons below
  3. Paste in Cursor → Add to Cursor’s MCP settings and restart

Step 1: Get Your API Key

Before connecting, you need an API key from AI2Fin:
  1. Log in to app.ai2fin.com
  2. Navigate to SettingsAPI Keys (or go to /#/api)
  3. Click “Create New API Key”
  4. Name it: Cursor MCP Integration
  5. Select scopes: mcp:full (or mcp:read, mcp:tools:list, mcp:tools:call)
  6. Copy the API key immediately (shown only once!)
Save your API key securely - it’s only displayed once during creation. If lost, you’ll need to create a new key.

Step 2: Configure MCP in Cursor

Option A: Using Cursor Settings UI

  1. Open Cursor Settings:
    • Click the gear icon (⚙️) in the top right
    • Or go to FileSettingsFeaturesMCP
  2. Add MCP Server:
    • Click “Add MCP Server” or “Configure MCP”
    • Enter the configuration (see below)

Option B: Edit Configuration File Directly

  1. Open Cursor’s MCP config file:
    • Windows: %APPDATA%\Cursor\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
    • macOS: ~/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
    • Linux: ~/.config/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  2. Add the AI2Fin MCP configuration (see JSON below)
  3. Save and restart Cursor

MCP Configuration JSON

Copy this configuration and replace YOUR_API_KEY_HERE with your actual API key:
{
  "mcpServers": {
    "ai2fin": {
      "url": "https://api.ai2fin.com/mcp/inspector",
      "headers": {
        "X-API-Key": "YOUR_API_KEY_HERE"
      }
    }
  }
}
Which to use?
  • API Key (recommended): Use /mcp/inspector endpoint with X-API-Key header. Best for automation and long-term use.
  • OAuth (JWT): Use /mcp endpoint with Authorization: Bearer header. Best for user-specific integrations. Tokens expire periodically.

Step 3: Verify Connection

After adding the configuration:
  1. Restart Cursor completely (quit and reopen)
  2. Open Cursor Chat (Cmd/Ctrl + L)
  3. Test the connection by asking:
    • “What financial tools are available from AI2Fin?”
    • “Show me my tax deductible expenses”
    • “What bills are due this week?”
If connected successfully, Cursor will use AI2Fin’s MCP tools to answer your questions!

Quick Copy Configuration

Copy this configuration and replace YOUR_API_KEY_HERE with your API key from app.ai2fin.com/#/api:

OAuth Configuration (JWT Token)

For OAuth-based authentication, use this configuration with your JWT token:
Quick Setup:
  1. Click the copy button above (📋) to copy the JSON
  2. Open Cursor’s MCP settings
  3. Paste the configuration
  4. Replace YOUR_API_KEY_HERE with your actual API key
  5. Save and restart Cursor

Authentication Methods


What Can You Do in Cursor?

Once connected, you can ask Cursor questions about your finances:

Tax & Deductions

  • “What are my tax deductible expenses this year?”
  • “Show me deductions by category”
  • “What percentage of expenses are tax deductible?”

Spending Analysis

  • “Where do I spend the most money?”
  • “Show me spending by category this month”
  • “Compare my spending this month vs last month”

Bill Management

  • “What bills are due this week?”
  • “Do I have any overdue bills?”
  • “How much do I spend on bills monthly?”

Transaction Organization

  • “Categorize all my uncategorized transactions”
  • “Find duplicate transactions”
  • “Show me transactions from Uber”

Receipt Processing

  • “Process this receipt image”
  • “Extract data from this receipt”

Troubleshooting

Symptoms: Cursor doesn’t respond to financial queriesSolutions:
  1. ✅ Verify API key is correct (no extra spaces)
  2. ✅ Check API key hasn’t been revoked
  3. ✅ Ensure you restarted Cursor after adding config
  4. ✅ Verify endpoint URL is correct: https://api.ai2fin.com/mcp/inspector
  5. ✅ Check Cursor’s MCP logs for errors
Error: 401 Unauthorized or Invalid API keySolutions:
  1. ✅ Regenerate API key at app.ai2fin.com/#/api
  2. ✅ Verify key format: mcp_ prefix + 64 hex characters
  3. ✅ Check key hasn’t expired
  4. ✅ Ensure key has required scopes: mcp:tools:call
Error: 429 Too Many RequestsSolutions:
  1. ✅ Wait 15 minutes for rate limit to reset
  2. ✅ API Key limit: 50 requests per 15 minutes
  3. ✅ OAuth limit: 200 requests per 15 minutes
  4. ✅ Use batch operations when possible
Can’t find Cursor’s MCP config file?Solutions:
  1. ✅ Check Cursor version (MCP support in v0.40+)
  2. ✅ Look in Cursor settings: SettingsFeaturesMCP
  3. ✅ Try creating the file manually if it doesn’t exist
  4. ✅ Ensure Cursor has write permissions to the directory

Security Best Practices

Store Keys Securely

Never commit API keys to version control. Use environment variables or secure storage.

Use Minimal Scopes

Only grant necessary permissions. Use mcp:read for read-only access when possible.

Rotate Keys Regularly

Rotate API keys every 90 days. Revoke old keys immediately after generating new ones.

Monitor Usage

Review API key usage in the AI2Fin dashboard. Set up alerts for unusual activity.

Example Queries in Cursor

Once connected, try these queries in Cursor Chat:
What are my tax deductible expenses for this financial year?
Show me my top 10 merchants by spending this month
What bills are due in the next 7 days?
Categorize all transactions from "Uber" as "Transport"
Find duplicate transactions in the last 30 days

Next Steps


Need Help?


Last updated: 2025-01-04
embracingearth.space - Enterprise-grade MCP integration