> ## Documentation Index
> Fetch the complete documentation index at: https://docs.earthcare.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Claude Code

> Add the Earth Care Network MCP server to Claude Code with a single command.

[Claude Code](https://claude.com/claude-code) supports remote MCP servers over
HTTP. Add ECN with one command.

<Steps>
  <Step title="Add the server">
    ```bash theme={null}
    claude mcp add --transport http earth-care-network \
      https://api.earthcare.network/mcp/ \
      --header "Authorization: Bearer ecn_mcp_YOUR_KEY"
    ```
  </Step>

  <Step title="Confirm it connected">
    ```bash theme={null}
    claude mcp list
    ```

    You should see `earth-care-network` listed as connected.
  </Step>

  <Step title="Use it">
    Start a session and ask, for example:

    > Use Earth Care Network to find regenerative builders near Costa Rica.
  </Step>
</Steps>

## Project vs. user scope

By default the server is added to your user config. To share it with a project
(committed to the repo), add `--scope project`, which writes to `.mcp.json`:

```bash theme={null}
claude mcp add --transport http --scope project earth-care-network \
  https://api.earthcare.network/mcp/ \
  --header "Authorization: Bearer ecn_mcp_YOUR_KEY"
```

<Warning>
  Don't commit a real `ecn_mcp_…` key to a shared repo. Use an environment
  variable or your team's secret manager and reference it in the header.
</Warning>

## Remove it

```bash theme={null}
claude mcp remove earth-care-network
```

## Troubleshooting

* **`tools/list` works but `tools/call` returns Unauthorized** — your key is
  missing, revoked, or sent on the wrong header. Recreate it under
  **Settings → Connect external AI tools**.
* **No tools appear** — verify the endpoint with
  `curl -s https://api.earthcare.network/mcp/health/ | jq .tools`.
