# Add an MCP Server to Claude Code Using the IDE or CLI

> Set up a remote MCP server in Claude Code with the IDE or CLI, select Local, User, or Project scope, authenticate with OAuth, and test available tools.
- **Author**: harsh-kanani
- **Published**: 2026-09-25
- **Modified**: 2026-09-25
- **Category**: AI & DevOps
- **URL**: https://kuberns.com/blogs/set-up-mcp-server-in-claude-code/

---

Claude Code supports remote MCP servers in both its terminal interface and IDE extension. To connect one, open **`/mcp`**, add the server as **HTTP (remote)**, enter its HTTPS endpoint, choose a configuration scope, and complete OAuth when prompted. From the terminal, the same setup uses `claude mcp add --transport http <name> <url>`.

This guide walks through both methods using the Kuberns MCP server as a working example. Kuberns provides deployment status, logs, build history, and non-secret configuration through its authorized tools, while Claude Code already has access to the repository in your development workspace. Connecting them lets Claude compare deployment problems with the code you are actively debugging.

For Kuberns, the remote endpoint is `https://mcp.kuberns.cloud/mcp`. You do not need to install a local package, run an `npx` command, or add an API-key header. If your goal is to use an MCP server in a normal Claude conversation instead of a coding workspace, follow the separate guide to [connect a remote MCP server to Claude web or desktop](https://kuberns.com/blogs/connect-remote-mcp-server-to-claude/).

## TL;DR

In the Claude Code IDE interface:

1. Enter **`/mcp`** and open **MCP servers**.
2. Add a server named **Kuberns**.
3. Select **HTTP (remote)**.
4. Enter `https://mcp.kuberns.cloud/mcp` and leave headers empty.
5. Choose **Local**, **User** or **Project** scope.
6. Add the server, start a new session if prompted and select **Authenticate**.
7. Approve the requested access and verify that the server shows **Connected**.

From the terminal, the equivalent default setup is:

```bash
claude mcp add --transport http kuberns https://mcp.kuberns.cloud/mcp
```

Run `claude`, enter `/mcp`, authenticate Kuberns and test it with a read-only deployment-status request.

## Why Is MCP Setup Different in Claude Code and Claude Desktop?

Claude and Claude Code belong to the same platform, but they serve different workflows and do not use the same setup path for every MCP connection. Regular Claude web and desktop conversations use account-level **Connectors**. Claude Code is a development agent that works in a repository through its terminal, desktop Code session or IDE extension, so its manually configured MCP servers use Claude Code scopes and configuration files.

| Setup | Best for | Where you add the server | Configuration model |
|---|---|---|---|
| Claude web or desktop connector | Normal Claude conversations | Settings → Connectors | Account or organization connector |
| Claude Code IDE extension | Coding inside VS Code or a supported IDE | `/mcp` → MCP servers | Local, User or Project scope |
| Claude Code terminal | Terminal-based development and automation | `claude mcp add` | Local, User or Project scope |

The difference matters because adding Kuberns to Claude Connectors does not automatically create the same local or project-scoped server in Claude Code. Likewise, a server added with `claude mcp add` is stored in Claude Code configuration rather than being added to the normal Claude Connectors list.

Use the [Claude web and desktop connector guide](https://kuberns.com/blogs/connect-remote-mcp-server-to-claude/) when your goal is to discuss deployment information in a normal conversation. Use this guide when Claude also needs the context of the codebase open in your development environment.

## What Do You Need Before Setting Up Kuberns in Claude Code?

Confirm that you have:

- Claude Code installed or the Claude Code extension open in a supported IDE.
- A signed-in Claude account that can use Claude Code.
- A Kuberns account that you can authorize.
- A Kuberns application or deployment for a meaningful test.
- The remote endpoint: `https://mcp.kuberns.cloud/mcp`.
- A browser available to complete OAuth authorization.

Anthropic's <a href="https://code.claude.com/docs/en/mcp" target="_blank" rel="noopener noreferrer">Claude Code MCP documentation</a> recommends HTTP for cloud-hosted remote MCP servers. The Kuberns endpoint is remote, so do not configure it as a local stdio command or the legacy SSE transport.

> **Nothing deployed yet?** [Deploy an application from your GitHub repository with Kuberns](https://dashboard.kuberns.com/) before testing its deployment tools in Claude Code.

## Set Up the Kuberns MCP Server in the Claude Code IDE

The Claude Code extension provides a graphical MCP server manager inside the IDE. These steps use that interface and apply to the workflow shown in the supplied Claude Code screenshots.

### Step 1: Open the MCP Server Manager

Open the Claude Code panel in your IDE and enter `/mcp`. Select **MCP servers** from the menu.

![Open the MCP servers manager from the Claude Code IDE extension](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/open-mcp-servers-in-claude-code-ide.jpg)

The `/mcp` interface is where Claude Code shows configured servers, connection states, authentication requirements and available tools. It is different from the normal Claude application's **Settings → Connectors** page.

**Expected result:** The MCP servers panel opens with controls for adding and managing servers.

### Step 2: Add the Kuberns Remote Server

Choose **Add MCP server** and enter:

| Field | Value |
|---|---|
| Name | Kuberns |
| Transport | HTTP (remote) |
| URL | `https://mcp.kuberns.cloud/mcp` |
| Headers | Leave empty |

![Add the Kuberns remote MCP endpoint in the Claude Code IDE](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/add-kuberns-mcp-server-to-claude-code-ide.jpg)

> **Important:** The screenshot contains temporary text in the **Headers** field. Delete that text before selecting **Add server**. The Headers field must be empty for this Kuberns OAuth setup.

HTTP is the correct transport because Kuberns provides a cloud-hosted HTTPS endpoint. Headers are not needed for this setup because authorization happens through OAuth after the server is added.

Check the hostname and `/mcp` path before continuing. Only connect remote servers operated by providers you trust.

### Step 3: Choose Where the Server Should Be Available

Claude Code offers three MCP scopes:

- **Local:** available only to you in the current project.
- **User:** available to you across all projects.
- **Project:** shared with the team through `.mcp.json` in the project repository.

For a first test, choose **Local**. It keeps the configuration private and limits it to the current project. Use **User** if you regularly inspect Kuberns deployments from several repositories. Use **Project** only when the team has agreed to share the server definition.

Select **Add server** after choosing the scope.

![Confirmation that Kuberns was added to the local Claude Code configuration](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/kuberns-mcp-added-to-claude-code-local-scope.jpg)

**Expected result:** Claude Code confirms that Kuberns was added. If the interface says it will be available in new sessions, start a new Claude Code session before continuing.

### Step 4: Authenticate Your Kuberns Account

Open Kuberns in the MCP servers list. A newly added OAuth server can show **Needs Auth** before you sign in. This is an expected state, not proof that the configuration failed.

![Authenticate the Kuberns MCP server from Claude Code](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/authenticate-kuberns-mcp-in-claude-code.jpg)

Select **Authenticate**. Claude Code opens a browser window for the Kuberns authorization flow.

According to Anthropic's documentation, Claude Code marks a remote server as needing authentication when it receives an authorization response that requires the user to sign in. Completing OAuth gives Claude Code an authorized connection without placing a Kuberns password or static token in the MCP configuration.

### Step 5: Review the Requested Access

The Kuberns authorization screen used for this workflow requests access to supported deployment information and operations, including:

- Deployment status and build history.
- Build and runtime logs.
- Environment and resource configuration without secret values.
- Billing and credits information.
- Support-ticket operations.

![Review the permissions requested by the Kuberns MCP server in Claude Code](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/review-kuberns-mcp-permissions-in-claude-code.jpg)

Read the live consent screen before approving it. The current screen is the authoritative description of the access being requested, and the permissions can change as the integration evolves.

Select **Approve** only when the application name, account and permissions are correct.

### Step 6: Verify the Server and Its Tools

Return to Claude Code and open Kuberns in `/mcp`. The server should show **Connected**, along with an option to view the tools it currently publishes.

Do not rely on a fixed tool count. The available inventory can change, and Claude Code discovers it from the connected server. Review the names and descriptions of the tools before asking Claude to perform an operation.

Start with a read-only request:

> Use Kuberns to check the deployment status and recent build history for the application in this repository.

If the Kuberns account contains several applications, include the application or service name. A successful response should use a Kuberns tool, return information from the authorized account and avoid exposing secret values.

## Which Claude Code MCP Scope Should You Choose?

The correct scope depends on where you need the server and whether its configuration should be shared.

| Scope | Loads in | Shared with the team | Best use |
|---|---|---|---|
| Local | Current project only | No | First-time setup, testing or a private project-specific connection |
| User | All your projects | No | One personal Kuberns connection used across multiple repositories |
| Project | Current project only | Yes, through `.mcp.json` | A team-standard server definition committed with the repository |

Local is the safest default for this guide. Anthropic stores Local and User definitions in the user's Claude Code configuration, while Project scope writes the server definition to `.mcp.json` at the project root.

Project scope shares the endpoint and transport configuration, not a teammate's Kuberns login. Each developer should review the project server, trust the workspace and complete the required authentication in their own environment. Never commit passwords, API keys or OAuth tokens to `.mcp.json`.

## Set Up Kuberns From the Claude Code Terminal

The terminal method creates the same type of Claude Code MCP configuration without using the IDE form. Run the command from the repository where you want to use Kuberns.

### Add Kuberns to the Current Project for Your User

Local is the default scope:

```bash
claude mcp add --transport http kuberns https://mcp.kuberns.cloud/mcp
```

### Make Kuberns Available in All Your Projects

```bash
claude mcp add --transport http --scope user kuberns https://mcp.kuberns.cloud/mcp
```

### Share the Server Definition With the Project

```bash
claude mcp add --transport http --scope project kuberns https://mcp.kuberns.cloud/mcp
```

Project scope creates or updates the repository's `.mcp.json` configuration. Review the file before committing it and confirm that it contains only shareable configuration.

After adding the server, open Claude Code and enter `/mcp` to authenticate it. You can also inspect the configuration with:

```bash
claude mcp get kuberns
```

![Manage Kuberns and review MCP server status in the Claude Code CLI](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/manage-kuberns-mcp-in-claude-code-cli.png)

An “Added” confirmation means the configuration was written. It does not prove that authentication and tool discovery have completed, so verify that `/mcp` shows **Connected** before relying on the tools.

## Should You Use the IDE Setup or the Terminal Command?

Both methods configure MCP for Claude Code. Choose the interface that matches your workflow.

| Method | Choose it when | Main advantage |
|---|---|---|
| Claude Code IDE interface | You work primarily in VS Code or another supported IDE | Visual setup, scope selection and connection status |
| Claude Code CLI | You work in a terminal or want a repeatable command | Fast setup and explicit flags |
| Project `.mcp.json` | A team needs the same server definition | Version-controlled configuration |

Anthropic notes that the VS Code extension bundles its own CLI for the chat panel. The standalone CLI is still required if you want to run the `claude` command in the IDE's integrated terminal. See the official <a href="https://code.claude.com/docs/en/vs-code" target="_blank" rel="noopener noreferrer">Claude Code extension documentation</a> for the current prerequisites.

## How Does Kuberns Help Claude Code Debug a Production App?

Claude Code and Kuberns provide two different types of context. Claude Code can inspect the repository and reason about the files available in the active development workspace. The Kuberns MCP server can provide the authorized deployment status, logs and non-secret operational context published by its current tools.

Together, these contexts can help a developer compare a production symptom with the relevant application code. For example, Claude Code can inspect where an environment variable is referenced locally, then use Kuberns to check whether the variable name is configured for the deployed service without revealing its secret value.

Kuberns does not need to expose the repository's source code through MCP for this workflow. Claude Code reads the repository through the development environment, while Kuberns supplies the deployment-side context. The user remains responsible for reviewing tool permissions, proposed code changes and any external action.

![Kuberns Agentic AI platform for application deployment](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/kuberns-home-page-new.png)

[Kuberns](https://kuberns.com/) is an Agentic AI platform for deployment built for full-stack and complex backend projects. Its remote MCP connection helps bring supported deployment context into the coding session where developers investigate and fix application problems.

## Example Claude Code Prompts for Kuberns

Use prompts that name the application, identify the evidence to inspect and state the expected outcome.

**Compare a failed build with the repository:**

> Use Kuberns to inspect the latest failed build for this application. Compare the first actionable error with the current repository files and explain the most likely cause before proposing a change.

**Investigate a runtime error:**

> Review the recent Kuberns runtime logs for repeated backend errors. Locate the related code in this repository and suggest the smallest safe fix.

**Check environment-variable names:**

> Use Kuberns to list the configured environment-variable names without showing their values. Compare them with the variables referenced by this codebase and identify missing or inconsistent names.

**Verify a deployment:**

> Check the latest Kuberns deployment for this application and summarize its status, build history and any actionable warning.

**Prepare a support request:**

> Gather the relevant Kuberns build information for this failure and draft a concise support-ticket summary. Show me the draft before creating anything.

Claude can use only the tools currently exposed by Kuberns and authorized for the account. If a prompt requests an unavailable operation, review the tool inventory rather than assuming the action is supported.

## Why Does Kuberns Show “Needs Auth” in Claude Code?

**Needs Auth** means Claude Code has the MCP server configuration but does not have a valid authorized session for that remote endpoint. It commonly appears immediately after adding Kuberns and is resolved by completing the OAuth flow.

Open `/mcp`, select Kuberns, choose **Authenticate** and complete authorization in the browser. If authentication previously worked, the stored token may have expired or been revoked. Use **Clear authentication** when available, then authenticate again.

Do not work around an OAuth prompt by placing a password or undocumented token in the Headers field. For the Kuberns endpoint in this guide, leave headers empty and use the provided browser authorization flow.

## How to Fix Claude Code MCP Connection Problems

Use the displayed state and the stage where setup stopped to identify the cause.

| Problem | Likely cause | What to do |
|---|---|---|
| Kuberns was added but is missing from the current session | The interface said the server would be available in new sessions | Start a new Claude Code session and reopen `/mcp` |
| Kuberns shows Needs Auth | OAuth has not completed or is no longer valid | Select Authenticate and complete the browser flow |
| Kuberns shows Failed to connect | Wrong endpoint, network failure or server response error | Confirm `https://mcp.kuberns.cloud/mcp`, then reconnect and inspect the reported issue |
| The URL was added as a command | The wrong transport was selected | Remove the entry and add it again as HTTP remote |
| The server works in one repository but not another | Local scope limits it to the original project | Add it at User scope or configure it separately in the other project |
| A teammate sees Pending approval | Project-scoped `.mcp.json` requires workspace trust and approval | Open Claude Code in the repository, review the server and approve it |
| The server is connected but the expected tool is absent | Tool discovery is stale or the server does not expose that tool | Reconnect from `/mcp` and inspect the current tool inventory |
| The normal Claude connector works but Claude Code does not | The account connector and Claude Code configuration are separate | Add and authenticate the server in Claude Code using this guide |
| Duplicate Kuberns entries behave differently | The same name exists in more than one scope or points to another endpoint | Inspect each scope and remove the obsolete definition |

Anthropic's MCP documentation says remote HTTP servers can retry transient first-connection failures and reconnect after some mid-session drops. Authentication errors still require user action. Use `/mcp` to reconnect, clear authentication or inspect the server's status rather than repeatedly recreating the same configuration.

## How to Clear Authentication, Disable or Remove Kuberns

Open `/mcp` and select Kuberns. Depending on its state, Claude Code can provide these controls:

- **Reconnect:** discard stale discovery information and establish a fresh connection.
- **Clear authentication:** remove the current authorization so you can sign in again.
- **Disable:** stop connecting to the server in the current project without deleting its configuration.
- **Remove:** delete the configured server.

You can also remove the server from the terminal:

```bash
claude mcp remove kuberns
```

If the server was added at User or Project scope, include the matching scope when needed. Anthropic states that removing a remote server also deletes the OAuth tokens and client registration Claude Code stored for that server.

## Use Kuberns Deployment Context Inside Claude Code

Claude Code MCP setup is designed for development workflows where repository context and external operational data need to meet in the same session. Add Kuberns as a remote HTTP server, choose the narrowest useful scope, complete OAuth and verify the available tools with a read-only request before attempting a consequential action.

For normal Claude conversations outside a coding workspace, use the [Claude remote MCP connector guide](https://kuberns.com/blogs/connect-remote-mcp-server-to-claude/). For repository-aware debugging in a terminal or IDE, use the Claude Code setup in this article.

[![Deploy with Kuberns and connect your application to Claude Code](https://kuberns-blogs-media.s3.ap-south-1.amazonaws.com/CTA_banner.png)](https://dashboard.kuberns.com/)

## Frequently Asked Questions

### How do I add an MCP server to Claude Code?

Open `/mcp` in Claude Code and use the MCP server manager, or run `claude mcp add --transport http` followed by a server name and its HTTPS endpoint. For Kuberns, use the name `kuberns` and `https://mcp.kuberns.cloud/mcp`.

### Can I use an MCP server in the Claude Code IDE extension?

Yes. Open the Claude Code panel in the IDE, enter `/mcp` and add or manage the server through the MCP servers interface. Claude Code configuration can also be managed from its command line.

### Which transport should I use for a remote MCP server in Claude Code?

Use HTTP for a remote HTTPS MCP endpoint. Anthropic recommends HTTP for cloud-based remote MCP servers and describes SSE as a legacy transport. Use stdio only when the MCP server runs as a local process.

### Which Claude Code MCP scope should I choose?

Choose Local for a private server configuration limited to the current project, User when you want the server in all your projects or Project when the team should share the configuration through the repository's `.mcp.json` file.

### Why does an MCP server show Needs Auth in Claude Code?

Needs Auth means the remote server requires authorization and Claude Code has not completed a valid sign-in. Open the server in `/mcp`, select **Authenticate** and finish the OAuth flow in the browser.

### Why does an MCP server work in Claude but not Claude Code?

The regular Claude connector flow and Claude Code configuration are separate setup paths. Add the server through `/mcp`, the Claude Code CLI or a Claude Code configuration file, then authenticate it in that environment.

### Does a project-scoped `.mcp.json` file share OAuth credentials?

No. Project scope shares the MCP server configuration through `.mcp.json`, but each developer must trust the project server and complete any required authorization for their own environment.

### How do I remove an MCP server from Claude Code?

Open `/mcp`, select the server and choose **Remove**, or run `claude mcp remove kuberns`. Removing a remote server also deletes the OAuth tokens and client registration Claude Code stored for that server.

---
- [More AI & DevOps articles](https://kuberns.com/blogs/category/ai-devops/1/)
- [All articles](https://kuberns.com/blogs/)