Skip to main content

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).
import { serve } from '@gizatech/mcp-server';

serve();
The server reads 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.
import { serve } from '@gizatech/mcp-server';

serve({
  chain: 8453,
  apiKey: 'your-api-key',
  partner: 'your-partner-name',
  apiUrl: 'https://api.giza.tech',
  transport: 'http',
  port: 3001,
});
You can also mix explicit values with env vars — any field you omit falls back to the corresponding environment variable.

Tier 3: Full Control

Bring your own Giza SDK instance, cherry-pick tools, and set a custom system prompt.
import { Giza, Chain } from '@gizatech/agent-sdk';
import {
  createGizaServer,
  portfolioTools,
  lifecycleTools,
  protocolTools,
} from '@gizatech/mcp-server';

const giza = new Giza({
  chain: Chain.BASE,
  apiKey: 'your-api-key',
  partner: 'your-partner-name',
  apiUrl: 'https://api.giza.tech',
});

const server = createGizaServer({
  giza,
  tools: [...portfolioTools, ...lifecycleTools, ...protocolTools],
  systemPrompt: 'You are a savings assistant. Help users monitor their yield.',
  name: 'my-custom-server',
  version: '1.0.0',
});

await server.stdio();
This tier gives you full control over:
  • 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 for serve() and createGizaServer():
OptionTypeDefaultDescription
gizaGizaPre-built SDK instance (tier 3). Overrides chain, apiKey, partner, apiUrl.
chainnumberCHAIN_ID envChain ID. Must be a supported chain from the Chain enum.
apiKeystringGIZA_API_KEY envPartner API key.
partnerstringGIZA_PARTNER_NAME envPartner identifier.
apiUrlstringGIZA_API_URL envGiza backend base URL.
toolsToolDefinition[]All 22 toolsWhich tools to register. Import groups from the package.
systemPromptstringBuilt-in DeFi assistant promptCustom system prompt registered as an MCP prompt.
namestring'giza-yield-server'MCP server name reported to clients.
versionstring'0.0.1'MCP server version reported to clients.
transport'stdio' | 'http'TRANSPORT env or 'stdio'Which transport to use.
portnumberPORT env or 3000HTTP port (ignored for stdio).

Config Resolution Order

For each field, the server resolves values in this order:
  1. Explicit value passed in the config object
  2. Environment variable (see table below)
  3. Default value
Config FieldEnvironment VariableDefault
chainCHAIN_ID— (required)
apiKeyGIZA_API_KEY— (required)
partnerGIZA_PARTNER_NAME— (required)
apiUrlGIZA_API_URL— (required)
transportTRANSPORT'stdio'
portPORT3000

Validation

The configuration is validated with Zod at startup. If validation fails, the server throws immediately with a descriptive error. Validated constraints:
  • chain must be a supported chain ID from the Chain enum
  • apiKey and partner must be non-empty strings
  • apiUrl must be a valid URL
  • transport must be 'stdio' or 'http'
  • port must be an integer between 1 and 65535

Next Steps