Skip to main content
Struct is designed to work natively with AI tools. Whether you’re building autonomous agents, using an AI coding assistant, or integrating prediction market data into an AI workflow — there’s a first-class path for you.

TypeScript SDK

Type-safe client with full autocompletion.

MCP Server

Connect AI assistants directly to Struct data.

AI Skill

Install via skills.sh for instant access in your agent.

TypeScript SDK

The Struct SDK gives you a fully typed client for all Polymarket endpoints. Install it and start querying in seconds.
npm install @structbuild/sdk
import { StructClient } from "@structbuild/sdk";

const client = new StructClient({ apiKey: "YOUR_API_KEY" });

const markets = await client.markets.getMarkets();

const event = await client.events.getEventBySlug({ slug: "us-presidential-election" });
Every method returns fully typed responses — no manual type definitions, no guessing field names.

SDK Reference

Full documentation, examples, and source code.

MCP Server

Struct exposes a Model Context Protocol (MCP) server that lets AI assistants query prediction market data directly. The MCP server is available at api.struct.to/mcp and supports two authentication methods.

OAuth (for AI assistants)

For AI assistants like ChatGPT and Claude that support OAuth-based MCP connections, simply connect using the MCP URL:
https://api.struct.to/mcp
The assistant will handle the OAuth flow automatically — no API key management needed.

API Key (for backend agents)

For backend AI agents and programmatic access, connect to the MCP server directly with your API key:
{
  "mcpServers": {
    "struct": {
      "url": "https://api.struct.to/mcp?api_key=YOUR_API_KEY"
    }
  }
}
Once connected, your AI agent can search markets, pull real-time prices, look up trader positions, and more — all through natural language.

AI Skill

Install the Struct skill to give any Claude Code agent instant access to Struct’s Polymarket data.
npx skills add structbuild/struct-skill
Once installed, the agent can query markets, events, trades, and positions without any additional setup.

Choose Your Path

ApproachBest For
REST APIFull control, any language, custom integrations
TypeScript SDKTypeScript/JavaScript projects with type safety
MCP Server (OAuth)AI assistants like ChatGPT and Claude
MCP Server (API Key)Backend AI agents and programmatic access
AI SkillClaude Code agents via skills.sh
Last modified on March 18, 2026