Speakeasy Logo
Skip to Content

Using Cursor with Gram-hosted MCP servers

Cursor  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)  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 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  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 .

Prerequisites

To follow this tutorial, you need:

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.

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:

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

Alternatively, install using Homebrew:

brew tap speakeasy-api/tap brew install gram

Verify the installation:

gram --version

For more information about the Gram CLI, see the Gram CLI documentation.

2. Authenticate with Gram

Authenticate with your Gram account:

gram auth

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

Verify authentication:

gram whoami

3. Install the toolset

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

gram install cursor --toolset your-toolset-slug

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

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.

For more details and advanced options, see the gram install documentation.

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.

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:

{ "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:

{ "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 and see how easy it is to turn any API into agent-ready tools that work across all your development environments.

Last updated on