Drift SDK Tools
A comprehensive developer tooling suite for Drift Protocol, A perpetual DEX with a best in class cross margining system and novel liquidity mechanisms.
Overview
This repository contains:
- Agent Skill (
packages/skill/) - Documentation and patterns for TypeScript, Python, and Rust SDKs
- MCP Server (
packages/mcp-server/) - 🚧 WIP - Read-only live data queries via Model Context Protocol
Installing the Skill
The skill provides comprehensive documentation for building on Drift. Install it in your preferred AI assistant:
Claude.ai
Option 1: Skills (Recommended)
- Download
packages/skill/ as a ZIP file
- Go to Settings > Capabilities > Skills
- Click Add Skill and upload the ZIP
Option 2: Project Files
- Create a new Project in Claude
- Upload all files from
packages/skill/ to Project Knowledge
- The skill activates automatically when you chat in that project
ChatGPT
Option 1: Custom GPT
- Go to Explore GPTs > Create
- Upload files from
packages/skill/ under Knowledge
- Add instructions: "Use the Drift Protocol documentation to help users build trading applications"
- Save and use your custom GPT
Option 2: File Upload
- In any ChatGPT conversation, click the paperclip icon
- Upload relevant files from
packages/skill/ (e.g., drift-protocol.md, typescript/PATTERNS.md)
- Reference them in your prompts
Cursor
Option 1: Project Rules (Recommended)
# Copy to your project's .cursor/rules directory
mkdir -p .cursor/rules
cp -r packages/skill/* .cursor/rules/drift-protocol/
Option 2: Global Skills
# Copy to Cursor's global skills directory
cp -r packages/skill ~/.cursor/skills/drift-protocol
Claude Code
Option 1: Plugin Marketplace (Recommended)
Install via the Claude Code plugin marketplace:
# Add the marketplace
/plugin marketplace add drift-labs/drift-agent-kit
# Install the skill plugin (docs, patterns, slash commands)
/plugin install drift-skill@drift-agent-kit
# Install the MCP server plugin (live data queries)
/plugin install drift-mcp@drift-agent-kit
This gives you:
/drift - General Drift help
/drift-precision - Quick precision reference
/drift-order - How to place orders
/drift-setup - SDK setup guides
Option 2: CLAUDE.md
Add to your project's CLAUDE.md:
## Drift Protocol
For Drift development, reference the skill documentation in `docs/drift/` for:
- TypeScript SDK patterns: `docs/drift/drift-typescript.md`
- Python SDK patterns: `docs/drift/drift-python.md`
- Rust SDK patterns: `docs/drift/drift-rust.md`
- Precision constants: `docs/drift/concepts/PRECISION.md` (CRITICAL)
Then copy the skill:
cp -r packages/skill docs/drift
OpenAI Codex CLI
# Copy skill to your project
cp -r packages/skill docs/drift
# Reference in your prompts
codex "Using the Drift docs in docs/drift/, help me place a limit order"
For persistent context, add to your project's instructions file:
echo "Reference docs/drift/ for Drift Protocol SDK patterns" >> .codex/instructions.md
GitHub Copilot
- Copy the skill to your repository:
cp -r packages/skill docs/drift
- Add a
.github/copilot-instructions.md:
For Drift Protocol development, reference:
- docs/drift/drift-protocol.md for protocol overview
- docs/drift/drift-typescript.md for TypeScript SDK
- docs/drift/drift-python.md for Python SDK
- docs/drift/drift-rust.md for Rust SDK
- docs/drift/concepts/PRECISION.md for precision constants (CRITICAL)
Other AI Assistants
For any AI assistant that supports file uploads or context:
- Download the
packages/skill/ directory
- Upload or reference the skill for your use case:
drift-protocol.md - Protocol mechanics, architecture, data API
drift-typescript.md - TypeScript SDK entry point
drift-python.md - Python SDK entry point
drift-rust.md - Rust SDK entry point
concepts/PRECISION.md - Critical precision constants (always include!)
- Prompt with: "Use the Drift documentation to help me..."
Direct Usage
Browse the documentation directly in your browser:
MCP Server
🚧 Work in Progress - The MCP server for live Drift data queries is under development.
Documentation Structure
The skill is organized into 4 focused entry points that activate based on context: