How to Add an MCP Server to Claude Code: 2026 Setup Guide

Learn how to add an MCP server to Claude Code, sign in, check that its tools load, and fix common connection errors. You'll also see how to use the same setup to build an app from Claude Code, VS Code, or ChatGPT.

Bubble
December 04, 2026 • 11 minute read
A central app screen connected to six data cards, with icons for database, list, and a completed task.

TL;DR: To add an MCP server to Claude Code, choose a scope (local, project, or user) and run claude mcp add with the server's URL and --transport http, or with a local launch command after --. Then sign in and check its tools with /mcp, confirm the connection with claude mcp list, keep secrets out of committed files, and fix most errors by restarting your session, checking your directory, or re-authenticating.

You want Claude Code to do more than read the files in your project. You might want it to look up customers in a database, pull tickets from your issue tracker, or add a feature to an app. You've found an MCP server that does the job, but the setup docs assume you already know which command, scope, and file to use.

Many developer tools now publish an MCP server, with 3,412 new MCP repositories on GitHub in August 2026, so connecting one has become a basic Claude Code skill. It's also easy to get slightly wrong. If you pick the wrong transport or scope, the server may install without an error but not be available where you expect it, so verify it after you add it.

This guide explains what an MCP server does and what to gather before you start. Then you'll choose a scope, run the add command, sign in, and verify the server's tools. You'll also connect an app builder's server, build and review a first feature, fix connection and token errors, and remove access when you're done.

What does an MCP server do in Claude Code?

An MCP server is a connector that gives an MCP-compatible client like Claude Code new tools, like searching a database or editing an app. With one connected, Claude can take actions in other software instead of only reading and writing your project files. Servers are built on Model Context Protocol (MCP), an open standard that lets AI tools talk to other software in a shared format.

Every MCP connection has three parts:

  • The MCP client is Claude Code: It reads your request, decides when a tool would help, and sends a tool call. A tool call is a request to run one specific action, with the details filled in.
  • The MCP server translates the request: It turns Claude's tool call into something the outside service understands, then returns the result. A server can run on your computer or be hosted online.
  • The external service does the work: This is the database, app, or tracker itself. If you ask Claude Code to "list the open bugs assigned to me," it calls your tracker's server, and the server sends back the list.

Servers can offer three kinds of capabilities. Tools are actions Claude can take, like running a query. Resources are data Claude can reference with an @ mention, and prompts are saved instructions that show up as slash commands.

The transport is the way Claude Code and a server talk to each other. You'll run into two main types:

  • Remote HTTP servers: These live at a hosted URL. Many support browser-based OAuth sign-in, while some also accept bearer tokens or API keys. Hosted tools like issue trackers often offer this type.
  • Local stdio servers: Claude Code starts these as a program on your machine and talks to them through standard input and output (stdio). They're common for tools that work with local files.

Some older servers use SSE (Server-Sent Events). SSE still works, but Claude Code's docs recommend HTTP when a provider offers both. Once you know which type you have, you can gather what the server needs.

What do you need before you start?

Have these ready before you run any commands:

  • Claude Code installed and signed in: Run claude --version in your terminal. If you see a version number, Claude Code is installed, and you can sign in when you start your first session.
  • The server's URL or launch command: The provider's docs list one or the other. A launch command often looks like npx -y <package-name>.
  • Your credentials: Many hosted servers use OAuth, which means you sign in on the provider's own login page instead of pasting a key. Others ask for an API key or a bearer token, which is a secret string that proves you have access.
  • Any runtime a local server needs: Servers launched with npx need Node.js installed. The server's README lists anything else.

Decide which project the server belongs to, since that affects scope. Then check what the server can change. A server acts on your behalf in every service it reaches, and 91.8% of audited MCP servers lack OAuth, so read the provider's docs, see whether its tools only read data or also write it, and stick with providers you recognize.

How do you add an MCP server to Claude Code?

