Enables automatic payment handling for tool usage via the Stellar blockchain, including wallet management, transaction processing, and automatic testnet funding.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AiAgentWalletMCPUse the premium weather tool to get the forecast for London"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AiAgentWalletMCP
An MCP (Model Context Protocol) server that enables AI agents to call paid tools from a marketplace with automatic Stellar blockchain payment handling.
What This Server Does
The Stellar Market MCP Server bridges AI agents with a marketplace of paid tools, managing:
Automatic Payment Processing: Automatically handles Stellar blockchain payments for tool usage using a persistent server wallet
Tool Marketplace Integration: Connects to a local marketplace backend to discover and call available paid tools
Wallet Management: Creates and manages a secure Stellar wallet stored locally, with automatic funding on Testnet
Payment Authorization: Implements the X-402 payment protocol for seamless tool access without manual payment coordination
This allows AI agents to call specialized tools (like weather data, data analysis, APIs) by simply requesting them through the MCP interface, with payments handled transparently.
Prerequisites
Node.js 18+ and npm
A running marketplace backend at
http://localhost:3000Internet connection (for Stellar Testnet funding and blockchain operations)
Local Setup
1. Clone Github Repo
2. Install Dependencies
3. Build the Project
This compiles TypeScript to JavaScript and creates an executable with proper permissions.
4. Configure Marketplace URL (Optional)
The server defaults to connecting to http://localhost:3000. To use a different marketplace:
Edit src/index.ts and update the MARKETPLACE_URL constant:
Then rebuild with npm run build.
5. Run the Server
The server will:
Create a Stellar wallet if one doesn't exist.
Automatically fund the wallet with test credits on Stellar Testnet
Start listening for MCP connections
6. Use in Your MCP Client
Configure your MCP client to connect to the server's stdio transport. The server provides a call_paid_tool tool that accepts:
tool: Name of the tool to callcategory: Tool categoryargs: Arguments to pass to the tool
MCP Client Configuration
Add the following to your MCP client configuration file (e.g., Claude Desktop config):
Update the path to match your installation location. After adding this configuration, restart your MCP client to enable the connection.
Project Structure
src/index.ts- Main server implementationbuild/index.js- Compiled server (generated after build)package.json- Dependencies and build configuration
How It Works
Wallet Creation: On first run, generates a Stellar keypair and stores it securely
Testnet Funding: Requests test credits from Stellar's Friendbot
Payment Wrapper: Uses X-402 payment protocol to handle payments for marketplace tools
Tool Calls: Routes tool requests to the marketplace backend, automatically paying the required amount