Architecture Overview

The request flow from user input to on-chain payment settlement.

๐Ÿ‘ค
User
Natural language
โ†’
๐Ÿ”
Detect
Category match
โ†’
๐Ÿ“‹
Discover
Registry lookup
โ†’
๐Ÿ›ก๏ธ
Filter
Policy engine
โ†’
๐Ÿ’ณ
Pay
USDC on Stellar
โ†’
โœ…
Result
+ tx proof

Tech Stack

The technologies powering Solva MCP.

TypeScript Model Context Protocol Stellar SDK x402 Protocol USDC (Circle) Soroban Node.js 20+ Zod Validation
๐Ÿ”

Category Detection

Keyword-based mapping from natural language tasks to service categories (news, search, summarize, weather). Extensible via the CATEGORY_KEYWORDS map.

๐Ÿ›ก๏ธ

Policy Engine

JSON-based rules that filter services by max price, min uptime, min payment history, and daily budget. Agents never spend beyond operator-defined limits.

๐Ÿ“ฆ

Service Registry

A JSON marketplace of x402 services with pricing, uptime stats, and payment history. Services are filtered and sorted by the policy engine before selection.

๐Ÿ’ณ

Payment Engine

Sends real USDC micropayments on Stellar testnet using Ed25519 signing. Supports both full x402 negotiation and direct Soroban transfers for mock services.

Project Structure

solva-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts โ† MCP server + tool registration
โ”‚   โ”œโ”€โ”€ helpers.ts โ† Category detection, filtering, mock results
โ”‚   โ”œโ”€โ”€ payment.ts โ† Direct Stellar USDC payment
โ”‚   โ””โ”€โ”€ stellar/ โ† Vendored x402 Stellar implementation
โ”‚       โ”œโ”€โ”€ constants.ts
โ”‚       โ”œโ”€โ”€ signer.ts
โ”‚       โ”œโ”€โ”€ shared.ts / utils.ts
โ”‚       โ””โ”€โ”€ exact/ โ† ExactStellarScheme
โ”œโ”€โ”€ registry.json โ† Service marketplace (4 services)
โ”œโ”€โ”€ policy.json โ† Agent spending rules
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ setup-trustline.ts โ† One-time USDC trustline setup
โ”œโ”€โ”€ landing/ โ† This website
โ””โ”€โ”€ package.json / tsconfig.json

Quick Integration

Add Solva to any MCP-compatible agent or IDE in seconds.

// Claude Code โ€” one command
claude mcp add solva npx tsx /path/to/solva-mcp/src/index.ts

// Cursor / VS Code / Windsurf โ€” MCP config
{
  "mcpServers": {
    "solva": {
      "command": "npx",
      "args": ["tsx", "/path/to/solva-mcp/src/index.ts"],
      "env": { "STELLAR_SECRET_KEY": "S..." }
    }
  }
}
๐Ÿ”Œ

Add a Category

Edit CATEGORY_KEYWORDS in helpers.ts and add a new service to registry.json. Solva will automatically route matching tasks.

โš™๏ธ

Customize Policy

Edit policy.json to adjust maxPriceUSDC, minUptimePct, minTotalPayments, and dailyBudgetUSDC for your use case.