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

# Cursor MCP Tool Installation

> Connect Anysite MCP Server to Cursor IDE using JSON configuration

## Overview

The Anysite MCP Tool for Cursor provides seamless integration between Cursor IDE and the Anysite API through the Model Context Protocol (MCP). This allows you to access LinkedIn, Instagram, Reddit, and other social media data extraction tools directly within your Cursor AI coding sessions.

## Prerequisites

* Cursor IDE installed ([download here](https://cursor.com))
* Node.js and npm installed (for NPX method)
* Anysite API account with active subscription
* Basic familiarity with JSON configuration

## Why Cursor Integration?

<CardGroup cols={2}>
  <Card title="AI-Powered Coding" icon="wand-magic-sparkles">
    Access data extraction tools while coding with Cursor's AI assistant
  </Card>

  <Card title="Project Integration" icon="folder-tree">
    Configure MCP per-project or globally for all your workspaces
  </Card>

  <Card title="Real-time Data" icon="bolt">
    Extract social media data directly in your development workflow
  </Card>

  <Card title="Developer Friendly" icon="code">
    JSON-based configuration that's easy to version control and share
  </Card>
</CardGroup>

## Installation Steps

### Step 1: Get Your API Key

First, obtain your API key from the Anysite dashboard:

1. Visit [app.anysite.io](https://app.anysite.io) and log in to your account
2. Navigate to **MCP Server Integration** section
3. Copy your API key from the dashboard

<Warning>
  Keep your API key secure - never share it publicly or commit it to version control.
</Warning>

### Step 2: Configure MCP in Cursor

There are two ways to configure MCP in Cursor:

<Tabs>
  <Tab title="Project Configuration (Recommended)">
    Create a `.cursor/mcp.json` file in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "anysite": {
          "command": "npx",
          "args": ["-y", "@anysiteio/mcp"],
          "env": {
            "ANYSITE_API_KEY": "YOUR_API_KEY",
            "ANYSITE_ACCOUNT_ID": ""
          }
        }
      }
    }
    ```

    **Steps:**

    1. Open your project in Cursor
    2. Create `.cursor` directory in project root (if it doesn't exist)
    3. Create `mcp.json` file inside `.cursor` directory
    4. Paste the configuration above
    5. Replace `YOUR_API_KEY` with your actual API key
    6. Restart Cursor or reload the window

    <Note>
      Project-specific configuration is ideal for team collaboration. Add `.cursor/mcp.json` to `.gitignore` if your API key is included directly.
    </Note>
  </Tab>

  <Tab title="Global Configuration">
    Configure MCP globally for all Cursor projects:

    **For macOS:**
    Edit `~/.cursor/mcp.json`:

    **For Windows:**
    Edit `%USERPROFILE%\.cursor\mcp.json`:

    **For Linux:**
    Edit `~/.cursor/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "anysite": {
          "command": "npx",
          "args": ["-y", "@anysiteio/mcp"],
          "env": {
            "ANYSITE_API_KEY": "YOUR_API_KEY",
            "ANYSITE_ACCOUNT_ID": ""
          }
        }
      }
    }
    ```

    <Tip>
      Global configuration makes Anysite tools available in all your Cursor projects without per-project setup.
    </Tip>
  </Tab>
</Tabs>

**Configuration breakdown:**

* `command: "npx"` - Uses npx to run the MCP package
* `args: ["-y", "@anysiteio/mcp"]` - Auto-confirms and runs the Anysite MCP package
* `ANYSITE_API_KEY` - Your API key from the Anysite dashboard
* `ANYSITE_ACCOUNT_ID` - Optional account ID (leave empty if not needed)

### Step 3: Using Environment Variables (Secure Method)

For better security, use environment variables instead of hardcoding the API key:

**Option 1: Shell Environment**

Add to your shell profile (`~/.zshrc`, `~/.bashrc`):

```bash theme={null}
export ANYSITE_API_KEY="your_api_key_here"
```

Then update your `mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "anysite": {
      "command": "npx",
      "args": ["-y", "@anysiteio/mcp"],
      "env": {
        "ANYSITE_API_KEY": "${ANYSITE_API_KEY}",
        "ANYSITE_ACCOUNT_ID": ""
      }
    }
  }
}
```

**Option 2: .env File**

Create a `.env` file in your project root:

```bash theme={null}
ANYSITE_API_KEY=your_api_key_here
```

<Warning>
  Always add `.env` to your `.gitignore` to prevent accidental commits of sensitive data.
</Warning>

### Step 4: Verify Installation

After configuration, verify the MCP server is working:

1. **Restart Cursor** or reload the window (Cmd/Ctrl + Shift + P → "Reload Window")

2. **Open Cursor AI Chat** and ask:
   ```
   What MCP tools do you have access to?
   ```

3. **Test with a simple request:**
   ```
   Get information about this LinkedIn profile: linkedin.com/in/username
   ```

<Check>
  If everything is working correctly, Cursor AI will list the available Anysite tools and be able to execute data extraction requests.
</Check>

## Managing Your Connection

### Update Configuration

To update your API key or other settings:

1. Edit the `mcp.json` file
2. Save the changes
3. Restart Cursor or reload the window

### Remove MCP Server

To remove the Anysite MCP integration:

1. Delete the `anysite` entry from your `mcp.json` file
2. Or delete the entire `mcp.json` file if not using other MCP servers
3. Restart Cursor

### Multiple MCP Servers

You can configure multiple MCP servers in the same file:

```json theme={null}
{
  "mcpServers": {
    "anysite": {
      "command": "npx",
      "args": ["-y", "@anysiteio/mcp"],
      "env": {
        "ANYSITE_API_KEY": "YOUR_API_KEY",
        "ANYSITE_ACCOUNT_ID": ""
      }
    },
    "other-server": {
      "command": "npx",
      "args": ["-y", "other-mcp-package"],
      "env": {}
    }
  }
}
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="MCP server not connecting">
    **Solutions:**

    * Ensure Node.js and npm are installed and in your PATH
    * Verify the API key is valid and active
    * Check internet connectivity
    * Restart Cursor completely
    * Check the Cursor logs for error messages
  </Accordion>

  <Accordion title="Tools not appearing in Cursor AI">
    **Solutions:**

    * Reload the Cursor window (Cmd/Ctrl + Shift + P → "Reload Window")
    * Verify the `mcp.json` file syntax is correct (valid JSON)
    * Check that the file is in the correct location
    * Ensure your Anysite subscription is active
  </Accordion>

  <Accordion title="NPX command not found">
    **Solutions:**

    * Install Node.js from [nodejs.org](https://nodejs.org)
    * Ensure npm is in your system PATH
    * Try running `npx --version` in terminal to verify
    * On Windows, you may need to restart after Node.js installation
  </Accordion>

  <Accordion title="Invalid JSON syntax error">
    **Solutions:**

    * Validate your JSON at [jsonlint.com](https://jsonlint.com)
    * Check for missing commas, brackets, or quotes
    * Ensure no trailing commas after the last item in objects/arrays
    * Use a JSON formatter extension in your editor
  </Accordion>

  <Accordion title="API key not working">
    **Solutions:**

    * Verify the API key is correct (no extra spaces)
    * Check if your Anysite subscription is active
    * Try generating a new API key from the dashboard
    * Ensure the key has the necessary permissions
  </Accordion>

  <Accordion title="Environment variables not loading">
    **Solutions:**

    * Restart your terminal/shell after adding env vars
    * Start Cursor from the terminal: `cursor .`
    * On macOS, GUI apps may not inherit shell env vars
    * Try using the direct API key method to test
  </Accordion>
</AccordionGroup>

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Environment Variables" icon="shield-halved">
    Store API keys in environment variables, never hardcode in configuration files
  </Card>

  <Card title="Git Ignore" icon="ban">
    Always add `.cursor/mcp.json` and `.env` to `.gitignore`
  </Card>

  <Card title="Key Rotation" icon="rotate">
    Regularly regenerate API keys from Anysite dashboard
  </Card>

  <Card title="Audit Access" icon="list-check">
    Review API usage periodically in your Anysite dashboard
  </Card>
</CardGroup>

**.gitignore example:**

```gitignore theme={null}
# MCP configuration with API keys
.cursor/mcp.json

# Environment files
.env
.env.local
.env.*.local
```

## Comparison: Cursor vs Other Integrations

| Feature             | Cursor             | Claude Code (CLI)      | Claude Desktop |
| ------------------- | ------------------ | ---------------------- | -------------- |
| **Interface**       | IDE integrated     | Command line           | Desktop app    |
| **Setup**           | JSON config        | Terminal command       | OAuth GUI      |
| **Best For**        | AI-assisted coding | Developers, automation | General users  |
| **Project Scope**   | Per-project config | Multiple scopes        | Global only    |
| **Version Control** | `.cursor/mcp.json` | `.mcp.json`            | Not applicable |

## Next Steps

* [Explore Usage Examples](/mcp-server/cursor-tool/examples)
* [View All Available Tools](/mcp-server/tools)
* [Compare with Claude Code](/mcp-server/claude-code-tool/installation)
* [Try Claude Desktop](/mcp-server/claude-desktop-tool/installation)

## Need Help?

<Card title="Get Support" icon="headset" href="mailto:support@anysite.io">
  Contact our support team for assistance with Cursor MCP integration
</Card>
