Skip to content
Merged
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
28 changes: 25 additions & 3 deletions docs/gram/clients/using-claude-code-with-gram-mcp-servers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,38 @@ Before connecting Claude Code to a Taskmaster MCP server, you first need to crea

## Connecting Claude Code to your Gram-hosted MCP server

Now let's connect Claude Code to your Taskmaster MCP server.
Once your Taskmaster MCP server is ready, there are three ways to connect it to Claude Code:

### Quick Setup with Gram CLI (Recommended)
- Use the `claude mcp add` command from the Gram installation page (recommended).
- Use the Gram CLI to automatically configure the connection.
- Manually add the MCP server configuration.

The fastest way to connect Claude Code to your Gram-hosted MCP server is using the Gram CLI's install command:
### Quick Setup from the Gram installation page

The quickest way to connect Claude Code to a Gram-hosted MCP server is to copy the installation command from the Gram dashboard.

Go to your toolset's installation page at `https://app.getgram.ai/mcp/<your-toolset-slug>/install` and select **Claude Code**. Copy the installation command and run it in your terminal:

![Screenshot showing the Gram installation page with client options](/assets/docs/gram/img/guides/install-clients-page.png)

```bash
claude mcp add --transport http "taskmaster" "https://app.getgram.ai/mcp/your-toolset-slug"
```

Replace `your-toolset-slug` with the slug of your toolset.

### Using the Gram CLI

Alternatively, you can use the Gram CLI to configure the connection. The CLI automatically fetches your toolset configuration and creates the appropriate settings file.

Go to your toolset's installation page and select **Gram CLI** to copy the installation command, or run:

```bash
gram install claude-code --toolset taskmaster
```

![Screenshot showing the output of the gram install claude-code command](/assets/docs/gram/img/guides/claude-code/gram-install-claude-code-command.png)

This command automatically:
- Fetches your toolset configuration from Gram
- Derives the MCP URL and authentication settings
Expand Down
27 changes: 19 additions & 8 deletions docs/gram/clients/using-claude-desktop-with-gram-mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,26 @@ To follow this tutorial, you need:

Before connecting Claude Desktop to a Taskmaster MCP server, you first need to create one. Follow our guide to [creating a Taskmaster MCP server](/docs/gram/examples/creating-taskmaster-mcp-server).

Once your Taskmaster MCP server is ready, there are three ways to connect it to Claude Desktop:
Once your Taskmaster MCP server is ready, there are four ways to connect it to Claude Desktop:

- Use the Gram CLI to generate an installation package (recommended).
- Download a `.mcpb` file from the Gram installation page (recommended).
- Use the Gram CLI to generate an installation package.
- Use the MCP configuration file in Claude Desktop.
- Use the Claude Connectors feature to connect directly to your Gram-hosted MCP server.

## Connecting Claude Desktop from the Gram installation page

The quickest way to connect Claude Desktop to a Gram-hosted MCP server is to download the installation package directly from the Gram dashboard.

Go to your toolset's installation page at `https://app.getgram.ai/mcp/<your-toolset-slug>/install` and click the **Claude Desktop** button to download a `.mcpb` file.

![Screenshot showing the Gram installation page with client options](/assets/docs/gram/img/guides/install-clients-page.png)

Open the downloaded `.mcpb` file. Claude Desktop will prompt you to install the MCP server. Click **Install** to complete the setup.

## Connecting Claude Desktop using the Gram CLI

The Gram CLI provides the simplest way to connect Claude Desktop to a Gram-hosted MCP server. The CLI generates an installation package (`.mcpb` file) that can be opened to automatically configure the connection.
Alternatively, you can use the Gram CLI to generate an installation package (`.mcpb` file).

### 1. Install the Gram CLI

