MCP Claude: connect Claude Code to tools safely

Learn how MCP connects Claude Code to tools and data.

Scribble diagram showing a safe MCP Claude workflow: need, review, connect, authenticate, test, and approve.

Connect Claude through MCP safely

Define the need, review the server, connect with minimal scope, authenticate, test, and approve broader use from evidence.

  1. Need
  2. Review
  3. Connect
  4. Auth
  5. Test
  6. Approve

Better Design

On this page

Direct answer

MCP Claude means using the Model Context Protocol to connect Claude products, including Claude Code, to external tools and data. An MCP server can expose approved actions, resources, or prompts from systems such as issue trackers, monitoring, databases, and internal APIs.

MCP Claude quick setup

  1. Choose one narrow workflow and define the required read or write actions.
  2. Verify who operates the MCP server and inspect its documentation or code.
  3. Prefer remote HTTP for a cloud service or stdio for a trusted local process.
  4. Add the server at local scope for the first private project test.
  5. Authenticate through the documented OAuth flow when supported.
  6. Open /mcp and confirm the tools the server exposes.
  7. Test read-only work before allowing mutations.
  8. Review logs, output size, failures, revocation, and data handling before rollout.

A safe connection starts with a defined need. Assess the server, connect it with minimal scope, authenticate, examine its tools, test a bounded task, and approve broader use only after evidence.

Use the live Claude Code MCP guide for current commands, transports, scopes, authentication, and administration controls.

What does MCP add to Claude Code?

Without a connector, a developer may copy an issue, log, or database result into a prompt. An MCP server gives Claude Code a structured route to discover and call approved tools. The result can be fresher and more actionable, but the connection also expands access and risk.

Issue tracker
read a ticket and, with approval, update its status.
Monitoring
inspect an incident or error event with bounded access.
Source control
read repository state or prepare a pull-request action.
Database
query a safe dataset through a restricted interface.
Internal API
expose a narrow business operation with validation and audit logs.
Documentation
search maintained product or engineering knowledge.

Do not add a connector just to avoid a short copy-and-paste step. A new server adds software, permissions, credentials, tool descriptions, context use, and failure modes. The workflow should justify that operational cost.

Choose HTTP or stdio transport

Claude Code recommends HTTP for remote cloud services. A local stdio server runs as a process on the user's machine and can suit trusted scripts or tools that need direct local access. The older SSE transport is deprecated in the current guide.

HTTP
remote server reached through a URL, with OAuth or supported headers.
Stdio
local command launched by Claude Code with specified arguments and environment.
SSE
legacy remote transport; use HTTP where the server supports it.

Add a remote HTTP server

Use claude mcp add with the HTTP transport, a short server name, and the official endpoint. Put options before the name. Verify the endpoint with the service owner instead of copying an unverified command from a forum or package description.

  1. Read the provider's current Claude or MCP setup page.
  2. Verify the exact HTTPS endpoint and authentication method.
  3. Add the server at local scope for the pilot.
  4. Run /mcp inside Claude Code and complete authentication.
  5. Examine the advertised tools before sending a real request.

Add a local stdio server

For stdio, the double dash separates Claude Code options from the server command and its arguments. Check the executable, package source, install behavior, update path, environment access, filesystem permissions, and network activity before running it.

A local server is code running on your machine. A convenient package command can download and execute changing software. Pin reviewed versions where appropriate and use a controlled install process for team environments.

Pick the smallest MCP configuration scope

Scope controls where the server loads and whether configuration is shared. Start with local scope unless a real workflow requires broader access. Keep credential values out of project configuration and version control.

Local
private to you and the current project. It is the default for a manually added server.
Project
shared with the team through a root .mcp.json file and version control.
User
private to you but available across all projects.
Plugin
bundled with an enabled plugin and managed through that plugin.
Connector
supplied through the Claude product or directory integration.
Managed
deployed and restricted by organization administrators.