To add an MCP server to Claude Code, run claude mcp add with a name for the server and its URL or launch command. Add --transport http for remote servers and --scope to choose who can use it. Then start a session, run /mcp to sign in, and check the connection with claude mcp list.

The four steps below walk through that process in order.

Step 1. Choose a scope

Scope controls where a server is available: which projects can use it and whether your teammates see it too.

Scope Who can use it Where it's saved Good for
Local (default) Only you, in the current project Your user config file, tied to this project Your own database for one project
Project Everyone who works in the repo A .mcp.json file in the project root, committed to version control A team's shared issue tracker
User Only you, in every project Your user config file A tool you use everywhere, like a search server

Step 2. Run the add command

For a remote HTTP server, use this command:

claude mcp add --transport http <name> <url>

For a local stdio server, put the launch command after --:

claude mcp add <name> -- <command>

Everything after -- is the command Claude Code runs to start the server. Options go before the server name, and these three come up most:

  • --scope sets who can use it: For example, --scope project writes the server to .mcp.json so your team gets it too.
  • --env passes a secret to a local server: Use --env API_KEY=<value> so the key stays out of the launch command.
  • --header passes a token to a remote server: For example, --header "Authorization: Bearer <token>" sends a bearer token with every request.

If the provider gives you a JSON block instead, use claude mcp add-json <name> '<json>'. For project scope, you can also paste the server entry into .mcp.json under the mcpServers key. Config file names and keys differ by client, so match the format to the tool you're setting up.

Step 3. Sign in and approve access

Start a Claude Code session and run /mcp. Select the server and choose to authenticate, and the provider's sign-in page opens in your browser. Read each permission it asks for before you approve.

Claude Code stores the token and refreshes it for you. The first time a project-scoped server loads, Claude Code asks you to approve it, which protects you from a server someone else added to the repo.

Step 4. Verify the server and run a tool

Three commands show whether the setup worked. claude mcp list shows each server and whether it's connected, and claude mcp get <name> shows one server's full settings. Inside a session, /mcp lists the tools each server exposes.

Next, run a read-only test, like "Use the tracker server to list my open projects." Claude Code asks for approval before a new tool runs, and you can allow it once or for the rest of the session.

Security note: Keep API keys and tokens out of .mcp.json and any other file you commit, and use environment variables instead. Start with the narrowest permissions a server offers, and only approve write actions you expect.

How do you build an app with an MCP server?

The same steps work for an app builder's server. These servers give your AI tool actions inside an app, like creating pages, data, and logic. The Bubble MCP (beta) connects your AI tool to Bubble, a fully visual app builder, so anything it creates stays visible and editable in the Bubble editor.

Connect the Bubble MCP to Claude Code

To build a Bubble app from Claude Code, add the Bubble MCP with claude mcp add --transport http --scope user bubble https://mcp.bubble.io/mcp, as described in the Bubble Manual. Then run /mcp, select Bubble, sign in to your Bubble account in the browser, and confirm that its tools appear.

You need a Bubble account, and getting started is free. When you connect, you choose which app the tool can reach and which parts of it. From there, you can ask Claude to:

  • Look up records: Read data in your app's development or live database without opening the editor. For example, ask for the last five bookings. Claude can change development records, but live database records are read-only through the MCP.
  • Build and edit features: Describe a page or feature, and Claude can create the pages, data types, workflows, and logic for it, which you can inspect and edit visually afterward.
  • Clean up your app: Ask Claude to clear out workflows or data fields you no longer use, then review the logic and data structure yourself so the app stays easy to follow.
  • Work from a design or an existing app: Share a Figma file or screenshot to show the layout you want, or bring in an app built with an AI coding tool through universal import.

The Bubble MCP can check your app's server logs to help you debug a workflow, but it can't merge branches, deploy your app, set up OAuth2, or buy paid plugins yet. You'll handle those in the Bubble editor.

Add the same server to VS Code

