Skip to content

About

Autonomous Business Hackathon starter kits and resources

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

85 Commits

Folders and files

Repository files navigation

Nevermined AI Agent Examples

Working examples of AI agents with Nevermined payment integration. Each agent demonstrates a different protocol (x402, A2A, MCP) and can be run locally with a few commands.

Quick Start

Prerequisites

  • Python 3.10+
  • Poetry for dependency management
  • Nevermined App account (API key + payment plan)
  • OpenAI API key (or other LLM provider)

Environment Setup

Each agent has its own .env.example. Copy and fill it in:

cd agents/<agent-name>
cp .env.example .env
# Edit .env with your credentials

Key variables:

NVM_API_KEY=sandbox:your-api-key       # From https://nevermined.app > API Keys
NVM_ENVIRONMENT=sandbox                # sandbox, staging_sandbox, or live
NVM_PLAN_ID=your-plan-id              # Create in Nevermined App > My Pricing Plans
OPENAI_API_KEY=sk-your-key            # For LLM-powered agents

Agents

Agent Description Protocols Link
Buyer Agent Discovers sellers, purchases data, tracks spending x402, A2A README
Seller Agent Sells data/services with tiered pricing x402, A2A README
MCP Server Payment-protected tools via MCP protocol MCP, x402 README
Strands Agent Strands SDK agent with payment-protected tools x402 README

Buyer Agent (agents/buyer-simple-agent/)

Discovers sellers in an A2A marketplace, purchases data autonomously, and tracks spending with budget limits. Includes a React web frontend for interactive use.

cd agents/buyer-simple-agent
poetry install
poetry run python -m src.agent          # Interactive CLI (A2A mode)
poetry run python -m src.web            # Web server + React frontend

Seller Agent (agents/seller-simple-agent/)

Sells data and services with tiered pricing (1, 5, 10 credits). Supports both HTTP (x402 middleware) and A2A modes with auto-registration to buyer marketplaces.

cd agents/seller-simple-agent
poetry install
poetry run python -m src.agent          # HTTP server (x402)
poetry run python -m src.agent_a2a      # A2A server

MCP Server Agent (agents/mcp-server-agent/)

MCP server with payment-protected tools (search, summarize, research). Includes a setup script that programmatically registers the agent and creates a payment plan.

cd agents/mcp-server-agent
poetry install
poetry run python -m src.setup          # Register agent + create plan
poetry run python -m src.server         # Start MCP server (port 3000)

Strands Agent (agents/strands-simple-agent/)

Strands SDK agent with x402 payment-protected tools and full payment discovery flow. Demonstrates the @requires_payment decorator pattern.

cd agents/strands-simple-agent
poetry install
poetry run python agent.py              # Run agent
poetry run python demo.py               # Run demo

Protocols

x402 (HTTP Payment Protocol)

Payment negotiation via HTTP headers. The client sends a payment-signature header with an access token. If missing, the server returns 402 Payment Required with a payment-required header describing what's needed.

A2A (Agent-to-Agent)

Standard agent discovery via /.well-known/agent.json and JSON-RPC messaging with payment extensions. Agents can auto-register with buyer marketplaces.

MCP (Model Context Protocol)

Tool/plugin monetization with logical URLs (e.g., mcp://server/tools/search). Each tool can have independent credit pricing.

Documentation

Resources

License

MIT

About

Autonomous Business Hackathon starter kits and resources

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages