Use Struct with AI agents, coding assistants, and autonomous workflows.
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.
Every method returns fully typed responses, with no manual type definitions and 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 staging-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://staging-api.struct.to/mcp
The assistant will handle the OAuth flow automatically, so no API key management is needed.
API Key (for backend agents)
For backend AI agents and programmatic access, connect to the MCP server directly with 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
Approach
Best For
REST API
Full control, any language, custom integrations
TypeScript SDK
TypeScript/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 Skill
Claude Code agents via skills.sh
Last modified on September 20, 2026
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Struct Docs","colors":{"primary":"#FF6900","light":"#FF6900","dark":"#FF6900"},"logo":{"light":"https://mintcdn.com/struct-8753cf7e/6UV7plDJPDSZHj-s/assets/logo/struct-logo-black.svg?fit=max\u0026auto=format\u0026n=6UV7plDJPDSZHj-s\u0026q=85\u0026s=31c38ce54788cd4eb4c8c02e95a8abe7","dark":"https://mintcdn.com/struct-8753cf7e/6UV7plDJPDSZHj-s/assets/logo/struct-logo-white.svg?fit=max\u0026auto=format\u0026n=6UV7plDJPDSZHj-s\u0026q=85\u0026s=f9f786178e5e373e13581965b8821172"},"favicon":"https://mintcdn.com/struct-8753cf7e/6UV7plDJPDSZHj-s/assets/logo/favicon.svg?fit=max\u0026auto=format\u0026n=6UV7plDJPDSZHj-s\u0026q=85\u0026s=3eb284fba230d85e6c005760e068f7aa","api":{"openapi":"onchain-openapi.json","mdx":{"auth":{"method":"key","name":"X-API-Key"},"server":"https://staging-api.struct.to/v1"}},"navbar":{"links":[{"href":"mailto:support@struct.to","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://www.struct.to/dashboard"}},"footer":{"socials":{"x":"https://x.com/structbuild","github":"https://github.com/structbuild"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"metadata":{"timestamp":true},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"struct-8753cf7e","hasAudioNarration":false,"actualSubdomain":"struct-8753cf7e","customDomains":["docs.struct.to"],"gitSource":{"type":"github","owner":"structbuild","repo":"struct-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6aef398cf5a881e8748cdea2","clientVersion":"0.0.4286","searchFilterCounts":[{"language":"default","tag":"API Reference","count":79},{"language":"default","tag":"Guides","count":27},{"language":"default","tag":"Websockets","count":26},{"language":"default","tag":"Rooms","count":19},{"language":"default","tag":"Overview","count":18},{"language":"default","tag":"Introduction","count":17},{"language":"default","tag":"Uniswap","count":15},{"language":"default","tag":"TypeScript SDK","count":11},{"language":"default","tag":"DEX Trading","count":10},{"language":"default","tag":"Token","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"introduction/ai-first","slug":"/introduction/ai-first","pageMetadata":{"title":"Work with AI","description":"Use Struct with AI agents, coding assistants, and autonomous workflows.","icon":"microchip-ai","href":"/introduction/ai-first"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use Struct with AI agents, coding assistants, and autonomous workflows.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Heading,Table}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`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.`}),`\n`,_jsxs(CardGroup,{cols:3,children:[_jsx(Card,{title:`TypeScript SDK`,icon:`js`,href:`#typescript-sdk`,children:_jsx(_components.p,{children:`Type-safe client with full autocompletion.`})}),_jsx(Card,{title:`MCP Server`,icon:`plug`,href:`#mcp-server`,children:_jsx(_components.p,{children:`Connect AI assistants directly to Struct data.`})}),_jsx(Card,{title:`AI Skill`,icon:`wand-magic-sparkles`,href:`#ai-skill`,children:_jsx(_components.p,{children:`Install via skills.sh for instant access in your agent.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`typescript-sdk`,children:`TypeScript SDK`}),`\n`,_jsx(_components.p,{children:`The Struct SDK gives you a fully typed client for all Polymarket endpoints. Install it and start querying in seconds.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @structbuild/sdk`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`StructClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@structbuild/sdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` StructClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` markets`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`markets`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getMarkets`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` event`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`events`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getEventBySlug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slug:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"us-presidential-election\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Every method returns fully typed responses, with no manual type definitions and no guessing field names.`}),`\n`,_jsx(Card,{title:`SDK Reference`,icon:`book`,href:`https://www.npmjs.com/package/@structbuild/sdk`,children:_jsx(_components.p,{children:`Full documentation, examples, and source code.`})}),`\n`,_jsx(Heading,{level:`2`,id:`mcp-server`,children:`MCP Server`}),`\n`,_jsxs(_components.p,{children:[`Struct exposes a `,_jsx(_components.a,{href:`https://modelcontextprotocol.io`,children:`Model Context Protocol`}),` (MCP) server that lets AI assistants query prediction market data directly. The MCP server is available at `,_jsx(_components.code,{children:`staging-api.struct.to/mcp`}),` and supports two authentication methods.`]}),`\n`,_jsx(Heading,{level:`3`,id:`oauth-for-ai-assistants`,children:`OAuth (for AI assistants)`}),`\n`,_jsx(_components.p,{children:`For AI assistants like ChatGPT and Claude that support OAuth-based MCP connections, simply connect using the MCP URL:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://staging-api.struct.to/mcp`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`The assistant will handle the OAuth flow automatically, so no API key management is needed.`}),`\n`,_jsx(Heading,{level:`3`,id:`api-key-for-backend-agents`,children:`API Key (for backend agents)`}),`\n`,_jsx(_components.p,{children:`For backend AI agents and programmatic access, connect to the MCP server directly with your API key:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"mcpServers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"struct\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://staging-api.struct.to/mcp?api_key=YOUR_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Once connected, your AI agent can search markets, pull real-time prices, look up trader positions, and more, all through natural language.`}),`\n`,_jsx(Heading,{level:`2`,id:`ai-skill`,children:`AI Skill`}),`\n`,_jsx(_components.p,{children:`Install the Struct skill to give any Claude Code agent instant access to Struct’s Polymarket data.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` skills`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` structbuild/struct-skill`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Once installed, the agent can query markets, events, trades, and positions without any additional setup.`}),`\n`,_jsx(Heading,{level:`2`,id:`choose-your-path`,children:`Choose Your Path`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Approach`}),_jsx(_components.th,{children:`Best For`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`REST API`})}),_jsx(_components.td,{children:`Full control, any language, custom integrations`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`TypeScript SDK`})}),_jsx(_components.td,{children:`TypeScript/JavaScript projects with type safety`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`MCP Server (OAuth)`})}),_jsx(_components.td,{children:`AI assistants like ChatGPT and Claude`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`MCP Server (API Key)`})}),_jsx(_components.td,{children:`Backend AI agents and programmatic access`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`AI Skill`})}),_jsx(_components.td,{children:`Claude Code agents via skills.sh`})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Work with AI","description":"Use Struct with AI agents, coding assistants, and autonomous workflows.","icon":"microchip-ai","href":"/introduction/ai-first"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"TypeScript SDK","slug":"typescript-sdk","depth":2,"children":[]},{"title":"MCP Server","slug":"mcp-server","depth":2,"children":[{"title":"OAuth (for AI assistants)","slug":"oauth-for-ai-assistants","depth":3,"children":[]},{"title":"API Key (for backend agents)","slug":"api-key-for-backend-agents","depth":3,"children":[]}]},{"title":"AI Skill","slug":"ai-skill","depth":2,"children":[]},{"title":"Choose Your Path","slug":"choose-your-path","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"struct-8753cf7e","siteName":"Struct Docs","title":"Work with AI - Struct Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-07T14:37:13.793Z","gitLastModified":"2026-09-20T18:52:30.000Z","originalFileLocation":"introduction/ai-first.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use Struct with AI agents, coding assistants, and autonomous workflows.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Struct Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Work with AI - Struct Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use Struct with AI agents, coding assistants, and autonomous workflows.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Struct Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.struct.to/introduction/ai-first\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://struct-8753cf7e.mintlify.site/_mintlify/api/og/v2?division=Introduction\u0026amp;title=Work+with+AI\u0026amp;description=Use+Struct+with+AI+agents%2C+coding+assistants%2C+and+autonomous+workflows.\u0026amp;theme=d506f91388a5f907bd510cc0\u0026amp;signature=0a7fe32ababb48375e06cefdc07043df8a03984007edadfb3b033555912825a4\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Work with AI - Struct Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use Struct with AI agents, coding assistants, and autonomous workflows.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://struct-8753cf7e.mintlify.site/_mintlify/api/og/v2?division=Introduction\u0026amp;title=Work+with+AI\u0026amp;description=Use+Struct+with+AI+agents%2C+coding+assistants%2C+and+autonomous+workflows.\u0026amp;theme=d506f91388a5f907bd510cc0\u0026amp;signature=0a7fe32ababb48375e06cefdc07043df8a03984007edadfb3b033555912825a4\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/struct-8753cf7e/oEdESslBcTklIZwA/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Struct Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF6900\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.struct.to/introduction/ai-first\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/introduction/ai-first.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.struct.to/#organization\",\"name\":\"Struct Docs\",\"url\":\"https://docs.struct.to\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/struct-8753cf7e/6UV7plDJPDSZHj-s/assets/logo/struct-logo-black.svg?fit=max\u0026auto=format\u0026n=6UV7plDJPDSZHj-s\u0026q=85\u0026s=31c38ce54788cd4eb4c8c02e95a8abe7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.struct.to#website\",\"name\":\"Struct Docs\",\"url\":\"https://docs.struct.to\",\"publisher\":{\"@id\":\"https://docs.struct.to/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.struct.to/introduction/ai-first#webpage\",\"url\":\"https://docs.struct.to/introduction/ai-first\",\"name\":\"Work with AI\",\"description\":\"Use Struct with AI agents, coding assistants, and autonomous workflows.\",\"dateModified\":\"2026-09-20T18:52:30.000Z\",\"isPartOf\":{\"@id\":\"https://docs.struct.to#website\"},\"breadcrumb\":{\"@id\":\"https://docs.struct.to/introduction/ai-first#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.struct.to/introduction/ai-first#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Introduction\",\"item\":\"https://docs.struct.to/introduction/welcome\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Work with AI\",\"item\":\"https://docs.struct.to/introduction/ai-first\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.struct.to/introduction/ai-first#article\",\"headline\":\"Work with AI\",\"name\":\"Work with AI\",\"description\":\"Use Struct with AI agents, coding assistants, and autonomous workflows.\",\"url\":\"https://docs.struct.to/introduction/ai-first\",\"mainEntityOfPage\":{\"@id\":\"https://docs.struct.to/introduction/ai-first#webpage\"},\"dateModified\":\"2026-09-20T18:52:30.000Z\",\"publisher\":{\"@id\":\"https://docs.struct.to/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.struct.to#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Struct Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Struct Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/introduction/ai-first.md","siteName":"Struct Docs","nav":{"global":null,"tabs":[{"tab":"Overview","groups":[{"group":"Introduction","pages":[{"title":"Welcome to Struct","mode":"wide","icon":"brackets-curly","href":"/introduction/welcome"},{"title":"Concepts","icon":"book","href":"/introduction/concepts"},{"title":"Authentication","description":"API keys, JWT public keys, and how to authenticate every Struct request.","icon":"key","href":"/introduction/authentication"},{"title":"Work with AI","icon":"microchip-ai","href":"/introduction/ai-first"},{"title":"Pricing \u0026 Ratelimits","description":"Plans, credits, and rate limits for the Struct API","icon":"dollar-sign","href":"/introduction/pricing"}]},{"group":"Use cases","pages":[{"title":"Trading Platforms","icon":"chart-area","href":"/use-cases/trading-platforms"},{"title":"AI Agents","icon":"robot","href":"/use-cases/ai-agents"},{"title":"Analytics \u0026 Research","icon":"chart-mixed","href":"/use-cases/analytics-research"}]},{"group":"Dashboard","pages":[{"title":"Account","icon":"user","href":"/dashboard/account"},{"title":"Organisations","icon":"users","href":"/dashboard/organisations"},{"title":"API Keys","icon":"key","href":"/dashboard/api-keys"},{"title":"JWT Public Keys","icon":"shield-keyhole","href":"/dashboard/jwt-keys"},{"title":"Playground","icon":"play","href":"/dashboard/playground"},{"title":"AI Chat","icon":"message-bot","href":"/dashboard/ai-chat"},{"title":"Automations","icon":"bolt","href":"/dashboard/automations"},{"title":"Automation Templates","icon":"grid-2","href":"/dashboard/automations-templates"},{"title":"Template Syntax","icon":"code","href":"/dashboard/automations-syntax"},{"title":"Billing","icon":"credit-card","href":"/dashboard/billing"}]}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/api-cookbook"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/getting-started"}]},{"tab":"Websockets","pages":[{"title":"Websockets","href":"/websockets/getting-started"}]},{"tab":"TypeScript SDK","pages":[{"title":"TypeScript SDK","href":"/sdk/overview"}]},{"tab":"Indexing \u0026 Backfilling","pages":[{"title":"Indexing \u0026 Backfilling","href":"/indexing/getting-started"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/backend"}]}]},"basePath":"","title":"Work with AI - Struct Docs","deploymentId":"dpl_G6E2ur2Zjq51xGTVZPSFXsWoTxCu","buildId":"dpl_G6E2ur2Zjq51xGTVZPSFXsWoTxCu","dynamics":[],"chunks":[]}