Purpose
Stargate Bridge MCP is an MCP (Model Context Protocol) server designed to let users complete cross-chain token transfers through the Stargate protocol. It encapsulates on-chain bridging capabilities as MCP tools, making them easy to invoke in natural language within Claude, Cursor, or other MCP-compatible clients.
Main Capabilities
- Chain discovery: List all blockchains that support bridging and their key information.
- Token discovery: Find tokens that can be bridged between chains.
- Quote retrieval: Get real-time bridging quotes, including fees, estimates, and transaction steps.
- Automatic bridging: Use a private key to automatically sign and broadcast transfer transactions.
- MCP integration: Fully compliant with the MCP specification and easy to use in MCP clients such as Claude and Cursor.
Usage
Environment Requirements
- Use uv for dependency management (recommended; can fall back to pip).
- Requires a
.envfile containing an Ethereum-compatible private key (for example,PRIVATE_KEY=0x...). Never commit this file.
Installation Steps
- Clone the repository:
git clone https://github.com/kukapay/stargate-bridge-mcp.git cd stargate-bridge-mcp - Install dependencies with uv:
uv sync # 或 uv add requests web3 python-dotenv "mcp[cli]" - Install into Claude Desktop:
Configuration file reference:uv run mcp install main.py --name "Stargate Bridge"
Replace{ "mcpServers": { "Stargate Bridge": { "command": "uv", "args": ["--directory", "/path/to/stargate-bridge-mcp", "run", "main.py"], "env": { "PRIVATE_KEY": "your_private_key" } } } }/path/to/stargate-bridge-mcpwith the actual installation path, and replaceyour_private_keywith the wallet private key.
Tool Invocation Examples
The following examples simulate interactions in MCP clients such as Claude Desktop. Each example includes a natural language prompt, a tool call, and sample output.
-
List supported chains
- Prompt: "Show me all the chains supported by Stargate for bridging."
- Tool call:
list_chains() - Sample output: A Markdown table, sorted by chainKey.
-
List bridgeable tokens
- Prompt: "What tokens can I bridge USDC from Ethereum to other chains?"
- Tool call:
list_bridgeable_tokens("ethereum", "0xA0b86a33E641b9E649bEe6b2D5D7b5b4D8f3a0a")(USDC on Ethereum) - Sample output: A Markdown table, sorted by Chain Key.
-
Get bridging quotes
- Prompt: "Get quotes for bridging 10 USDC from Ethereum to Polygon with 1% slippage."
- Tool call:
get_quotes("ethereum", "polygon", "0xA0b86a33E641b9E649bEe6b2D5D7b5b4D8f3a0a", "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", 10.0, 9.9) - Sample output: Concise Markdown content.
-
Execute a bridge transfer
- Prompt: "Execute the bridge for 10 USDC from Ethereum to Polygon."
- Tool call:
bridge_transfer("ethereum", "polygon", "0xA0b86a33E641b9E649bEe6b2D5D7b5b4D8f3a0a", "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", 10.0, 9.9) - Sample output: Returns Markdown content on success.
- Note: If it fails (for example, insufficient gas), an error similar to
# Error\nStep 1 failed (reverted).will be returned.
Use Cases
- Users who need to transfer tokens across EVM-compatible chains (such as Ethereum, Polygon, and Arbitrum).
- Users who want to complete bridging operations in natural language through MCP clients (such as Claude and Cursor).
- Developers or users who need real-time bridging quotes, fees, and transaction steps.
Limitations
- Currently only supports cross-chain bridging between EVM-compatible chains (for example, Ethereum, Polygon, and Arbitrum).
- Non-EVM chains (such as Solana) are planned for future support.
- Requires an Ethereum-compatible private key, which poses security risks; keep the
.envfile secure.
License
MIT License - see the LICENSE file for details.