Skip to content

Audit MCP server OAuth scopes, API token handling, and credential storage hygiene

Many community MCP connectors ask for full repo admin or Gmail read/write/delete scopes when your workflow only needs read access.

Copy the prompt and paste it into the AI assistant you already use.

Scope and credential audits reflect tested server versions; always verify OAuth consent screens against your internal IAM policies.

Credential and OAuth checks before approving an MCP server

  1. 01

    Compare requested OAuth scopes against enabled tools

    Reject calendar or email MCPs demanding full mail.modify/delete scopes when your team only summarizes incoming threads.

  2. 02

    Eliminate plaintext API keys in shared config files

    Prefer setups injecting secrets via 1Password CLI (op run), macOS Keychain, or short-lived OAuth tokens over raw mcp.json strings.

  3. 03

    Verify environment variable isolation on stdio child processes

    Check whether the MCP client passes your entire shell environment (AWS_SECRET_ACCESS_KEY) down to untrusted npx servers.

  4. 04

    Audit remote MCP token passthrough rules

    Ensure remote Streamable HTTP MCP servers comply with MCP OAuth specs and never log bearer tokens in debug traces.

How it works in practice

MCP permission comparison

Compare 3 Google Drive / Workspace MCP connectors for read-only doc search deployment.

Scope & secret audit

gdrive-readonly-mcp: requests drive.readonly scope only, supports PKCE + OS keychain, 0 token logs. workspace-all-in-one-mcp: requests full drive + gmail.modify + admin scopes on install, stores refresh_token in world-readable ~/.mcp-auth.json (0644).

Checking exact OAuth scopes and file permissions (0600 vs 0644) prevents turning a doc-search helper into a full-account blast radius.

Questions and answers

Why is running 'npx -y some-mcp-server' with env secrets risky?

Unpinned npx downloads execute fresh npm code every session with full access to passed environment variables and local disk permissions.

Do SkillMarket listings show exact required OAuth scopes?

Yes, security cards enumerate required scopes, environment variables, network destinations, and filesystem paths touched.

What is the safest way to pass credentials to local MCP servers?

Pin exact package digests, restrict inherited environment variables, use fine-grained read-only tokens, and wrap secrets with secret-manager CLIs.