Skip to main content
The Swig MCP server exposes wallet creation, RPC configuration, authority management, and transaction execution tools to MCP-compatible AI agents.
This page covers the dedicated Swig wallet MCP server built from @swig-wallet/mcp-server. If you want to expose the Swig docs themselves as an MCP server, see Swig Docs MCP Support.

Prerequisites

Before you begin, make sure you have:
  • Access to the swig-ts monorepo
  • bun installed
  • An MCP-compatible client such as Claude Code
  • SOL on your chosen network to fund wallet creation

Step 1: Build the server

Build the MCP server from the swig-ts monorepo:
This produces the compiled server entrypoint at packages/mcp-server/dist/index.js.

Step 2: Configure the MCP client

Add the server to your AI agent:
Use the local stdio option when running the built server on the same machine as your MCP client. Use the HTTP transport when you are hosting the server remotely.

Step 3: Configure RPC

After the MCP server is connected, call configure_rpc with the Solana cluster you want the agent to use:
  • Mainnet: https://api.mainnet-beta.solana.com
  • Devnet: https://api.devnet.solana.com
You can also configure a custom RPC of your choice. You can call configure_rpc again later if you need to switch networks.

Step 4: Set up the agent keypair

Call generate_agent_keypair to create a new keypair, or configure_agent_keypair to load an existing one. Fund this address with SOL. The agent keypair pays the rent required to create the Swig wallet on-chain.

Step 5: Create a Swig wallet

Call create_swig_wallet to create the wallet. This creates two related addresses:
  • A Swig account: the on-chain config account that stores roles and authorities
  • A wallet address: the PDA that holds funds and executes instructions
The agent keypair is the root authority by default and starts with full permissions.

Step 6: Use the wallet

Once the wallet exists, these are the primary tools you will use: For a first-time setup, the usual sequence is:
  1. Build and connect the MCP server
  2. Call configure_rpc
  3. Call generate_agent_keypair or configure_agent_keypair
  4. Fund the agent keypair with SOL
  5. Call create_swig_wallet
  6. Use fetch_swig_wallet and get_balance to verify the wallet before sending transactions

Next Steps

Once you have the server running, use Swig MCP Server for:
  • Transport and endpoint details
  • CLI flags and environment variables
  • Full tool list
  • Gas sponsorship options
  • Permissions and deployment guidance