Expand All @@ -61,7 +72,7 @@ For more information about the Gram CLI, see the [Gram CLI documentation](/docs/

### 2. Authenticate with Gram

Authenticate with the Gram account:
Authenticate with your Gram account:

```bash
gram auth
Expand All @@ -79,21 +90,21 @@ gram whoami

### 3. Generate the installation package

Generate the `.mcpb` file for the MCP server toolset:
Run the install command:

```bash
gram install claude-desktop --toolset your-toolset-slug
```

Replace `your-toolset-slug` with the slug of the toolset. For example, to install the Taskmaster toolset:
Replace `your-toolset-slug` with the slug of your toolset. For example, to install the Taskmaster toolset:

```bash
gram install claude-desktop --toolset taskmaster
```

The CLI automatically fetches the toolset configuration from Gram and generates the installation package in the Downloads folder.
The CLI automatically fetches the toolset configuration from Gram and generates the installation package in your Downloads folder.

<video controls={false} aria-label="Editing a tool name" loop={true} autoPlay={true} muted={true} width="100%">
<video controls={false} aria-label="Installing a Gram toolset in Claude Desktop using the Gram CLI" loop={true} autoPlay={true} muted={true} width="100%">
<source
src="/assets/docs/gram/videos/installing-gram-cli-claude-desktop.mp4"
type="video/mp4"
Expand Down
216 changes: 216 additions & 0 deletions docs/gram/clients/using-cursor-with-gram-mcp-server.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
---
title: "Using Cursor with Gram-hosted MCP servers"
description: "Learn how to connect Cursor to Gram-hosted MCP servers to give your AI coding assistant access to your APIs and tools."
sidebar:
order: 3
---

[Cursor](https://www.cursor.com/) is an AI-powered code editor built on VS Code that brings intelligent coding assistance directly into your development workflow. With its built-in AI features and support for the Model Context Protocol (MCP), Cursor can interact with external tools and services.

When combined with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers, Cursor becomes even more powerful. Using MCP servers, you can give Cursor access to your tools and infrastructure, allowing it to work with your APIs, databases, and other services.

This guide shows you how to connect Cursor to a [Gram-hosted MCP server](/blog/release-gram-beta) using Taskmaster, a full-stack CRUD application for task and project management. Taskmaster includes a web UI for managing projects and tasks, a built-in HTTP API, OAuth 2.0 authentication, and a Neon PostgreSQL database for storing data. Try the [demo app](https://taskmaster-speakeasyapi.vercel.app/) to see it in action.

You'll learn how to set up the connection, test it, and use natural language to manage tasks, projects, and workflows through Cursor.

Find the full code and OpenAPI document in the [Taskmaster repository](https://github.com/speakeasy-api/taskmaster).

## Prerequisites

To follow this tutorial, you need:

- A [Gram account](https://app.getgram.ai)
- [Cursor](https://www.cursor.com/) installed

## Creating an MCP server

Before connecting Cursor to a Taskmaster MCP server, you first need to create one. Follow our guide to [creating a Taskmaster MCP server](/docs/gram/examples/creating-taskmaster-mcp-server).

Once your Taskmaster MCP server is ready, there are two ways to connect it to Cursor:

- Use the Gram CLI to open a browser-based installation flow (recommended).
- Manually edit the Cursor MCP configuration file.

## Connecting Cursor using the Gram CLI

The Gram CLI provides the simplest way to connect Cursor to a Gram-hosted MCP server. The CLI opens a browser-based installation flow that configures the connection automatically.

### 1. Install the Gram CLI

Install the Gram CLI using curl:

```bash
curl -fsSL https://go.getgram.ai/cli.sh | bash
```

Alternatively, install using Homebrew:

```bash
brew tap speakeasy-api/tap
brew install gram
```

Verify the installation:

```bash
gram --version
```

For more information about the Gram CLI, see the [Gram CLI documentation](/docs/gram/command-line).

### 2. Authenticate with Gram

Authenticate with your Gram account:

```bash
gram auth
```

Follow the prompts to complete authentication. This creates an API key and saves it locally.

Verify authentication:

```bash
gram whoami
```

### 3. Install the toolset

Open Cursor's integrated terminal with `` Cmd + ` `` on macOS or `` Ctrl + ` `` on Windows/Linux and run:

```bash
gram install cursor --toolset your-toolset-slug
```

Replace `your-toolset-slug` with the slug of your toolset. For example, to install the Taskmaster toolset:

```bash
gram install cursor --toolset taskmaster
```

Cursor's "Add MCP Server" modal will automatically pop up with the configuration pre-filled. Click **Install** to complete the setup.

<video controls={false} aria-label="Installing a Gram toolset in Cursor using the Gram CLI" loop={true} autoPlay={true} muted={true} width="100%">
<source
src="/assets/docs/gram/videos/install-gram-cli-cursor.mp4"
type="video/mp4"
/>
</video>

For more details and advanced options, see the [`gram install` documentation](/docs/gram/command-line/install).

### 4. Test the connection

Open Cursor's AI chat by clicking the chat icon or pressing `Cmd/Ctrl + L`. Verify the connection by creating a test task:

```
Create a new task called "Test MCP connection" with description "Verify that the Taskmaster MCP server is working correctly"
```

Cursor will use the Gram-hosted MCP server to create the task through the Taskmaster API.

## Manual Setup

Alternatively, you can manually configure Cursor by editing the MCP configuration file directly.

<div className="flex justify-center">
<video controls>
<source src="/assets/docs/gram/videos/installing-mcp-cursor.mp4" type="video/mp4"></source>
Your browser does not support the video tag.
</video>
</div>

### 1. Access the Cursor MCP configuration

In Cursor, navigate to **Settings -> Cursor Settings** and open **Tools & Integrations**. Look for the **MCP Tools** section and click **Add Custom MCP**.

### 2. Add the MCP server configuration

Cursor's global MCP configuration file will open. Add your Taskmaster MCP server configuration.

For **Pass-through Authentication**, the configuration looks like this:

```json
{
"mcpServers": {
"GramTaskmaster": {
"command": "npx",
"args": [
"mcp-remote",
"https://app.getgram.ai/mcp/your-taskmaster-slug",
"--header",
"MCP-TASK-MASTER-API-KEY:${MCP_TASK_MASTER_API_KEY}"
],
"env": {
"MCP_TASK_MASTER_API_KEY": "your-api-key"
}
}
}
}
```

For a **Managed Authentication** server, the configuration looks like this:

```json
{
"mcpServers": {
"GramTaskmaster": {
"command": "npx",
"args": [
"mcp-remote",
"https://app.getgram.ai/mcp/your-taskmaster-slug",
"--header",
"Authorization: ${GRAM_KEY}"
],
"env": {
"GRAM_KEY": "Bearer your-gram-api-key"
}
}
}
}
```

Replace `your-taskmaster-slug` with the actual slug from your Taskmaster MCP server configuration and `your-gram-api-key` with your Gram API key.

### 3. Test the connection

Open Cursor's AI chat by clicking the chat icon or pressing `Cmd/Ctrl + L`. You can now ask questions like:

```
Create a new task called "Implement user authentication" with description "Add login and registration functionality to the app"
```

## Troubleshooting

Here are some common issues and how to fix them.

### Server not connecting

If Cursor can't connect to the Gram server:

- Verify the MCP server URL is correct in your configuration.
- Check that the API behind the MCP server is reachable from your machine.
- Ensure the `npx` command is available (reinstall Node.js if needed).
- Try restarting Cursor after making configuration changes.

### Authentication errors

If you're using an authenticated server and getting authentication errors:

- Verify your Gram API key in the dashboard under **Settings -> API Keys**.
- Ensure the API key is correctly formatted with the `Bearer ` prefix.
- Check that the environment variables are properly set in your configuration.

### Tools not appearing

If the tools aren't showing up in Cursor:

- Test the MCP server in the **Gram Playground** first to ensure it's working.
- Check that the toolset includes the tools you expect to use.
- Verify the environment is correctly configured with the required variables.
- Look for any error messages in Cursor's output panel.

## What's next

Ready to build your own MCP server? [Try Gram today](/product/gram) and see how easy it is to turn any API into agent-ready tools that work across all your development environments.

Loading