MCP Integration

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

npm install -g flux-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:

Step 1: Discover APIs

Step 2: Make Payment

Step 3: Sign Authorization

Step 4: Call API

Claude Desktop Setup

To use Flux APIs with Claude Desktop:

1. Install Claude Desktop

Download from claude.ai/desktoparrow-up-right

2. Configure MCP Server

Edit your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the Flux MCP server:

3. Restart Claude Desktop

The Flux MCP server will now be available to Claude!

Features

Automatic API Discovery - Fetches OpenAPI specs from Flux Gateway ✅ Payment Automation - Handles ETH & USDC payments on multiple chains ✅ Signature Generation - Signs authorization messages automatically ✅ Error Handling - Retries and clear error messages ✅ Secure Storage - AES-256 encrypted private key storage ✅ Multi-chain - Supports Base, Polygon, Ethereum + testnets

Security Best Practices

  1. Secure wallet management - Private keys are encrypted with AES-256

  2. Monitor spending - Check transaction history regularly

  3. Use testnets first - Test on Base Sepolia or Polygon Amoy before mainnet

  4. Separate wallets - Use a dedicated wallet for MCP, not your main wallet

  5. Set permissions - Config file is automatically set to owner-only (chmod 600)

Future Enhancements

Planned features for future releases:

  • Session management - Reuse payments across multiple requests

  • Request batching - Bundle multiple API calls into one payment

  • Response caching - Avoid redundant API calls

  • Spending limits - Set daily/weekly spending caps

  • Python SDK - flux-mcp package for Python-based agents

  • Web UI - Browser-based configuration and monitoring

Next Steps

Last updated