Overview
The MCP server has three configuration tiers. Use the simplest one that does what you need.Tier 1: Zero Config
Reads all values from environment variables. Best for CLI usage and MCP client configurations (Claude Desktop, Cursor).GIZA_API_KEY, GIZA_PARTNER_NAME, GIZA_API_URL, CHAIN_ID, TRANSPORT, and PORT from the environment. See Environment Variables for the full list.
Tier 2: Explicit Config
Pass credentials and options directly. Environment variables fill any gaps.Tier 3: Full Control
Bring your ownGiza SDK instance, cherry-pick tools, and set a custom system prompt.
- Which tools are registered (cherry-pick by group)
- System prompt sent to the LLM
- SDK instance with custom timeouts, retries, etc.
- Server metadata (name, version)
Config Options Reference
All options forserve() and createGizaServer():
| Option | Type | Default | Description |
|---|---|---|---|
giza | Giza | — | Pre-built SDK instance (tier 3). Overrides chain, apiKey, partner, apiUrl. |
chain | number | CHAIN_ID env | Chain ID. Must be a supported chain from the Chain enum. |
apiKey | string | GIZA_API_KEY env | Partner API key. |
partner | string | GIZA_PARTNER_NAME env | Partner identifier. |
apiUrl | string | GIZA_API_URL env | Giza backend base URL. |
tools | ToolDefinition[] | All 22 tools | Which tools to register. Import groups from the package. |
systemPrompt | string | Built-in DeFi assistant prompt | Custom system prompt registered as an MCP prompt. |
name | string | 'giza-yield-server' | MCP server name reported to clients. |
version | string | '0.0.1' | MCP server version reported to clients. |
transport | 'stdio' | 'http' | TRANSPORT env or 'stdio' | Which transport to use. |
port | number | PORT env or 3000 | HTTP port (ignored for stdio). |
Config Resolution Order
For each field, the server resolves values in this order:- Explicit value passed in the config object
- Environment variable (see table below)
- Default value
| Config Field | Environment Variable | Default |
|---|---|---|
chain | CHAIN_ID | — (required) |
apiKey | GIZA_API_KEY | — (required) |
partner | GIZA_PARTNER_NAME | — (required) |
apiUrl | GIZA_API_URL | — (required) |
transport | TRANSPORT | 'stdio' |
port | PORT | 3000 |
Validation
The configuration is validated with Zod at startup. If validation fails, the server throws immediately with a descriptive error. Validated constraints:chainmust be a supported chain ID from theChainenumapiKeyandpartnermust be non-empty stringsapiUrlmust be a valid URLtransportmust be'stdio'or'http'portmust be an integer between 1 and 65535