When names or endpoints overlap, higher-precedence definitions can win and duplicates can be skipped. Inspect /mcp in the actual project rather than assuming a global configuration is active.

Review project-scoped servers before approval

Project scope stores a shared MCP configuration file in the repository root. Claude Code asks for approval before using project-scoped servers. Review changes to command, arguments, URL, headers, and environment expansion as carefully as executable code.

  • The server owner and source are known.
  • The transport and endpoint match official documentation.
  • Commands and arguments do not include hidden shell behavior.
  • Environment references contain names, not committed secret values.
  • Requested permissions match the project workflow.
  • The team has a removal, revocation, and incident path.

Authenticate remote MCP servers safely

Claude Code supports OAuth for remote HTTP servers that require it. After adding the server, open /mcp and follow the browser flow. Confirm the application name, requested scopes, account, organization, and redirect before approval.

Use the MCP menu to clear authentication when access is no longer needed. Revoke the application at the provider when required. A removed local configuration does not necessarily revoke a remote authorization grant.

The MCP authorization guide explains the OAuth-based flow used to protect sensitive resources and operations.

Apply least privilege to every tool

Grant only the accounts, projects, records, and operations needed for the workflow. Prefer read-only access for exploration. Separate read and write tools when possible, and keep deletion, payment, deployment, user management, and production changes behind explicit approval.

  • Use a test workspace or sandbox for initial calls.
  • Limit OAuth scopes to the approved subset when supported.
  • Use service accounts with narrow roles instead of personal administrator access.
  • Keep credentials in an approved secret store or keychain.
  • Validate tool input on the server, not only in the model prompt.
  • Log actor, tool, target, result, and authorization decision.
  • Rate-limit expensive or sensitive operations.
  • Make high-impact changes reversible where possible.

Read the official MCP security best practices before exposing sensitive data or write actions.

Inspect tools and context cost

Run /mcp to see connected servers, tool counts, status, and authentication needs. Tool definitions and results consume context. Disable unused servers, return focused results, paginate large datasets, and avoid dumping raw logs or tables into a conversation.

Claude Code warns when a tool result exceeds the documented threshold and has a configurable output limit for tools without their own limit. Raising a limit can increase context use. Fix the server response shape before expanding it.

List, inspect, and remove MCP servers

  • List configured servers with claude mcp list.
  • Inspect one configuration with claude mcp get followed by its name.
  • Remove a server definition with claude mcp remove followed by its name.
  • Check status and authentication inside a session with /mcp.
  • Reset project-server approvals with claude mcp reset-project-choices.

Troubleshoot an MCP connection

  1. Confirm the server appears in claude mcp list.
  2. Inspect its resolved type, URL, command, arguments, and scope.
  3. Open /mcp and read the exact status or authentication message.
  4. Check required environment names without printing their secret values.
  5. Verify network access, endpoint certificates, process paths, and executable permissions.
  6. Run the server's documented health or local diagnostic step.
  7. Reduce the test to one read-only tool call.
  8. Remove or disable the server if behavior remains unexplained.

Authentication and not-found errors require configuration changes and are not automatically retried. A stdio spawn error often means the command is missing from the active PATH. Use a verified absolute executable path when the environment requires it.

Run a safe MCP pilot

  1. Choose one workflow with a named owner and measurable outcome.
  2. Review the server, provider, data path, scopes, and retention.
  3. Connect at local scope to a non-production account.
  4. Test discovery and one read-only request.
  5. Test malformed input, denial, timeout, revocation, and large output.
  6. Add one reversible write action behind explicit approval.
  7. Document setup, expected tools, logs, support, and removal.
  8. Move to project or managed scope only after security and user review.

Use Better Design's AI guardrails to define approval, data, audit, and escalation controls for connected agents.

In summary

MCP can replace pasted context with structured, current tool access in Claude Code. That convenience expands the system's authority. Start with one reviewed server, local scope, least privilege, read-only testing, visible approvals, and a documented revocation path.

Frequently asked questions