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
130 changes: 113 additions & 17 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,11 +26,94 @@ 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 two ways you can connect it to Claude Desktop:
Once your Taskmaster MCP server is ready, there are three ways to connect it to Claude Desktop:

- Use the Gram CLI to generate an installation package (recommended).
- 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 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.

### 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 the 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
```

![Screenshot showing the output of the `gram auth` command and `gram whoami` commands](/assets/docs/gram/img/guides/claude-desktop/gram-auth-whoami.png)

### 3. Generate the installation package

Generate the `.mcpb` file for the MCP server toolset:

```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:

```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.

<video controls={false} aria-label="Editing a tool name" loop={true} autoPlay={true} muted={true} width="100%">
<source
src="/assets/docs/gram/videos/installing-gram-cli-claude-desktop.mp4"
type="video/mp4"
/>
</video>

### 4. Install in Claude Desktop

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

### 5. Test the connection

Open Claude Desktop and 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"
```

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

## Connecting Claude Desktop to your Gram-hosted MCP server using the MCP configuration file

<div className="flex justify-center">
Expand Down Expand Up @@ -153,31 +236,44 @@ Claude should prompt you with a tool call request. This means the connection is

## Deciding which method to use

Both methods connect Claude Desktop to your Gram-hosted MCP server, but they have different use cases:
All three methods connect Claude Desktop to a Gram-hosted MCP server, but they have different use cases:

- **MCP configuration file:** Use this method if you need to connect to an authenticated MCP server or if you want more control over the configuration.
- **Claude Connectors:** Use this method for a simpler setup with public MCP servers. It's more user-friendly and doesn't require manual configuration file editing.
- **Gram CLI:** The recommended method for most users. It provides a simple, automated setup process and supports authenticated servers. Requires installing the Gram CLI and authenticating with a Gram API key.
- **MCP configuration file:** Use this method for advanced configuration scenarios or when the Gram CLI is not available. Provides full control over the connection configuration.
- **Claude Connectors:** The simplest method for public MCP servers that don't require authentication. Does not support authenticated servers or environment variables.

## Comparison of connection methods

| Attribute/Requirement | MCP Configuration File | Claude Desktop Connectors |
|--------------------------------|------------------------|---------------------------|
| Public MCP server | ✅ | ✅ |
| Local MCP server | ✅ | ❌ |
| Supports authenticated server | ✅ | ❌ |
| Manual configuration needed | ✅ | ❌ |
| User-friendly setup | ❌ | ✅ |
| Supports passthrough variables | ✅ | ❌ |
| Attribute/Requirement | Gram CLI | MCP Configuration File | Claude Desktop Connectors |
|--------------------------------|----------|------------------------|---------------------------|
| Public MCP server | ✅ | ✅ | ✅ |
| Local MCP server | ❌ | ✅ | ❌ |
| Supports authenticated server | ✅ | ✅ | ❌ |
| Manual configuration needed | ❌ | ✅ | ❌ |
| User-friendly setup | ✅ | ❌ | ✅ |
| Supports passthrough variables | ✅ | ✅ | ❌ |
| Requires CLI installation | ✅ | ❌ | ❌ |

## Troubleshooting

If you're experiencing issues:

- 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 Claude Desktop after making configuration changes.
- For authenticated servers, verify your Gram API key in the dashboard under **Settings > API Keys**.
- **Gram CLI method:**
- Ensure the Gram CLI is installed and accessible in the PATH.
- Verify authentication by running `gram whoami`.
- Check that the toolset slug is correct and accessible with the API key.
- For unauthorized errors, verify the Gram API key in the dashboard under **Settings > API Keys**.

- **MCP configuration file method:**
- Verify the MCP server URL is correct in the configuration.
- Check that the API behind the MCP server is reachable from the machine.
- Ensure the `npx` command is available (reinstall Node.js if needed).
- Try restarting Claude Desktop after making configuration changes.
- For authenticated servers, verify the Gram API key in the dashboard under **Settings > API Keys**.

- **Claude Connectors method:**
- Verify the MCP server URL is correct.
- Ensure the MCP server is public and does not require authentication.

## What's next

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading