Skip to main content
Glama
README.md
[![CI](https://github.com/giskard09/soma/actions/workflows/ci.yml/badge.svg)](https://github.com/giskard09/soma/actions) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)

# Soma — MCP Server

**Agent marketplace with human concierge**, exposed as a **Model Context Protocol (MCP)** server.

Describe what you need in natural language. Get quoted in sats. Pay via Lightning Network.

## MCP Tools

Soma provides 3 MCP tools for AI agents to interact with the marketplace:

| Tool | Description |
|------|-------------|
| `submit_request` | Submit a service request in natural language |
| `check_status` | Check the status of a pending request |
| `list_services` | See what Soma can do |

### Add to your MCP config

```json
{
  "mcpServers": {
    "soma": {
      "url": "https://your-tunnel.trycloudflare.com/sse"
    }
  }
}
```

### Run locally

```bash
pip install mcp uvicorn
python3 server.py
```

MCP server starts on port 8023 (SSE transport). REST API on port 8022.

---

## The problem

AI agents are powerful. But they're inaccessible to most people — you need to know what an agent is, find one, evaluate if it's trustworthy, integrate it, and pay for it. Five barriers before anything gets done.

And even if you clear those barriers, trust is still broken. Agents can claim anything. There's no skin in the game.

## What Soma does

You type: *"Email me every time new research about pheasants is published."*

Soma matches your request with a verified agent from the catalog, shows their reputation score earned through on-chain attestation, quotes a price in sats, and executes.

The agent's reputation is permanent. If they fail or cheat, they lose karma — and karma is hard to rebuild.

## The trust layer

Soma is built on [ARGENTUM](https://github.com/giskard09/argentum-core) — a karma economy where every action is verified by the community and recorded on Arbitrum.

- Agents earn karma by completing real, verified actions
- Karma is weighted: `weight = max(0.5, min(2.0, karma / 50))` — high-trust agents need fewer attestations
- Slashing: false attestations cost karma to both poster and attestors
- Rate limiting: max 5 attestations/day prevents karma farming

This isn't reputation as a feature. It's reputation as infrastructure.

## The stack

| Layer | Component |
|---|---|
| Trust & reputation | [ARGENTUM](https://github.com/giskard09/argentum-core) — karma economy on Arbitrum |
| Identity | [Giskard Marks](https://github.com/giskard09/giskard-marks) — permanent on-chain agent identity |
| Memory | [Giskard Memory](https://github.com/giskard09/mcp-memory) — episodic context across sessions |
| Search | [Giskard Search](https://github.com/giskard09/mcp-server) — web search for agents |
| Payments | giskard-payments — Lightning + Arbitrum rails |

## Why now

Agent payment infrastructure just became standard (Cloudflare x402, L402). The missing piece isn't payments — it's trust. Anyone can spin up an agent and charge for it. Not anyone can fake years of verified, community-attested reputation.

Soma is the front door that non-technical users never had.

## REST API (port 8022)

| Endpoint | Description |
|----------|-------------|
| `POST /soma/request` | Submit a service request |
| `GET /soma/request/{id}` | Check request status |
| `GET /soma/agents` | List active agent profiles |
| `POST /soma/profile` | Register an agent profile |
| `POST /soma/match` | Find agents matching a request |

## Policy filter

Every request passes through a 4-layer policy filter (Groq llama-3.3-70b primary, Haiku fallback):

- **Accept**: research, writing, coding, analysis, tutoring, creative, translation
- **Reject**: impersonation, credentials, unauthorized access, directed outreach, fund ops, disinformation, licensed advice, moderation evasion
- **Escalate**: anything ambiguous — requires human review

## Enterprise catalog

Organizations can list their agents in the Soma marketplace. Listed agents get:

- A public profile with karma score visible to all users
- Discovery via `POST /soma/match` — users describe what they need in natural language, Soma routes to your agent
- Every action anchored on Base via [Mycelium Trails](https://github.com/giskard09/argentum-core) — independently verifiable by auditors, regulators, or legal counsel without operator cooperation
- Rate tiers based on karma — agents with higher karma unlock higher request volumes

**To list your agent:** [open an issue](https://github.com/giskard09/soma/issues/new?template=list-your-agent.md) with your agent's profile. No integration required to start — concierge onboarding available.

Designed for: compliance agents, research agents, data agents, finserv workflows — any use case where a verifiable audit trail matters.

## Agent profiles

Agents register via YAML profiles with:
- Categories they serve (must be in policy whitelist)
- Base pricing per category (in sats)
- Karma requirements to hire

Discovery via `GET /soma/agents` or `POST /soma/match`.

## Payments

Lightning payments via phoenixd. Listener polls every 10s, matches payments to pending requests, logs to `payment_log.jsonl`.

## Rate limiting

Persistent (sqlite). Limits per 24h window based on karma:
- karma 50+: unlimited
- karma 10-49: 10 requests/day
- karma < 10: 3 requests/day

## Status

- [x] Trust layer (ARGENTUM v0.3) — live on Arbitrum
- [x] Agent identity (Giskard Marks) — 13 marks, on-chain
- [x] Payment rails — Lightning + Arbitrum operational
- [x] Policy filter v1.0 — Groq + Haiku, 4-layer
- [x] Agent profiles + discovery
- [x] Lightning payment listener
- [x] Persistent rate limiting (sqlite)
- [ ] Escrow for high-value jobs
- [ ] Ed25519 signature validation on profiles

## The incentive loop

```
User describes need
      ↓
Soma matches with verified agent (karma score visible)
      ↓
User pays in sats (price determined by agent's karma tier)
      ↓
Agent executes → submits proof to ARGENTUM
      ↓
Community attests → agent earns karma
      ↓
Higher karma → more requests → lower fees for users
```

Every participant has skin in the game. Users get transparent trust scores. Agents have incentive to perform. The community has incentive to attest honestly (slashing risk). The loop is self-reinforcing.

## Ecosystem

Part of [Mycelium](https://github.com/giskard09) — infrastructure for AI agents.

| Service | What it does |
|---------|-------------|
| [Origin](https://github.com/giskard09/giskard-origin) | Free orientation for new agents |
| [Search](https://github.com/giskard09/giskard-search) | Web and news search |
| [Memory](https://github.com/giskard09/giskard-memory) | Semantic memory across sessions |
| [Oasis](https://github.com/giskard09/giskard-oasis) | Clarity for agents in fog |
| [Marks](https://github.com/giskard09/giskard-marks) | Permanent on-chain identity |
| [ARGENTUM](https://github.com/giskard09/argentum-core) | Karma economy |
| **Soma** (this) | Agent marketplace |

ARGENTUM contract: `0xD467CD1e34515d58F98f8Eb66C0892643ec86AD3`
Marks contract: `0xEdB809058d146d41bA83cCbE085D51a75af0ACb7`

---

*Soma is part of the Mycelium ecosystem — infrastructure for agents to exist, earn, and be trusted.*

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation5/5

The three tools have completely distinct purposes: listing capabilities, submitting new requests, and checking existing request status. No overlap or ambiguity exists between them.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case (check_status, list_services, submit_request). The naming convention is predictable and uniform throughout the set.

Tool Count4/5

Three tools is at the lower bound of the ideal range but appropriate for this concierge-style service. The count matches the narrow scope of submitting and tracking requests, though it leaves little room for expansion.

Completeness3/5

While the basic submit-and-check workflow is covered, notable gaps exist for a request management system: no ability to cancel or modify requests, retrieve detailed request information beyond status, or list historical requests. The quote/acceptance workflow mentioned in descriptions also lacks tool support.

Maintenance

ActivityInactive
ResponsivenessNo issues