Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Claude Code MCP Check: Config, Connection, Tool Access

· 5 min read · Home Tech

In this article
  1. What Is MCP in Claude Code?
  2. How to Run the MCP Check
  3. Where Is the MCP Configuration Stored?
  4. Common Connection Problems and Fixes
  5. Verifying Tool Access
  6. Comparing MCP with Built-in Tools
  7. Safety and Permissions
  8. Frequently Asked Questions

To check your Model Context Protocol (MCP) configuration, connection, and tool access in Claude Code, use the /mcp slash command in the Claude Code CLI. This command lists all configured MCP servers, shows their connection status (connected or failed), and displays the tools each server exposes, letting you quickly diagnose and fix access issues.

What Is MCP in Claude Code?

MCP (Model Context Protocol) is an open standard that lets Claude Code connect to external tools and data sources. A typical setup involves a local or remote MCP server that exposes tools (like database queries or file operations) to Claude. Claude Code reads the MCP configuration, establishes a connection to each server, and then uses the tools during a session. Without a working connection, those tools simply won't appear in the list of available functions, so checking the configuration is the first step in troubleshooting.

How to Run the MCP Check

Open Claude Code in your terminal and type /mcp followed by Enter. The output shows each configured server name, its transport type (stdio or SSE/HTTP), and a status indicator. A green checkmark or the word “connected” means the server is reachable. A red X or “failed” means Claude Code couldn't establish a connection. The same interface also lists the tools that each server exposes, so you can confirm whether the expected tools are actually available.

If you need more detail, you can run /mcp with a server name (e.g., /mcp my-server) to see the full list of tools and any error messages for that specific server.

Where Is the MCP Configuration Stored?

Claude Code reads MCP server definitions from a configuration file named .mcp.json in your project root, or from a user-level configuration file. The project-level file takes precedence. A typical entry looks like this:

{
  "mcpServers": {
    "my-db": {
      "command": "npx",
      "args": ["-y", "@some/mcp-server"],
      "env": {
        "DATABASE_URL": "postgres://localhost:5432/mydb"
      }
    }
  }
}

For remote servers, you might see "url": "https://example.com/mcp" instead of command and args. If you’ve edited this file, you’ll need to restart Claude Code or run /mcp again to reload the configuration.

Common Connection Problems and Fixes

If a server fails to connect, the error message usually points to the cause. Here are the most common issues and how to resolve them:

  • Server not installed or missing dependency: The command in the config (e.g., npx -y @some/mcp-server) may fail if the package doesn’t exist or if Node.js isn’t installed. Try running the command manually in your terminal to see the error.
  • Environment variables not set: The env block in the config is used, but if the server needs an API key that isn’t provided, it may exit immediately. Double-check that all required keys are present.
  • Wrong transport type: If you’re using url but the server expects stdio (or vice versa), the connection will fail. Verify the server’s documentation for the correct transport.
  • Firewall or network restrictions: For remote servers, ensure the URL is reachable from your machine. A simple curl to the endpoint can confirm.
  • Server crashes on startup: Look at the stderr output from the server process. Claude Code usually shows this in the error message. Common causes include invalid JSON in the config or a missing script.

If the error isn’t clear, run the server command manually with the same environment variables to see the actual output.

Verifying Tool Access

Even if a server is connected, the tools it exposes might not be available to Claude. The /mcp output lists each tool by name. If a tool is missing, it’s usually because the server didn’t register it—check the server’s logs. Also, remember that Claude Code only allows tools that are explicitly exposed by the server; there’s no way to “force” a tool to appear if the server doesn’t provide it.

To test a tool, you can ask Claude to use it directly in a prompt, for example: “Use the query_database tool to list all tables.” If the tool is available, Claude will call it. If not, you’ll get an error saying the tool is not found.

Comparing MCP with Built-in Tools

Claude Code also has built-in tools like file reading and shell commands. MCP servers extend this with domain-specific capabilities. The key difference is that built-in tools are always available, while MCP tools require a separate server process and configuration. If you only need basic file operations, you don’t need MCP. But for connecting to a proprietary API or a database, MCP is the standard way to do it securely.

Safety and Permissions

MCP servers run with the same user permissions as Claude Code. Be cautious when configuring a server that has access to sensitive data or system commands. Always review the server’s code or documentation before adding it. Also, avoid putting secrets directly in .mcp.json; use environment variables or a secrets manager. Claude Code will not mask secrets in its output, so be careful not to log them.

Frequently Asked Questions

Why does my MCP server show “failed” even though it works when I run it manually?

This usually happens because the environment differs. Claude Code may not have the same PATH or environment variables as your shell. Try specifying the full path to the command in the config, or add the required environment variables in the env block.

How do I add a new MCP server?

Edit the .mcp.json file in your project root and add a new entry under mcpServers. Then restart Claude Code or run /mcp to reload. You can also use the claude mcp add command if available in your version.

Can I use MCP with remote servers over HTTP?

Yes, MCP supports HTTP/SSE transports. In the config, use "url": "https://example.com/mcp" instead of command. Ensure the server supports CORS if you’re calling from a browser-based client, but for CLI it’s usually fine.

Why don’t I see any tools in the /mcp output even though the server is connected?

This could mean the server didn’t advertise any tools. Check the server’s logs to see if it registered tools correctly. Also, some servers require you to call an initialization method before tools are exposed—make sure the server is fully started.

Is it safe to use MCP servers from untrusted sources?

No. An MCP server can execute arbitrary code on your machine. Only use servers from sources you trust, and review the code if possible. Consider running untrusted servers in a sandboxed environment.