Build with AI Agents

Integrate OpenSea data and trading into AI agent workflows using MCP, Agent Skills, the CLI, and the SDK.

OpenSea provides first-class support for AI agents. Whether you're building with OpenClaw, Hermes Agent, Claude Code, Cursor, GitHub Copilot, or a custom agent framework like LangChain or CrewAI, there are three integration paths — choose the one that fits your workflow.

Instant API Key

Before you start, get an API key. The instant endpoint requires no signup:

curl -s -X POST https://api.opensea.io/api/v2/auth/keys | jq -r '.api_key'

This returns a free-tier key (60/min read, 5/min write, 30-day expiry) you can use immediately. For higher rate limits, create a full key at Settings -> Developer.

Path A: MCP Server

The OpenSea MCP Server (mcp.opensea.io) exposes 22+ tools through the Model Context Protocol — an open standard for connecting AI tools to external data. Use it with any MCP-compatible application including Claude Desktop, Cursor, VS Code (GitHub Copilot), Windsurf, OpenClaw, and Hermes Agent.

Available tools include: search, fetch, collection stats, token prices, swap quotes, wallet balances, activity history, trending data, drop details, minting, and SeaDrop contract deployment.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "OpenSea": {
      "url": "https://mcp.opensea.io/mcp",
      "headers": {
        "X-API-KEY": "YOUR_API_KEY"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "OpenSea": {
      "url": "https://mcp.opensea.io/mcp",
      "headers": {
        "X-API-KEY": "YOUR_API_KEY"
      }
    }
  }
}

VS Code (GitHub Copilot)

Add to your settings.json:

{
  "mcp": {
    "servers": {
      "OpenSea": {
        "type": "http",
        "url": "https://mcp.opensea.io/mcp",
        "headers": {
          "X-API-KEY": "YOUR_API_KEY"
        }
      }
    }
  }
}

Custom Applications

Use any MCP SDK to connect programmatically:

import { experimental_createMCPClient as createMCPClient } from "ai";

const mcpClient = await createMCPClient({
  transport: {
    type: "http",
    url: "https://mcp.opensea.io/mcp",
    headers: { "X-API-KEY": process.env.OPENSEA_API_KEY },
  },
});

const tools = await mcpClient.tools();

See the opensea-mcp-next-sample for a complete working example.

Path B: Agent Skill

The OpenSea Agent Skill is purpose-built for AI agents and coding assistants — including OpenClaw, Hermes Agent, Claude Code, Cursor, and Windsurf. It bundles pre-built workflows in SKILL.md and shell scripts that your agent can invoke directly.

Install

npx skills add ProjectOpenSea/opensea-skill

Set API Key

