What is the MCP Server?
@gizatech/mcp-server exposes the Giza Agent SDK as tools that any LLM can call through the Model Context Protocol (MCP). Instead of writing TypeScript to interact with the SDK, an LLM like Claude or GPT calls tools directly — creating smart accounts, activating agents, checking portfolios, and running optimizations through natural language.
The server ships as both a library (import and customize in your own code) and a CLI (run directly via npx).
Architecture
The MCP server sits between the LLM client and the Giza SDK. It:- Receives tool calls from the LLM over stdio or HTTP transport
- Validates inputs using Zod schemas
- Delegates to the Giza SDK
- Returns structured results the LLM can interpret and present to the user
Supported Clients
The MCP server works with any client that implements the Model Context Protocol:| Client | Transport | Setup |
|---|---|---|
| Claude Desktop | stdio | Quickstart |
| Cursor | stdio | Quickstart |
| Claude Code | stdio | Quickstart |
| Custom backend | HTTP | Transport |
| Any MCP client | stdio or HTTP | Programmatic Usage |
How It Works
Wallet Session Model
The MCP server uses a connect-then-operate pattern. Before calling any agent-specific tool (portfolio, lifecycle, financial), the LLM must first connect a wallet address to the session:Error Handling
All tool errors are caught and converted to messages the LLM can work with. No raw stack traces — just actionable text like:"No wallet connected. Use connect_wallet first to set your wallet address for this session.""Validation error: Invalid Ethereum address""Request timed out. Please try again."
connect_wallet when it gets a wallet-not-connected error).
What’s Included
The server registers 22 tools across 8 groups:| Group | Tools | Wallet Required |
|---|---|---|
| Wallet | connect_wallet, disconnect_wallet | No |
| Account | create_smart_account, get_smart_account | No |
| Protocol | get_protocols, get_tokens, get_stats, get_tvl | No |
| Lifecycle | activate_agent, deactivate_agent, top_up, run_agent | Yes |
| Portfolio | get_portfolio, get_performance, get_apr, get_deposits | Yes |
| Financial | withdraw, get_withdrawal_status, get_transactions, get_fees | Yes |
| Rewards | claim_rewards | Yes |
| Optimizer | optimize | No |