Architecture Overview
The request flow from user input to on-chain payment settlement.
Tech Stack
The technologies powering Solva MCP.
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
โโโ 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 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.