Skip to content

Commit 630a907

Browse files
authored
Add the Add to cursor button for RevenueCat MCP (#1083)
* add to cursor button * add the manual config option
1 parent 58120d3 commit 630a907

File tree

4 files changed

+112
-16
lines changed

4 files changed

+112
-16
lines changed

docs/tools/mcp/setup.mdx

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ excerpt: Configure RevenueCat MCP Server for cloud or local deployment
66
hidden: false
77
---
88

9+
import AddToCursor from '@site/src/components/AddToCursor';
10+
911
## Prerequisites
1012

1113
- RevenueCat project with API v2 access
@@ -26,19 +28,36 @@ hidden: false
2628
2729
## Cloud MCP Server Setup
2830

29-
### Using with MCP Inspector
30-
31-
For testing and development:
31+
### Using with Claude Code
3232

33-
```bash
34-
npx @modelcontextprotocol/inspector@latest
33+
Add the server via the `claude` CLI command:
34+
```
35+
claude mcp add --transport http revenuecat https://mcp.revenuecat.ai/mcp --header "Authorization: Bearer YOUR_API_V2_SECRET_KEY"
3536
```
3637

37-
Configure the inspector with:
38+
### Using with Cursor
3839

39-
- **Transport Type**: Streamable HTTP
40-
- **URL**: `https://mcp.revenuecat.ai/mcp`
41-
- **Authentication**: Bearer Token with your RevenueCat API v2 secret key
40+
You can add the MCP server to Cursor by clicking the button below:
41+
42+
<AddToCursor
43+
name="revenuecat"
44+
config={{url: "https://mcp.revenuecat.ai/mcp"}}
45+
/>
46+
47+
Or you can also add it manually by adding the following to your `mcp.json` file:
48+
49+
```json
50+
{
51+
"servers": {
52+
"revenuecat": {
53+
"url": "https://mcp.revenuecat.ai/mcp",
54+
"headers": {
55+
"Authorization": "Bearer {your API v2 token}"
56+
}
57+
}
58+
}
59+
}
60+
```
4261

4362
### Using with VS Code Copilot
4463

@@ -56,13 +75,6 @@ Add to your Visual Studio Code `mcp.json`:
5675
}
5776
```
5877

59-
### Using with Claude Code
60-
61-
Add the server via the `claude` CLI command:
62-
```
63-
claude mcp add --transport http revenuecat https://mcp.revenuecat.ai/mcp --header "Authorization: Bearer YOUR_API_V2_SECRET_KEY"
64-
```
65-
6678
### Using with Claude Desktop
6779

6880
Add to your Claude Desktop configuration:
@@ -86,6 +98,21 @@ Add to your Claude Desktop configuration:
8698
}
8799
```
88100

101+
### Using with MCP Inspector
102+
103+
For testing and development:
104+
105+
```bash
106+
npx @modelcontextprotocol/inspector@latest
107+
```
108+
109+
Configure the inspector with:
110+
111+
- **Transport Type**: Streamable HTTP
112+
- **URL**: `https://mcp.revenuecat.ai/mcp`
113+
- **Authentication**: Bearer Token with your RevenueCat API v2 secret key
114+
115+
89116
### OAuth Authentication Support
90117

91118
RevenueCat MCP Server also supports OAuth authentication for supported clients. Currently supported:

src/components/AddToCursor/index.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React from "react";
2+
import { useColorMode } from "@docusaurus/theme-common";
3+
import "./styles.css";
4+
5+
interface AddToCursorProps {
6+
name: string;
7+
config: object;
8+
alt?: string;
9+
height?: number;
10+
}
11+
12+
const AddToCursor: React.FC<AddToCursorProps> = ({
13+
name,
14+
config,
15+
alt = `Add ${name} MCP server to Cursor`,
16+
height = 32,
17+
}) => {
18+
const { colorMode } = useColorMode();
19+
20+
// Encode the config object to base64
21+
const encodedConfig = btoa(JSON.stringify(config));
22+
23+
// Construct the Cursor install URL
24+
const installUrl = `https://cursor.com/en/install-mcp?name=${encodeURIComponent(name)}&config=${encodedConfig}`;
25+
26+
// Use dark button for light mode, light button for dark mode
27+
const buttonImage =
28+
colorMode === "dark"
29+
? "https://cursor.com/deeplink/mcp-install-light.svg"
30+
: "https://cursor.com/deeplink/mcp-install-dark.svg";
31+
32+
return (
33+
<div className="add-to-cursor">
34+
<a href={installUrl} target="_blank" rel="noopener noreferrer">
35+
<img src={buttonImage} alt={alt} height={height} />
36+
</a>
37+
</div>
38+
);
39+
};
40+
41+
export default AddToCursor;

src/components/AddToCursor/styles.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.add-to-cursor {
2+
display: inline-block;
3+
margin: 1rem 0;
4+
}
5+
6+
.add-to-cursor a {
7+
display: inline-block;
8+
text-decoration: none;
9+
transition: all 0.2s ease-in-out;
10+
}
11+
12+
.add-to-cursor a:hover {
13+
transform: translateY(-1px);
14+
filter: brightness(1.1);
15+
}
16+
17+
.add-to-cursor img {
18+
border-radius: 6px;
19+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
20+
transition: box-shadow 0.2s ease-in-out;
21+
}
22+
23+
.add-to-cursor a:hover img {
24+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
25+
}

src/theme/MDXComponents.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from "react";
33
import MDXComponents from "@theme-original/MDXComponents";
44
import RCCodeBlock from "@site/src/components/RCCodeBlock";
55
import YouTubeEmbed from "@site/src/components/YouTubeEmbed";
6+
import AddToCursor from "@site/src/components/AddToCursor";
67
import SampleApp from "../components/SampleApp/SampleApp";
78
import Button from "@site/src/components/Button/Button";
89
import FeatureItem from "@site/src/components/FeatureItem/FeatureItem";
@@ -12,6 +13,7 @@ import ContentCardItem from "@site/src/components/ContentCardItem/ContentCardIte
1213
type MDXComponentsType = typeof MDXComponents & {
1314
RCCodeBlock: typeof RCCodeBlock;
1415
YouTubeEmbed: typeof YouTubeEmbed;
16+
AddToCursor: typeof AddToCursor;
1517
SampleApp: typeof SampleApp;
1618
Button: typeof Button;
1719
FeatureItem: typeof FeatureItem;
@@ -23,6 +25,7 @@ const customMDXComponents: MDXComponentsType = {
2325
...MDXComponents,
2426
RCCodeBlock,
2527
YouTubeEmbed,
28+
AddToCursor,
2629
SampleApp,
2730
Button,
2831
FeatureItem,

0 commit comments

Comments
 (0)