Skip to content

feat(cli): add Cursor IDE integration to init command #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,14 @@ mxcp run # Run a specific endpoint
MXCP implements the Model Context Protocol (MCP), making it compatible with:

- **Claude Desktop** β€” Native MCP support
- **Cursor** β€” Native MCP support with one-click installation
- **OpenAI-compatible tools** β€” Via MCP adapters
- **Custom integrations** β€” Using the MCP specification

For specific setup instructions, see:
- [Earthquakes Example](https://github.com/raw-labs/mxcp/blob/main/examples/earthquakes/README.md) β€” Complete Claude Desktop setup
- [COVID + dbt Example](https://github.com/raw-labs/mxcp/blob/main/examples/covid_owid/README.md) β€” Advanced dbt integration
- [Integrations Guide](https://github.com/raw-labs/mxcp/blob/main/docs/guides/integrations.md) β€” Claude Desktop and Cursor setup

## πŸ“š Documentation

Expand Down
87 changes: 85 additions & 2 deletions docs/guides/integrations.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: "Integrations"
description: "Integrate MXCP with AI platforms, dbt, and data sources. Connect with Claude Desktop, OpenAI, and other LLM providers. Access diverse data sources through DuckDB."
description: "Integrate MXCP with AI platforms, dbt, and data sources. Connect with Claude Desktop, Cursor, OpenAI, and other LLM providers. Access diverse data sources through DuckDB."
keywords:
- mxcp integrations
- claude desktop integration
- cursor integration
- dbt integration
- duckdb extensions
- llm integration
Expand All @@ -18,7 +19,7 @@ MXCP provides seamless integration with AI platforms and data tools to create po

## Table of Contents

- [LLM Integration](#llm-integration) β€” Connect with Claude Desktop, OpenAI, and other AI platforms
- [LLM Integration](#llm-integration) β€” Connect with Claude Desktop, Cursor, OpenAI, and other AI platforms
- [dbt Integration](#dbt-integration) β€” Transform and prepare data for AI consumption
- [DuckDB Integration](#duckdb-integration) β€” Access diverse data sources with powerful SQL capabilities

Expand Down Expand Up @@ -74,6 +75,88 @@ Claude Desktop has native MCP support, making it the easiest way to get started
- Test your configuration with simple queries first
- Monitor Claude's developer console for connection issues

### Cursor

Cursor has native MCP support through its Model Context Protocol integration, providing another excellent way to use MXCP with AI-powered development tools.

#### Automatic Configuration

The easiest way to set up Cursor integration is during project initialization:

```bash
# Initialize MXCP project with Cursor configuration
mxcp init my-project --bootstrap

# Follow the prompts to configure Cursor automatically
# Choose from:
# 1. Project-specific (recommended) - Only available in this project
# 2. Global - Available in all Cursor workspaces
```

#### Manual Configuration

For manual setup or existing projects:

1. **Generate Cursor configuration**:
```bash
# Run init again in existing project to add Cursor config
cd my-existing-project
mxcp init .
```

2. **Configuration locations**:
- **Project-specific**: `.cursor/mcp.json` (created in your project directory)
- **Global**: `~/.cursor/mcp.json` (available in all Cursor workspaces)

3. **Manual configuration file**:

For global installations:
```json
{
"mcpServers": {
"my-project": {
"command": "mxcp",
"args": ["serve", "--transport", "stdio"],
"cwd": "/absolute/path/to/your/mxcp/project"
}
}
}
```

For virtual environment installations:
```json
{
"mcpServers": {
"my-project": {
"command": "bash",
"args": [
"-c",
"cd /absolute/path/to/your/project && source /path/to/.venv/bin/activate && mxcp serve --transport stdio"
]
}
}
}
```

#### One-Click Installation

MXCP generates one-click installation links for easy sharing:

```bash
# The deeplink is automatically generated during init
# Example format:
cursor://anysphere.cursor-deeplink/mcp/install?name=my-project&config=eyJjb21tYW5kIjoi...
```

Share this link with team members for instant Cursor setup.

#### Best Practices

- **Project-specific configuration** is recommended for team projects
- **Global configuration** is useful for personal tools used across multiple projects
- Use the one-click installation links for team onboarding
- Test your configuration by asking Cursor to list available tools

### OpenAI and Other Providers

While MXCP uses the MCP protocol, you can integrate with OpenAI and other providers using MCP adapters or custom implementations.
Expand Down
55 changes: 54 additions & 1 deletion examples/covid_owid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ pip install -e .
mxcp serve
```

## πŸ”Œ Claude Desktop Integration
## πŸ”Œ Integration

### Claude Desktop

To use this example with Claude Desktop:

Expand Down Expand Up @@ -99,6 +101,57 @@ In Claude Desktop, try asking:
- "Compare vaccination rates between France and Germany"
- "What were the peak hospitalization rates in the UK?"

### Cursor

To use this example with Cursor:

#### Option 1: Automatic Setup (Recommended)

Run `mxcp init .` in the covid_owid directory and follow the prompts to automatically configure Cursor.

#### Option 2: Manual Setup

1. **Locate Cursor's Configuration**:
- **Project-specific**: Create `.cursor/mcp.json` in the covid_owid directory
- **Global**: `~/.cursor/mcp.json` in your home directory

2. **Add Configuration**:

For global installations:
```json
{
"mcpServers": {
"covid": {
"command": "mxcp",
"args": ["serve", "--transport", "stdio"],
"cwd": "/absolute/path/to/mxcp/examples/covid_owid"
}
}
}
```

For virtual environment installations:
```json
{
"mcpServers": {
"covid": {
"command": "/bin/bash",
"args": [
"-c",
"cd /absolute/path/to/mxcp/examples/covid_owid && source ../../.venv/bin/activate && mxcp serve --transport stdio"
]
}
}
}
```

3. **Test the Integration**:

In Cursor, try asking:
- "Show me COVID-19 cases in the United States for 2022"
- "Compare vaccination rates between France and Germany"
- "What were the peak hospitalization rates in the UK?"

## πŸ› οΈ Other MCP Clients

This example works with any MCP-compatible tool:
Expand Down
55 changes: 54 additions & 1 deletion examples/earthquakes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ pip install -e .
mxcp serve
```

## πŸ”Œ Claude Desktop Integration
## πŸ”Œ Integration

### Claude Desktop

To use this example with Claude Desktop:

Expand Down Expand Up @@ -96,6 +98,57 @@ In Claude Desktop, try asking:

Claude will automatically use the earthquake data tools to answer your questions.

### Cursor

To use this example with Cursor:

#### Option 1: Automatic Setup (Recommended)

Run `mxcp init .` in the earthquakes directory and follow the prompts to automatically configure Cursor.

#### Option 2: Manual Setup

1. **Locate Cursor's Configuration**:
- **Project-specific**: Create `.cursor/mcp.json` in the earthquakes directory
- **Global**: `~/.cursor/mcp.json` in your home directory

2. **Add Configuration**:

For global installations:
```json
{
"mcpServers": {
"earthquakes": {
"command": "mxcp",
"args": ["serve", "--transport", "stdio"],
"cwd": "/absolute/path/to/mxcp/examples/earthquakes"
}
}
}
```

For virtual environment installations:
```json
{
"mcpServers": {
"earthquakes": {
"command": "/bin/bash",
"args": [
"-c",
"cd /absolute/path/to/mxcp/examples/earthquakes && source ../../.venv/bin/activate && mxcp serve --transport stdio"
]
}
}
}
```

3. **Test the Integration**:

In Cursor, try asking:
- "Show me recent earthquakes above magnitude 5.0"
- "What was the strongest earthquake in the last 24 hours?"
- "List earthquakes near California"

## πŸ› οΈ Other MCP Clients

This example also works with other MCP-compatible tools:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mxcp"
version = "0.2.1"
version = "0.2.2"
description = "Enterprise MCP framework for building production AI tools with SQL/Python, featuring security, audit trails, and policy enforcement"
authors = [{ name = "RAW Labs SA", email = "mxcp@raw-labs.com" }]
readme = "README.md"
Expand Down
Loading