Other AI code editors follow the same pattern with different menus. In VS Code, run MCP: Add Server or add the server to .vscode/mcp.json, then pick its tools in Copilot Chat agent mode. The Bubble Manual notes that Cursor doesn't yet support the CIMD (Client ID Metadata Documents) sign-in standard the Bubble MCP uses, so check the Manual for updates before you try Cursor.

Use this quick reference to find the setup spot in each tool:

Tool Where you add the server How you sign in How you check that it works
Claude Code claude mcp add or .mcp.json /mcp in a session claude mcp list or /mcp
VS Code MCP: Add Server or .vscode/mcp.json Browser prompt when the server starts Tools appear in Copilot Chat agent mode
Cursor Not currently supported for the Bubble MCP, since Cursor doesn't yet support CIMD N/A Check the Bubble Manual for updates
ChatGPT Bubble's plugin in ChatGPT Bubble sign-in when you connect Bubble actions are available in chat

Install Bubble's plugin in ChatGPT

In ChatGPT, you connect through Bubble's plugin in ChatGPT instead of a command. It takes three steps:

  1. Go to Plugins in ChatGPT and search for Bubble.
  2. Install the plugin and sign in to your Bubble account.
  3. Create a new app or pick an existing one.

ChatGPT can then read and edit your app's pages, workflows, data types, option sets, styles, and development records, subject to your Bubble permissions. It can read live database records but can't change them. It makes changes the same way the Bubble editor does.

Build your first feature and review it in the editor

Start with one small feature so you can check every change — 66% of developers spend more time fixing AI-generated code:

  1. Create a new app or connect an existing one.
  2. Ask for one data type and a page that lists it, like a simple booking list.
  3. Add one piece of logic: "When someone submits the form, create a booking and email the host."
  4. In Claude, ask for a preview link to see the app as it's built.

Then open the app in the Bubble editor. A workflow is the step-by-step logic behind an action in your app, and it reads as plain-language steps you can follow without code. Because the Agent and the visual editor work on the same app, you can change any part by hand or ask the Bubble AI Agent to adjust it. Depending on your plan, version control lets you roll back a change that didn't work out.

Coding agents connected to a codebase show their changes as code diffs, which suits you if you want to work directly in code. On Bubble, you review the app itself visually: the pages, workflows, data, and privacy rules are all there to inspect and change. For more on this approach, read how to build an app with AI.

Pro tip: Ask your AI tool to summarize what it changed after each request, then compare that summary with the workflows and data in the editor. It's a quick way to confirm that the change did exactly what you meant before you build on it.

How do you fix and secure your MCP setup?

Most MCP problems fall into a few patterns. Find the symptom you see below, then try the fix.

Fix a missing or failed server

  • Wrong directory: A local-scope server only appears in the project where you added it. Run claude mcp list from that folder to check.
  • Old session: Claude Code loads servers when a session starts, so a server you just added won't appear yet. Exit and restart Claude Code.
  • Local server won't start: The runtime may be missing or the path may be wrong. Run the launch command by itself in your terminal to see the error.
  • Windows and npx: On native Windows, local servers that use npx need a wrapper, like -- cmd /c npx -y <package>.

Fix sign-in and token errors

If a server shows as connected but returns "unauthorized" on every tool call, your token probably expired or was revoked. Open /mcp, clear authentication for that server, and sign in again.

For servers that use keys, look for a mistyped API key, a missing environment variable, or a header in the wrong format. claude mcp get <name> shows exactly what Claude Code is sending.

Fix missing tools and blocked permissions

If Claude never calls a tool, you may have denied it at an approval prompt, so review tool permissions in your Claude Code settings. Each server also adds tool definitions to Claude's context window, which is the amount of information Claude can hold at once. Tool search helps here by loading tools only when they're needed.

Very large tool results can get cut off. You can raise the limit with the MAX_MCP_OUTPUT_TOKENS environment variable.

Remove the server and revoke access

