Using your IDE with Gram-hosted MCP servers
The Model Context Protocol (MCP) connects your AI assistants to real-world tools and data sources. Instead of manually copying and pasting information between tools and your AI assistant, your AI assistant can interact directly with APIs, databases, and services through standardized tool calls.
Gram makes setting up MCP servers simple by hosting servers in the cloud, so you don’t need to handle local configurations, manage infrastructure, or deal with authentication complexity. With Gram, you can turn any OpenAPI document into a fully functional MCP server in minutes.
This guide shows you how to create a Gram-hosted MCP server and use it across some of the most popular IDE-based MCP clients.
Find the full code and OpenAPI document in the Push Advisor API repository.
Prerequisites
Section titled “Prerequisites”To follow this guide, you’ll need:
- A Gram account.
- An MCP client. This guide covers Cursor, VS Code with Copilot, Windsurf, and Amp. For Claude Desktop, see the dedicated Claude Desktop guide.
Creating a Gram-hosted MCP server
Section titled “Creating a Gram-hosted MCP server”If you already have a Gram-hosted MCP server configured, you can skip to the relevant section on adding it to your MCP client. For an in-depth guide on how Gram works and more details on how to create a Gram-hosted MCP server, check out the Gram concepts guide.
Setting up a Gram project
Section titled “Setting up a Gram project”In the Gram dashboard, click New Project to start the guided setup flow for creating a toolset and MCP server.
Enter a project name and click Submit.
Gram will then guide you through the following steps.
Step 1: Upload the OpenAPI document
Section titled “Step 1: Upload the OpenAPI document”Upload the Push Advisor OpenAPI document, enter the name of your API, and click Continue.
Step 2: Create a toolset
Section titled “Step 2: Create a toolset”Give your toolset a name (for example, “Push Advisor”) and click Continue.
Notice that the names of the tools that will be generated from your OpenAPI document are displayed in this dialog.
Step 3: Configure MCP
Section titled “Step 3: Configure MCP”Enter a URL slug for the MCP server and click Continue.
Gram will create the toolset from the OpenAPI document.
Click Toolsets in the sidebar to view the Push Advisor toolset.
Configuring environment variables
Section titled “Configuring environment variables”Environments store API keys and configuration separate from your toolset logic.
In the Environments tab, click the “Default” environment. Click Edit and then Fill for Toolset. Select the Push Advisor toolset and click Fill Variables to automatically populate the required variables.
The Push Advisor API is hosted at canpushtoprod.abdulbaaridavids04.workers.dev
, so set the <API_name>_SERVER_URL
environment variable to https://canpushtoprod.abdulbaaridavids04.workers.dev
. Click Update and then Save.
Publishing an MCP server
Section titled “Publishing an MCP server”Let’s make the toolset available as an MCP server.
Go to the MCP tab, find the Push Advisor toolset, and click Edit.
On the MCP Details page, tick the Public checkbox and click Save.
Scroll down to the MCP Config section and copy the Public Server configuration.
The configuration will look something like this:
{ "mcpServers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod" ] } }}
Use the Authenticated Server configuration if you want to use the MCP server in a private environment.
You’ll need an API key to use an authenticated server. Generate an API key in the Settings tab and copy it to the GRAM_KEY
environment variable in place of <your-key-here>
.
The authenticated server configuration looks something like this:
{ "mcpServers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod", "--header", "Authorization: ${GRAM_KEY}" ], "env": { "GRAM_KEY": "Bearer <your-key-here>" } } }}
Here’s what these configuration options do:
"command"
– The executable to run (in this case,npx
)."args"
– Array of command-line arguments."env"
– Environment variables for the server process (optional)."timeout"
– Request timeout in milliseconds (optional, defaults to600,000ms
)."trust"
– Whentrue
, bypasses all tool call confirmations (optional, defaults tofalse
).
These configurations will work across all MCP clients. Next, we’ll show you how to add MCP server configurations to the most popular IDE-based MCP clients.
Adding the Gram-hosted MCP server to Cursor
Section titled “Adding the Gram-hosted MCP server to Cursor”Cursor’s built-in configuration interface makes it easy to add and manage MCP servers directly from settings.
Step 1: Access the Cursor MCP configuration
Section titled “Step 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.
Step 2: Add the MCP server configuration
Section titled “Step 2: Add the MCP server configuration”Cursor’s global MCP configuration file will open. Add the Gram-hosted MCP server configuration:
{ "mcpServers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod" ] } }}
For authenticated servers, include the environment variables:
{ "mcpServers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod", "--header", "Authorization: ${GRAM_KEY}" ], "env": { "GRAM_KEY": "Bearer your-api-key-here" } } }}
Step 3: Use the MCP server tools
Section titled “Step 3: Use the MCP server tools”Open Cursor’s AI chat by clicking the chat icon or pressing Cmd/Ctrl + L
. You can now ask questions like:
What's the vibe for pushing code today?
Adding the Gram-hosted MCP server to VS Code with GitHub Copilot
Section titled “Adding the Gram-hosted MCP server to VS Code with GitHub Copilot”VS Code supports MCP through GitHub Copilot with version 1.101 or later.
Step 1: Add the MCP server to the VS Code settings file
Section titled “Step 1: Add the MCP server to the VS Code settings file”Open the VS Code command palette with Ctrl/Cmd + Shift + P
and search for Add MCP Server
. Select the HTTP option.
Paste in the URL of your hosted MCP server and enter the server name. The server name is used as the server ID in the MCP configuration.
Your MCP server will now show up in the list of MCP servers in the settings.json
file.
Step 2: (Optional) Add an API key to the VS Code settings file
Section titled “Step 2: (Optional) Add an API key to the VS Code settings file”If you’re using an authenticated server, you can add an API key to the settings.json
file:
{ "servers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod", "--header", "Authorization: ${input:gram_token}" ] } }, "inputs": [ { "type": "promptString", "id": "gram_token", "description": "Gram API Token", "password": true } ]}
Step 3: Start the server
Section titled “Step 3: Start the server”Open the command palette (Ctrl/Cmd + Shift + P
) and type MCP: List Servers
to see available servers. Click on the Gram-hosted MCP server to start it.
Step 4: Use the MCP server tools with Copilot
Section titled “Step 4: Use the MCP server tools with Copilot”The Push Advisor tools are now available in the Copilot chat interface. You can enable and disable specific tools as needed.
You can ask questions like:
Should I push this code to production?
Adding the Gram-hosted MCP server to Windsurf
Section titled “Adding the Gram-hosted MCP server to Windsurf”Windsurf manages MCP servers through its built-in plugin interface.
Step 1: Access Windsurf plugin settings
Section titled “Step 1: Access Windsurf plugin settings”Click Windsurf in the top menu bar, then navigate to Settings -> Windsurf Settings to open the main configuration interface.
Under the Plugins (MCP Servers) section, click Manage plugins to access the plugin configuration area. Click View raw config to open the configuration file editor.
Step 2: Add the MCP server configuration
Section titled “Step 2: Add the MCP server configuration”In the mcp_config.json
file that opens, replace the contents with the MCP server configuration:
{ "mcpServers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod" ] } }}
Save the file.
Step 3: Activate the plugin
Section titled “Step 3: Activate the plugin”In the Manage plugins tab, and click Refresh to reload the plugin configuration. The MCP server plugin will now appear in your available plugins and is ready to use.
Adding the Gram-hosted MCP server to Amp using the VS Code extension
Section titled “Adding the Gram-hosted MCP server to Amp using the VS Code extension”Amp is Sourcegraph’s agentic coding tool, available as a VS Code extension and command-line tool.
The Amp VS Code extension has a GUI for adding and managing MCP servers.
Step 1: Open Amp settings
Section titled “Step 1: Open Amp settings”Click the Settings icon in the side window. Scroll down to the MCP Servers section and click Add MCP Server.
Step 2: Add the MCP server configuration
Section titled “Step 2: Add the MCP server configuration”Complete the MCP server details as follows:
- Server Name:
pushadvisor
- Command or URL:
npx
If you’re using a public server:
- Arguments:
mcp-remote https://app.getgram.ai/mcp/canipushtoprod
If you’re using an authenticated server:
- Arguments:
mcp-remote https://app.getgram.ai/mcp/canipushtoprod --header "Authorization: ${GRAM_KEY}"
- Environment Variables:
GRAM_KEY=your-api-key-here
(replaceyour-api-key-here
with your Gram API key from the dashboard)
Find instructions for generating an API key in the publishing an MCP server section.
Step 3: Use the MCP server tools
Section titled “Step 3: Use the MCP server tools”Amp automatically loads your Gram-hosted MCP server. You can now interact with the Push Advisor API through natural language prompts like:
Check if the deployment vibes are good today
Adding the Gram-hosted MCP server to Amp CLI
Section titled “Adding the Gram-hosted MCP server to Amp CLI”Amp can be configured through the settings.json
file.
Step 1: Access the Amp CLI configuration file
Section titled “Step 1: Access the Amp CLI configuration file”The location of the Amp CLI configuration file varies by operating system:
- macOS:
~/.config/amp/settings.json
- Windows:
%APPDATA%\amp\settings.json
- Linux:
~/.config/amp/settings.json
Step 2: Add the MCP server configuration
Section titled “Step 2: Add the MCP server configuration”Add the amp.mcpServers
setting with your Gram-hosted MCP server details to the configuration file:
{ "amp.mcpServers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod" ] } }}
If you’re using an authenticated server, include the environment variable:
{ "amp.mcpServers": { "GramPushadvisor": { "command": "npx", "args": [ "mcp-remote", "https://app.getgram.ai/mcp/canipushtoprod", "--header", "Authorization: ${GRAM_KEY}" ], "env": { "GRAM_KEY": "Bearer your-api-key-here" } } }}
Step 3: Use the MCP server tools
Section titled “Step 3: Use the MCP server tools”Amp automatically loads your Gram-hosted MCP server. You can now interact with the Push Advisor API using natural language prompts like:
Check if the deployment vibes are good today
Amp recommends being selective with MCP tools for best performance. Too many available tools can reduce model performance, so consider disabling unused MCP tools by adding them to the amp.tools.disable
setting.
Troubleshooting
Section titled “Troubleshooting”Here are some common issues and solutions:
Server not connecting
Section titled “Server not connecting”If your MCP client 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 your MCP client after making configuration changes.
Authentication errors
Section titled “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.
Tools not appearing
Section titled “Tools not appearing”If the tools aren’t showing up in your MCP client:
- 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 your MCP client’s logs.
What’s next
Section titled “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.