claude --version: 2.1.330 (Claude Code)

$ claude mcp add --scope project --transport stdio gitea --env GITEA_HOST=https://ankurm.com/git.app --env GITEA_ACCESS_TOKEN=${GITEA_TOKEN} -- gitea-mcp -t stdio
Added stdio MCP server gitea with command: gitea-mcp -t stdio to project config
File modified: <tmp>/project/.mcp.json

$ claude mcp add --scope project --transport stdio db -- npx -y @bytebase/dbhub@2.1.0 --transport stdio --dsn ${DB_URL}
Added stdio MCP server db with command: npx -y @bytebase/dbhub@2.1.0 --transport stdio --dsn ${DB_URL} to project config
File modified: <tmp>/project/.mcp.json

$ cat .mcp.json
{
  "mcpServers": {
    "gitea": {
      "type": "stdio",
      "command": "gitea-mcp",
      "args": [
        "-t",
        "stdio"
      ],
      "env": {
        "GITEA_HOST": "https://ankurm.com/git.app",
        "GITEA_ACCESS_TOKEN": "${GITEA_TOKEN}"
      }
    },
    "db": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub@2.1.0",
        "--transport",
        "stdio",
        "--dsn",
        "${DB_URL}"
      ],
      "env": {}
    }
  }
}

committed .mcp.json identical to the generated one: yes

$ claude mcp list     (GITEA_TOKEN and DB_URL unset)
Checking MCP server health…
gitea: gitea-mcp -t stdio - ⏸ Pending approval (run `claude` to approve)
db: npx -y @bytebase/dbhub@2.1.0 --transport stdio --dsn ${DB_URL} - ⏸ Pending approval (run `claude` to approve)
MCP config diagnostics ‼
For help configuring MCP servers, see: https://code.claude.com/docs/en/mcp
[Has warnings] Project config (shared via .mcp.json)
Location: <tmp>/project/.mcp.json
 ├ [Warning] [gitea] mcpServers.gitea: Missing environment variables: GITEA_TOKEN
 └ [Warning] [db] mcpServers.db: Missing environment variables: DB_URL

$ claude mcp get gitea
gitea:
  Scope: Project config (shared via .mcp.json)
  Status: ⏸ Pending approval (run `claude` to approve)
  Type: stdio
  Command: gitea-mcp
  Args: -t stdio
  Environment:
    GITEA_HOST=https://ankurm.com/git.app
    GITEA_ACCESS_TOKEN=${GITEA_TOKEN}
To remove this server, run: claude mcp remove gitea -s project

$ GITEA_TOKEN=x DB_URL=x claude mcp list
Checking MCP server health…
gitea: gitea-mcp -t stdio - ⏸ Pending approval (run `claude` to approve)
db: npx -y @bytebase/dbhub@2.1.0 --transport stdio --dsn ${DB_URL} - ⏸ Pending approval (run `claude` to approve)

--- a hand-written entry that has a url but no "type"
$ claude mcp list
No MCP servers configured. Use `claude mcp add` to add a server.
MCP config diagnostics ‼
For help configuring MCP servers, see: https://code.claude.com/docs/en/mcp
[Has warnings] Project config (shared via .mcp.json)
Location: <tmp>/bad/.mcp.json
 └ [Warning] [remote] mcpServers.remote: Skipped — MCP server "remote" has a "url" but no "type"; add "type": "http" (or "sse" / "ws") to this entry

--- scope precedence: the same server name in user and local scope
Added HTTP MCP server docs with URL: https://user-scope.invalid/mcp to user config
Added HTTP MCP server docs with URL: https://local-scope.invalid/mcp to local config
$ claude mcp get docs   (Scope and URL lines only)
  Scope: Local config (private to you in this project)
  URL: https://local-scope.invalid/mcp
