Overview

Solva MCP is a Model Context Protocol server that gives AI agents the ability to discover services, evaluate them against policies, and pay with real USDC micropayments on Stellar — all from a single natural language command.

Built for: Stellar Hacks: Agents Hackathon 2026
Protocol: x402 — HTTP 402 micropayments on Stellar
Network: Stellar Testnet (real on-chain transactions)

How It Works

  1. User types a task in natural language (e.g. "find latest news about AI")
  2. Solva detects the service category from keywords
  3. Queries the registry and filters by the agent's spending policy
  4. Sends a USDC micropayment on Stellar testnet
  5. Returns the service response + verifiable transaction proof

Prerequisites

  • Node.js 20+ — Required runtime
  • Stellar testnet wallet — Funded with XLM and USDC
  • Claude Code (or any MCP-compatible client)

Installation

# Clone the repository
git clone https://github.com/raunet234/solva-mcp.git
cd solva-mcp

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env and add: STELLAR_SECRET_KEY=S...your_key...

Wallet Setup

1. Get Testnet XLM

Visit Stellar Friendbot to fund your wallet with testnet XLM.

2. Get Testnet USDC

Visit Circle Faucet, select Stellar Testnet, and paste your public key.

3. Setup USDC Trustline

npx tsx scripts/setup-trustline.ts
Note: You must establish a USDC trustline before receiving USDC on Stellar. Run the setup script once.

MCP Configuration

Claude Code

claude mcp add solva npx tsx /absolute/path/to/solva-mcp/src/index.ts -e STELLAR_SECRET_KEY=your_key

Cursor / VS Code / Windsurf

{
  "mcpServers": {
    "solva": {
      "command": "npx",
      "args": ["tsx", "/path/to/solva-mcp/src/index.ts"],
      "env": { "STELLAR_SECRET_KEY": "S..." }
    }
  }
}

Policy Engine

The policy engine controls how your agent spends money. Edit policy.json:

{
  "maxPriceUSDC": 0.005,    // Max per request
  "minUptimePct": 97.0,     // Min uptime %
  "minTotalPayments": 100,   // Min payment history
  "dailyBudgetUSDC": 2.0,    // Daily spending limit
  "allowExplorer": false      // Show tx links?
}

Service Registry

The registry contains all available services in the Solva marketplace.

ServiceCategoryPriceUptimePaymentsStatus
XLM News Wire📰 news$0.00299.2%1,400✓ Pass
DeepQuery Search🔎 search$0.00398.5%750✓ Pass
Brevity Summarizer📝 summarize$0.00197.8%180✓ Pass
SkyVault Weather🌤️ weather$0.00495.5%45✗ Fail
Why does SkyVault fail? Uptime 95.5% is below the 97% minimum, and 45 payments is below the 100 minimum. This demonstrates policy-based agent protection.

Using Solva

Simply type a task in natural language. Solva handles the rest.

# In Claude Code
> Call solva tool: find latest news about AI
> Call solva tool: summarize blockchain payment trends
> Call solva tool: research x402 protocol

Supported Categories

CategoryKeywords
📰 newsnews, article, latest, headline
🔎 searchsearch, find, research, look up
📝 summarizesummarize, summary, tldr, brief
🌤️ weatherweather, temperature, forecast, rain

Tasks that don't match any keyword default to search.

Output Format

Every response includes full payment transparency:

✓ Task: find latest news about AI
✓ Category: news
✓ Service: XLM News Wire
✓ Price: $0.002 USDC
✓ Transaction: 7c2ef38eff2ac7...
✓ Explorer: https://stellar.expert/...

Top stories:
1. "Stellar Network Hits 10M Daily Transactions"
2. "x402 Protocol Sees 300% Growth"
3. "Soroban Smart Contracts Power 40% of DeFi"

x402 Protocol

The x402 protocol enables machine-to-machine micropayments using HTTP 402:

  1. Agent sends GET /api/data to a service
  2. Service responds 402 Payment Required with price and address
  3. Agent signs and submits a USDC payment on Stellar
  4. Agent retries the request with payment proof in headers
  5. Service responds 200 OK with data
Key benefits: No API keys needed (payment IS auth), no subscriptions (pay per request), instant settlement (3-5s on Stellar), on-chain proof for every transaction.

Roadmap

Phase 1: Discovery & Payment ✅

  • Natural language category detection
  • Policy-based service filtering
  • Real USDC micropayments on Stellar testnet

Phase 2: Service Listing

  • solva_list_service tool for providers
  • Automated endpoint validation
  • Dynamic registry updates

Phase 3: Platform Economics

  • Smart contract for payment splitting
  • Daily budget tracking
  • Mainnet deployment

Phase 4: Open Marketplace

  • Decentralized registry on Soroban
  • Provider dashboard & analytics
  • Cross-chain support