Run claude mcp remove <name>, adding --scope if you didn't use the default. Clear stored authentication in /mcp, then revoke the app's access in the provider's account settings so its permissions end too.

Watch for prompt injection, which is hidden instructions inside content a server returns. Be careful with servers that fetch untrusted web pages or documents, and read approval prompts before you accept them.

Build from Claude Code and review what changed

Adding an MCP server comes down to choosing a scope, running claude mcp add, signing in through /mcp, and checking the result with claude mcp list. Start with one server at local scope, run one read-only task, and expand permissions only after you've reviewed what it did.

If you want to build an app from Claude Code without giving up control, start building on Bubble, connect the Bubble MCP, and review every page, workflow, data type, and privacy rule visually in the editor.

Frequently asked questions

Can Claude Code connect to more than one MCP server at once?

Yes, Claude Code can load several MCP servers in one session. Each one adds tool definitions to the context, so keep only the servers your current project needs.

How do I move MCP servers from Claude Desktop to Claude Code?

Run claude mcp add-from-claude-desktop and pick the servers you want to bring over. It works on macOS and WSL, so check the Claude Code docs for other platforms.

What is the difference between an MCP server and a Claude Code plugin?

An MCP server gives Claude tools and data from an outside service, while a plugin is a package that can bundle MCP servers with skills, slash commands, and hooks. Installing a plugin can add a server for you, but you can also add servers on their own.

How do I add the Linear or Atlassian MCP server to Claude Code?

Run claude mcp add --transport http with the server URL from Linear's or Atlassian's documentation, then run /mcp to sign in with your account. Check each provider's current docs for its supported sign-in methods, since some servers also accept an API key or bearer token.

Does building a Bubble app through the Bubble MCP use AI credits?

During the Bubble MCP (beta), building through the MCP doesn't use Bubble AI credits. Usage runs through your own AI tool, such as Claude or ChatGPT, and that tool's rate limits may apply. You can still edit the resulting app visually in the Bubble editor at any time.

Start building with a free account

Build your app on Bubble's Free plan. No need to upgrade until you're ready to launch your app.

Join building

LATEST STORIES

A bar chart with ascending bars and an upward trend line, next to a sparkle icon on a dark blue background.

How to Make the Business Case for an AI App Builder

Learn how to build a business case for an AI app builder, then back it with a pilot that leadership and IT can approve.

Bubble
December 04, 2026 • 11 minute read
Six feature cards with checkmarks, showing icons for server, database, lock, globe, folder, and bar chart.

What Is an AI App Builder With Hosting and How to Choose One

Learn what an AI app builder with hosting includes, how popular tools compare, and what you’ll still need to set up before launch.

Bubble
December 04, 2026 • 10 minute read
Two app interface mockups connected by a workflow diagram showing a document, a user list, and a checkmark.

Build vs. Buy Software: What It Means and How to Choose

Use this build vs buy software framework to compare workflow fit, long-term cost, maintenance, and security, and to see the ways your team can replace SaaS with custom software.

Bubble
December 04, 2026 • 10 minute read
Blue shield with checkmark over app settings toggles, symbolizing no-code security and access controls.

No-Code Security: A Complete Builder's Guide for 2026

This guide covers the top security risks in no-code apps, the controls that address each one, and how to verify your app is secure before launch, after launch, and as it scales.

Bubble
November 29, 2026 • 21 minute read

How to Make the Business Case for an AI App Builder

December 04, 2026 • 11 minute read

What Is an AI App Builder With Hosting and How to Choose One

December 04, 2026 • 10 minute read

Build vs. Buy Software: What It Means and How to Choose

December 04, 2026 • 10 minute read

No-Code Security: A Complete Builder's Guide for 2026

November 29, 2026 • 21 minute read

How to Increase Push Notification Opt-In Rates: A 2026 Guide

November 24, 2026 • 11 minute read

Build the next big thing with Bubble

Start building for free