@swig-wallet/mcp-server is an MCP (Model Context Protocol) server that gives AI agents the ability to create and manage Swig smart wallets on Solana. It can run locally over stdio or remotely over Streamable HTTP.
If you are setting this up for the first time, start with
Getting Started with Swig MCP.
Quick Start
Local (stdio)
Remote (HTTP)
Installation
The server is part of theswig-ts monorepo.
Build the full workspace:
dist/index.js.
Transport Modes
stdio (default)
In stdio mode, the server reads JSON-RPC messages from stdin and writes responses to stdout. This is the standard local MCP pattern, where the AI client launches the server as a subprocess.
Streamable HTTP (--http)
In HTTP mode, the server exposes the MCP Streamable HTTP transport. Each connecting client gets its own stateful session, which makes this mode appropriate for shared or hosted deployments.
Agent configuration examples:
Claude Code:
InitializeRequest to /mcp.
CLI Options
Environment Variables
Tools
The server exposes 13 tools across configuration, wallet management, and transaction execution. In a fresh session, callconfigure_rpc first.
Configuration
Wallet Management
For
add_authority, the newAuthorityPubkey format depends on authorityType:
ed25519anded25519Session: base58 public keysecp256k1: hex-encoded SEC1 public keysecp256r1: compressed hex-encoded P-256 public key
Transactions
Gas and Fee Handling
Configure one fee strategy before sending transactions.1. Swig Paymaster
The Swig Paymaster covers transaction fees. Callconfigure_paymaster with your API key and paymaster public key.
For broader Paymaster setup details, see Using Paymaster SDK.
2. Custom Gas Sponsor
Your own sponsor service signs and sponsors transactions. Callconfigure_gas_sponsor with the service URL.
The server sends a base64-encoded transaction to:
3. Self-Funded
The agent can pay fees from its own SOL balance. Callgenerate_agent_keypair or configure_agent_keypair, then fund that address with SOL.
Permissions Reference
When callingcreate_swig_wallet, add_authority, or update_authority, pass a permissions array where each object has a type field.
Example:
Deployment
Docker
Railway, Render, and Fly.io
Use this start command:PORT and SWIG_MCP_API_KEY in your deployment environment.
Production Checklist
- Require authentication with
--api-keyorSWIG_MCP_API_KEY - Put the server behind a reverse proxy with TLS termination
- Set
--cors-originto your specific domain instead of* - Use a dedicated RPC endpoint such as Helius, Triton, or QuickNode instead of the public Solana RPC
Architecture
@swig-wallet/classic internally. Wallet creation, authority management, and transaction signing are handled through @swig-wallet/classic and @swig-wallet/paymaster-classic.
License
AGPL-3.0-only