export OPENSEA_API_KEY=$(curl -s -X POST https://api.opensea.io/api/v2/auth/keys | jq -r '.api_key')

Restart your AI tool after installation. Then prompt naturally:

  • "Get the floor price for Pudgy Penguins on OpenSea"
  • "Swap 0.02 ETH to USDC on Base using OpenSea"
  • "Show me trending tokens on Ethereum"

The skill uses the OpenSea CLI, shell scripts, and the MCP server as execution paths.

Compatible Agent Platforms

OpenSea's MCP Server, Agent Skill, CLI, and SDK work with the leading AI agent platforms and coding assistants. Any platform that supports MCP or shell tool-calling can integrate with OpenSea.

Autonomous AI Agents

PlatformIntegrationDescription
OpenClawMCP, SkillsOpen-source AI agent that autonomously executes multi-step tasks — browsing, coding, file management, and Web3 interactions. Supports MCP servers and installable skills for crypto workflows.
Hermes AgentMCP, SkillsSelf-improving agent by Nous Research that learns across sessions. Built with Web3 DNA and supports delegated onchain transactions, token swaps, and DeFi operations.
OpenAI Codex CLIMCP, CLIOpenAI's open-source coding agent with tool-calling and shell access. Connect it to the OpenSea MCP server or have it invoke CLI commands directly.

AI Coding Assistants

PlatformIntegrationDescription
Claude CodeMCP, Skills, CLIAnthropic's agentic coding tool with native MCP support and skill installation.
CursorMCP, SkillsAI code editor with built-in MCP server configuration and agent mode.
WindsurfMCP, SkillsCodeium's AI IDE with agentic coding flows and MCP integration.
GitHub CopilotMCPVS Code agent mode with MCP server support for extending capabilities to external tools.

Agent Frameworks

PlatformIntegrationDescription
LangChain / LangGraphSDK, CLIThe most widely adopted framework for building AI agents with tool-calling and multi-step reasoning. Use the OpenSea SDK or CLI as tools.
CrewAISDK, CLIMulti-agent orchestration framework where specialized agents collaborate on tasks with built-in tool integration.
Vercel AI SDKMCP, SDKTypeScript toolkit for building AI applications with structured tool-calling, streaming, and native MCP client support.

Path C: CLI + SDK

For fully custom agents, use the CLI or SDK directly.

CLI with TOON Format

The OpenSea CLI (@opensea/cli) supports a TOON output format that uses ~40% fewer tokens than JSON — ideal for AI agents operating under context limits.

npm install -g @opensea/cli
export OPENSEA_API_KEY=your-api-key

# Default JSON output
opensea collections get boredapeyachtclub

# TOON format (optimized for AI)
opensea --format toon collections get boredapeyachtclub

# Table format (human-readable)
opensea --format table collections stats mfers

Your agent can shell out to these commands and parse the results.

SDK

Use @opensea/sdk directly in a TypeScript agent for maximum control:

import { ethers } from "ethers";
import { OpenSeaSDK, Chain } from "@opensea/sdk";

const provider = new ethers.JsonRpcProvider("https://your-rpc-url");
const sdk = new OpenSeaSDK(provider, {
  chain: Chain.Mainnet,
  apiKey: "YOUR_API_KEY",
});

// Your agent can call any SDK method
const stats = await sdk.api.getCollectionStats("boredapeyachtclub");
const trending = await sdk.api.getTrendingTokens();

Security Warning: Do not use the SDK in client-side code — your API key would be exposed. Use it on a backend server and return transaction data to your frontend.

Machine-Readable Discovery

OpenSea provides discovery files for AI agents:

Example: Floor Price Alert Agent

Build a simple agent that monitors a collection floor price and alerts when it drops below a threshold:

import { ethers } from "ethers";
import { OpenSeaSDK, Chain } from "@opensea/sdk";

const provider = new ethers.JsonRpcProvider("https://your-rpc-url");
const sdk = new OpenSeaSDK(provider, {
  chain: Chain.Mainnet,
  apiKey: "YOUR_API_KEY",
});

const COLLECTION = "pudgypenguins";
const THRESHOLD_ETH = 5;
const CHECK_INTERVAL_MS = 60_000; // 1 minute

async function checkFloor() {
  const stats = await sdk.api.getCollectionStats(COLLECTION);
  const floor = stats.total.floor_price;

  console.log(`${COLLECTION} floor: ${floor} ETH`);

  if (floor < THRESHOLD_ETH) {
    console.log(`ALERT: Floor (${floor} ETH) is below ${THRESHOLD_ETH} ETH!`);
    // Send notification (Slack, email, etc.)
  }
}

// Poll on an interval
setInterval(checkFloor, CHECK_INTERVAL_MS);
checkFloor();

For real-time alerts instead of polling, combine this with Stream Real-Time Events using @opensea/stream-js.

ERC-8004 AgentMetadata

ERC-8004 defines a standard for onchain agent metadata, allowing AI agents to declare their capabilities, endpoints, and interaction patterns as NFT traits. OpenSea supports browsing and discovering AI agent NFTs with these capability-based traits on Base.

Developers can mint agent NFTs that encode:

  • Capabilities — what the agent can do (e.g., trade, analyze, search)
  • Endpoints — how to interact with the agent (API URLs, MCP servers)
  • Interaction patterns — supported protocols and input/output formats

Browse AI agent collections on opensea.io.

Next Steps