Overview
The MCP (Model Context Protocol) server provides a standardized interface for AI agents to interact with the Agentic Wallet platform. It exposes curated tools and a generic gateway proxy for schema-validated API access. Port:3008 (default)
Architecture
The MCP server acts as a tool invocation layer between AI agents and the API Gateway.Endpoints
List Tools
Get all available MCP tools with descriptions.Call Tool
Invoke a specific MCP tool with arguments.Available Tools
The MCP server provides 70+ curated tools across all platform capabilities.Wallet Tools
Wallet Operations (7 tools)
Wallet Operations (7 tools)
| Tool | Description | Required Args |
|---|---|---|
wallet.create | Create a wallet | label? |
wallet.list | List wallets | publicKey? |
wallet.get | Get wallet metadata | walletId |
wallet.balance | Get wallet SOL balance | walletId |
wallet.tokens | Get wallet SPL balances | walletId |
wallet.sign_message | Sign a base64 message | walletId, message |
wallet.sign_transaction | Sign a base64 transaction | walletId, transaction |
Transaction Tools
Transaction Operations (10 tools)
Transaction Operations (10 tools)
| Tool | Description | Required Args |
|---|---|---|
tx.create | Create a transaction from intent | walletId, type, protocol, intent |
tx.get | Fetch transaction by id | txId |
tx.retry | Retry a transaction | txId |
tx.approve | Approve approval-gated transaction | txId |
tx.reject | Reject approval-gated transaction | txId |
tx.proof | Get execution proof | txId |
tx.replay | Get deterministic replay data | txId |
tx.list_by_wallet | List wallet transactions | walletId |
tx.pending_approvals | List pending approvals | walletId |
tx.positions | List protocol positions | walletId |
tx.escrows | List escrow records | walletId |
Policy Tools
Policy Operations (5 tools)
Policy Operations (5 tools)
| Tool | Description | Required Args |
|---|---|---|
policy.create | Create a policy | walletId, name, rules, active |
policy.list_wallet | List policies for wallet | walletId |
policy.compatibility_check | Check rule compatibility | rules |
policy.migrate | Migrate policy version | policyId, targetVersion |
policy.evaluate | Evaluate policy decision | walletId, type, protocol |
Agent Tools
Agent Operations (11 tools)
Agent Operations (11 tools)
| Tool | Description | Required Args |
|---|---|---|
agent.create | Create an agent | name, executionMode, allowedIntents |
agent.list | List agents | - |
agent.get | Get agent details | agentId |
agent.capabilities_update | Update agent capabilities | agentId, allowedIntents |
agent.start | Start agent scheduler | agentId |
agent.stop | Stop agent scheduler | agentId |
agent.pause | Pause an agent | agentId, reason? |
agent.resume | Resume an agent | agentId |
agent.budget | Get agent budget status | agentId |
agent.manifest_issue | Issue capability manifest | agentId, allowedIntents, allowedProtocols |
agent.manifest_verify | Verify capability manifest | agentId, manifest |
agent.execute | Execute intent as agent | agentId, type, protocol, intent |
Protocol Tools
Protocol Operations (15 tools)
Protocol Operations (15 tools)
| Tool | Description | Required Args |
|---|---|---|
protocol.list | List available protocols | - |
protocol.capabilities | Get protocol capabilities | protocol |
protocol.health_all | Get health for all protocols | - |
protocol.health | Get health for a protocol | protocol |
protocol.quote | Fetch swap quote | protocol, inputMint, outputMint, amount, walletAddress |
protocol.swap | Build swap transaction | Same as quote |
protocol.stake | Build staking transaction | protocol, walletAddress, amount |
protocol.unstake | Build unstake transaction | Same as stake |
protocol.lend_supply | Build lending supply | protocol, walletAddress, mint, amount |
protocol.lend_borrow | Build lending borrow | Same as supply |
protocol.escrow_create | Build create escrow | walletAddress, intent |
protocol.escrow_accept | Build accept escrow | escrowId, walletAddress |
protocol.escrow_release | Build release escrow | Same as accept |
protocol.escrow_refund | Build refund escrow | Same as accept |
protocol.escrow_dispute | Build dispute escrow | Same as accept |
protocol.escrow_resolve | Build resolve escrow | Same as accept |
Risk Tools
Risk & Chaos Operations (8 tools)
Risk & Chaos Operations (8 tools)
| Tool | Description | Required Args |
|---|---|---|
risk.list_protocols | List protocol risk configs | - |
risk.get_protocol | Get protocol risk config | protocol |
risk.set_protocol | Update protocol risk config | protocol, config fields |
risk.list_portfolio | List portfolio risk controls | - |
risk.get_portfolio | Get wallet portfolio controls | walletId |
risk.set_portfolio | Update portfolio controls | walletId, control fields |
risk.get_chaos | Get chaos switchboard settings | - |
risk.set_chaos | Update chaos settings | enabled?, failureRates?, latencyMs? |
Strategy & Treasury Tools
Strategy & Treasury Operations (5 tools)
Strategy & Treasury Operations (5 tools)
| Tool | Description | Required Args |
|---|---|---|
strategy.backtest | Run strategy backtest | walletId, name, steps |
strategy.paper_execute | Execute paper trade | agentId, walletId, type, protocol, intent |
strategy.paper_list | List paper trades | agentId |
treasury.allocate | Allocate treasury budget | targetAgentId, lamports |
treasury.rebalance | Rebalance treasury | sourceAgentId, targetAgentId, lamports |
Audit Tools
Audit & Metrics (2 tools)
Audit & Metrics (2 tools)
| Tool | Description | Required Args |
|---|---|---|
audit.events | List audit events | filters (all optional) |
audit.metrics | Get metrics snapshot | - |
Gateway Request Tool
Thegateway.request tool provides schema-validated access to any /api/v1 endpoint.
Usage
Request Format
Schema Validation
The tool validates:pathmust match/^/api/v1/[a-zA-Z0-9/_:-]*$/methodmust be valid HTTP methodquerymust be record of string/number/booleanbodymust be valid JSON object
Examples
Error Handling
MCP tools return normalized error responses.Input Validation Errors
Invalid Tool
Missing Required Argument
Invalid Schema
Gateway Errors
When the underlying gateway request fails:Gateway Error
Authentication
The MCP server uses environment-configured credentials to authenticate with the API Gateway.Environment Configuration
x-api-key: FromAPI_KEYenv varx-tenant-id: FromTENANT_IDenv var (if set)content-type:application/json
Health Check
Using the SDK
The TypeScript SDK includes an MCP client for tool invocation.SDK MCP Client
Integration Patterns
AI Agent Tool Use
Agent Integration
Orchestrator Pattern
Workflow Orchestration
Tool Discovery
Agents can dynamically discover available tools at runtime.Dynamic Tool Discovery
Best Practices
Use typed tools over gateway.request
Use typed tools over gateway.request
Prefer named tools like
wallet.create instead of gateway.request for better type safety and validation.Handle errors gracefully
Handle errors gracefully
Always wrap MCP calls in try-catch and parse error messages for structured error codes and stages.
Cache tool list
Cache tool list
Call
mcp.tools() once at startup and cache the result rather than fetching on every operation.Validate arguments
Validate arguments
Validate tool arguments client-side before calling to reduce round-trips and error noise.
Next Steps
CLI Integration
Use the command-line interface
SDK Integration
Integrate with TypeScript SDK
SKILLS Contract
Review agent integration contract
API Reference
Explore REST API endpoints