> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai2fin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect AI2Fin MCP to Cursor IDE

> Step-by-step guide to connecting the AI2Fin Finance MCP server to Cursor IDE so you can query expenses, tax deductions, bills and spending in natural language, right from your editor.

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.

<Warning>
  **Before you start:** You'll need an API key from AI2Fin. Get one at [app.ai2fin.com/#/api](https://app.ai2fin.com/#/api) (it's free!).
</Warning>

## Quick Setup (3 Steps)

1. **Get API Key** → [Generate at app.ai2fin.com/#/api](https://app.ai2fin.com/#/api)
2. **Copy Configuration** → Use the copy buttons below
3. **Paste in Cursor** → Add to Cursor's MCP settings and restart

<CardGroup cols={3}>
  <Card title="Step 1: Get API Key" icon="key" href="https://app.ai2fin.com/#/api" target="_blank">
    Generate your API key in the AI2Fin dashboard (free account required)
  </Card>

  <Card title="Step 2: Copy Config" icon="copy" href="#quick-copy-configuration">
    Copy the MCP JSON configuration below
  </Card>

  <Card title="Step 3: Add to Cursor" icon="settings" href="#step-2-configure-mcp-in-cursor">
    Paste into Cursor's MCP settings file
  </Card>
</CardGroup>

***

## Step 1: Get Your API Key

Before connecting, you need an API key from AI2Fin:

1. **Log in** to [app.ai2fin.com](https://app.ai2fin.com)
2. Navigate to **Settings** → **API Keys** (or go to `/#/api`)
3. Click **"Create New API Key"**
4. Name it: `Cursor MCP Integration`
5. Choose the access level you want — read-only (`mcp:read`) or full tool access (`mcp:full`)
6. **Copy the API key immediately** — for your security it's shown only once

<Warning>
  **Save your API key securely** - it's only displayed once during creation. If lost, you'll need to create a new key.
</Warning>

***

## Step 2: Configure MCP in Cursor <a id="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 `File` → `Settings` → `Features` → `MCP`

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:

<CodeGroup>
  ```json MCP Configuration (API Key) theme={null}
  {
    "mcpServers": {
      "ai2fin": {
        "url": "https://api.ai2fin.com/mcp/inspector",
        "headers": {
          "X-API-Key": "YOUR_API_KEY_HERE"
        }
      }
    }
  }
  ```

  ```json Alternative: OAuth (JWT Token) theme={null}
  {
    "mcpServers": {
      "ai2fin": {
        "url": "https://api.ai2fin.com/mcp",
        "headers": {
          "Authorization": "Bearer YOUR_JWT_TOKEN_HERE"
        }
      }
    }
  }
  ```
</CodeGroup>

<Info>
  **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.
</Info>

***

## 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 <a id="quick-copy-configuration" />

### API Key Configuration (Recommended)

Copy this configuration and replace `YOUR_API_KEY_HERE` with your API key from [app.ai2fin.com/#/api](https://app.ai2fin.com/#/api):

<CopyBlock>
  {`{
    "mcpServers": {
      "ai2fin": {
        "url": "https://api.ai2fin.com/mcp/inspector",
        "headers": {
          "X-API-Key": "YOUR_API_KEY_HERE"
        }
      }
    }
    }`}
</CopyBlock>

### OAuth Configuration (JWT Token)

For OAuth-based authentication, use this configuration with your JWT token:

<CopyBlock>
  {`{
    "mcpServers": {
      "ai2fin": {
        "url": "https://api.ai2fin.com/mcp",
        "headers": {
          "Authorization": "Bearer YOUR_JWT_TOKEN_HERE"
        }
      }
    }
    }`}
</CopyBlock>

<Tip>
  **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
</Tip>

***

## Authentication Methods

<Tabs>
  <Tab title="API Key (Recommended)">
    **Best for:** Long-term use and automation

    **Steps:**

    1. Generate an API key at [app.ai2fin.com/#/api](https://app.ai2fin.com/#/api)
    2. Use endpoint: `https://api.ai2fin.com/mcp/inspector`
    3. Header: `X-API-Key: your_key_here`
    4. Choose read-only (`mcp:read`) or full tool access (`mcp:full`)

    **Advantages:**

    * ✅ Doesn't expire unless you set an expiry
    * ✅ Great for automation and always-on integrations
    * ✅ Can be scoped to the permissions you need
  </Tab>

  <Tab title="OAuth (JWT Token)">
    **Best for:** User-specific integrations and temporary access

    **Steps:**

    1. Log in to [app.ai2fin.com](https://app.ai2fin.com)
    2. Obtain your access token after signing in
    3. Use endpoint: `https://api.ai2fin.com/mcp`
    4. Header: `Authorization: Bearer your_token_here`

    **Advantages:**

    * ✅ Tied to your user account
    * ✅ Supports write actions (with confirmation)

    **Disadvantages:**

    * ⚠️ Tokens expire periodically, so you'll re-authenticate occasionally
  </Tab>
</Tabs>

***

## 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

<AccordionGroup>
  <Accordion title="Connection Not Working" icon="wifi">
    **Symptoms:** Cursor doesn't respond to financial queries

    **Solutions:**

    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
  </Accordion>

  <Accordion title="Authentication Errors" icon="key">
    **Error:** `401 Unauthorized` or `Invalid API key`

    **Solutions:**

    1. ✅ Regenerate your API key at [app.ai2fin.com/#/api](https://app.ai2fin.com/#/api)
    2. ✅ Make sure you copied the whole key, with no extra spaces
    3. ✅ Check the key hasn't expired or been revoked
    4. ✅ Ensure the key has the access level you need (full tool access for write actions)
  </Accordion>

  <Accordion title="Rate Limit Errors" icon="gauge">
    **Error:** `429 Too Many Requests`

    **Solutions:**

    1. ✅ Wait a short while and try again — limits reset on a rolling window
    2. ✅ Spread requests out rather than sending many at once
    3. ✅ Use batch operations where possible to do more in a single call
  </Accordion>

  <Accordion title="Config File Not Found" icon="file">
    **Can't find Cursor's MCP config file?**

    **Solutions:**

    1. ✅ Check Cursor version (MCP support in v0.40+)
    2. ✅ Look in Cursor settings: `Settings` → `Features` → `MCP`
    3. ✅ Try creating the file manually if it doesn't exist
    4. ✅ Ensure Cursor has write permissions to the directory
  </Accordion>
</AccordionGroup>

***

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Store Keys Securely" icon="lock">
    Never commit API keys to version control. Use environment variables or secure storage.
  </Card>

  <Card title="Use Minimal Scopes" icon="shield">
    Only grant necessary permissions. Use `mcp:read` for read-only access when possible.
  </Card>

  <Card title="Rotate Keys Regularly" icon="refresh">
    Rotate API keys every 90 days. Revoke old keys immediately after generating new ones.
  </Card>

  <Card title="Monitor Usage" icon="chart-line">
    Review API key usage in the AI2Fin dashboard. Set up alerts for unusual activity.
  </Card>
</CardGroup>

***

## 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

<CardGroup cols={2}>
  <Card title="Quickstart Guide" icon="rocket" href="/mcp/quickstart">
    Learn MCP basics and get started
  </Card>

  <Card title="Tools Reference" icon="wrench" href="/mcp/tools-overview">
    Explore all 65+ financial tools
  </Card>

  <Card title="Authentication Guide" icon="key" href="/mcp/authentication">
    Detailed authentication documentation
  </Card>

  <Card title="Code Examples" icon="code" href="/mcp/examples">
    Integration examples and patterns
  </Card>
</CardGroup>

***

## Need Help?

* **Documentation:** [docs.ai2fin.com](https://docs.ai2fin.com)
* **Support:** [support@ai2fin.com](mailto:support@ai2fin.com)
* **API Keys:** [app.ai2fin.com/#/api](https://app.ai2fin.com/#/api)

***

*Last updated: 2026-06-14*
