Enable AI agents to use your APIs with Model Context Protocol (MCP).
What is MCP?
Model Context Protocol (MCP) is an open standard that allows AI models to interact with external tools and APIs. Flux Gateway provides a native MCP server that handles payments and authentication automatically.
Current Status
✅ Available Now - The Flux MCP Server is ready to use!
The MCP server provides:
Automatic API discovery from Flux Gateway
Automated payment handling (ETH & USDC)
Wallet signature generation
Full MCP protocol compliance for Claude Desktop
Installation
From npm (Recommended)
npminstall-gflux-mcp-server
From Source
Quick Start
1. Initialize Configuration
This will prompt you for:
Your wallet private key (encrypted and stored securely)
Default blockchain (Base, Polygon, or Ethereum)
2. Add APIs
3. Start the Server
The server will:
Discover all configured APIs from Flux Gateway
Parse OpenAPI specifications
Convert endpoints to MCP tools
Start listening for Claude Desktop connections
Benefits for AI Agents
🤖 Discoverable - APIs are machine-readable via OpenAPI specs
💰 Pay-per-use - No subscriptions, just micropayments per request
🔐 Trustless - Blockchain-verified payments, no API keys needed
📊 Transparent - All transactions on-chain and auditable
Example: Building an MCP-Compatible Agent
Here's how an AI agent can integrate with Flux Gateway today:
# Clone the repository
git clone https://github.com/your-org/flux-gateway.git
cd flux-gateway/packages/mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Link globally
npm link
flux-mcp init
flux-mcp add-api --id abc123 --name "Weather API"
flux-mcp start
// Fetch available API
const response = await fetch(
'https://useflux.site/api/v2/apis/abc123/agent-info'
);
const apiInfo = await response.json();
console.log(apiInfo.capabilities); // List of endpoints with pricing
const message = `Flux API Authorization\n\nTransaction: ${tx.hash}\nService: ${endpointId}\n\nBy signing this message, you authorize Flux to use this payment for the specified API service.`;
const signature = await wallet.signMessage(message);