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

# Cursor Integration

> Use Hubify Labs from within Cursor IDE via the MCP server.

# Cursor Integration

Connect Hubify Labs to [Cursor](https://cursor.com) via the MCP server. This lets Cursor's AI access your lab's experiments, papers, and knowledge base directly within your IDE.

## Setup

<Steps>
  <Step title="Install the CLI">
    ```bash theme={null}
    npm install -g hubify-labs
    ```

    Requires Node.js 18+ and hubify-labs 2.0.0+.
  </Step>

  <Step title="Add to Cursor MCP config">
    Create or edit `.cursor/mcp.json` in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "hubify": {
          "command": "hubify",
          "args": ["mcp"],
          "env": {
            "CONVEX_URL": "https://your-deployment.convex.cloud",
            "HUBIFY_LAB_SLUG": "your-lab-slug"
          }
        }
      }
    }
    ```

    Find your `CONVEX_URL` and lab slug under **Settings → Developer** in the Hubify web app.
  </Step>

  <Step title="Restart Cursor">
    Restart Cursor to pick up the new MCP configuration. The Hubify tools will appear in Cursor's tool palette.
  </Step>
</Steps>

## Usage

### In Cursor Chat

Open Cursor's chat (Cmd+L) and ask questions about your lab:

```
What experiments are currently running in my Hubify lab?
```

Cursor will call the Hubify MCP tools and display results inline.

### In Composer

When using Cursor Composer for multi-file edits, the Hubify context is available:

```
Write a Python analysis script for the MCMC chain from experiment EXP-054.
Use the actual parameter names and column layout from the experiment outputs.
```

Cursor will fetch the experiment metadata via MCP and generate code that matches your actual data.

### Inline Context

Reference Hubify resources with `@` mentions:

```
@hubify://experiments/exp_054 Write a summary of these results
```

## Common Workflows

| Workflow                | Example                                                     |
| ----------------------- | ----------------------------------------------------------- |
| Write analysis code     | "Write a script to plot posteriors from EXP-054"            |
| Check experiment status | "Is my MCMC chain done yet?"                                |
| Draft paper sections    | "Draft the methods section based on our experiment configs" |
| Search knowledge        | "What does our wiki say about the Hubble tension?"          |
| Monitor compute         | "How much GPU budget is remaining?"                         |

## Tips

* Use project-scoped MCP config (`.cursor/mcp.json`) so different projects connect to different labs
* Combine Hubify MCP with other MCP servers (e.g., GitHub, filesystem) for a complete research IDE experience

## Troubleshooting

<AccordionGroup>
  <Accordion title="Tools not appearing in Cursor">
    Ensure the `.cursor/mcp.json` file is in your project root (not a subdirectory). Restart Cursor after adding it.
  </Accordion>

  <Accordion title="Connection errors">
    Run `hubify mcp --health` in your terminal to confirm the MCP server starts and resolves your lab. Check that `CONVEX_URL` and `HUBIFY_LAB_SLUG` are set in the env block.
  </Accordion>

  <Accordion title="Slow tool responses">
    The MCP server connects to your Convex deployment. Check that `CONVEX_URL` points to the correct deployment URL from **Settings → Developer**.
  </Accordion>
</AccordionGroup>
