> For the complete documentation index, see [llms.txt](https://andrewkimjoseph.gitbook.io/celina-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andrewkimjoseph.gitbook.io/celina-sdk/guides/mcp-session-wallet.md).

# MCP session wallet

This guide applies to [**celina-mcp**](https://www.npmjs.com/package/@andrewkimjoseph/celina-mcp) when you run it locally with `CELO_PRIVATE_KEY` in the MCP server `env`. It does **not** apply to browser apps that use this SDK directly.

## SDK vs MCP vs hosted

| Runtime                                   | Who is “the user”?       | How the wallet is known                                                                               |
| ----------------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------- |
| **celina-sdk** / `surface: "browser"`     | Connected browser wallet | You pass `0x…` on every read/prepare (e.g. wagmi `useAccount()`); no `get_wallet_address`             |
| **celina-mcp** stdio + `CELO_PRIVATE_KEY` | MCP server signer        | Omit `address` / `wallet_address` / `from` on wallet-scoped tools; they default to the configured key |
| **Hosted MCP** (`mcp.usecelina.xyz`)      | N/A (no server key)      | Pass explicit addresses on every wallet-scoped tool; key-dependent tools fail without local keys      |

Browser agent hosts use the same tool catalog with `surface: "browser"` — see [Tool catalog](/celina-sdk/guides/tool-catalog.md). They do not run celina-mcp and do not use `get_wallet_address`.

## `get_wallet_address`

Read-only MCP tool with **no parameters**. Returns:

```json
{
  "wallet_address": "0x…",
  "has_wallet": true,
  "source": "CELO_PRIVATE_KEY"
}
```

Call it when the agent needs the signer address as **data** (logging, comparisons, copy-paste). For everyday “my balances”, omit address fields instead.

Fails with a clear error when `CELO_PRIVATE_KEY` is not set (hosted endpoint or read-only stdio).

## Omit address on wallet-scoped tools

When `CELO_PRIVATE_KEY` is configured, these parameters are **optional** and default to the signer:

| Parameter     | Example tools                                                                                                                          |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `address`     | `get_account`, `get_celo_balances`, `get_stablecoin_balances`, `get_token_balance`, staking reads, GoodDollar reads, `get_nft_balance` |
| `from`        | `estimate_transaction`                                                                                                                 |
| `fromAddress` | `call_contract_function`, `estimate_contract_gas`                                                                                      |

Pass an explicit value to query a **different** wallet.

## Agent rules

* Never derive addresses from shell commands or read `.env`.
* Do not call `get_wallet_address` on every turn unless you need the string; prefer omitted params for “my” operations.
* On hosted MCP (no key), always pass explicit `address` / `wallet_address`.

## Related

* [Architecture](/celina-sdk/concepts/architecture.md) — Celina stack
* [celina-mcp README](https://github.com/andrewkimjoseph/celina-mcp#session-wallet-local-stdio) — MCP setup and tool table


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://andrewkimjoseph.gitbook.io/celina-sdk/guides/mcp-session-wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
