MCP Server - cred.diy API documentation
MCP Server (AI Agents)
cred.diy exposes a Model Context Protocol (MCP) server so AI agents like Claude, Cursor, Windsurf, and others can manage credits, users, pricing, swaps, and referrals on your behalf using natural language.
MCP Endpoint
https://eutdgemlrpvnxfkkpvlu.supabase.co/functions/v1/cred-mcpTransport: Streamable HTTP — compatible with any MCP client that supports the HTTP transport.
Authentication
Pass your API key and project ID as HTTP headers when connecting. These are set once at the connection level — you don't need to provide them on every tool call.
x-api-keyYour cred.diy API key (e.g. sk_live_...)x-project-idYour project UUID from the dashboardAlternatively, each tool also accepts optional api_key and project_id parameters to override the connection-level credentials.
Setup: Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"cred": {
"url": "https://eutdgemlrpvnxfkkpvlu.supabase.co/functions/v1/cred-mcp",
"headers": {
"x-api-key": "sk_live_your_api_key",
"x-project-id": "your_project_id"
}
}
}
}Setup: Cursor / Windsurf
Add an MCP server in your IDE settings:
// In Cursor Settings → MCP Servers → Add Server
// Name: cred
// Type: Streamable HTTP
// URL: https://eutdgemlrpvnxfkkpvlu.supabase.co/functions/v1/cred-mcp
// Headers:
// x-api-key: sk_live_your_api_key
// x-project-id: your_project_idAvailable Tools
The MCP server exposes 27 tools covering the full cred.diy API surface:
Available MCP Tools:
─────────────────────────────────────────
Credits
• issue_credits — Issue credits to a user
• deduct_credits — Deduct credits from a user
• get_balance — Get a user's credit balance
• get_transactions — List transaction history
Users
• create_user — Create or get a user
• get_users — List all users
• update_user — Update user profile
• delete_user — Delete a user
• bulk_create_users — Bulk sync users (up to 1000)
Credit Types
• list_credit_types — List all credit types
Pricing
• list_pricing_tiers — List pricing tiers
• create_pricing_tier — Create a pricing tier
Swaps
• list_swap_pairs — List swap pairs
• execute_swap — Execute a credit swap
Cash Redemption
• onboard_payout_account — Start Stripe Connect onboarding for a user
• redeem_credits — Cash out credits to a connected Stripe account
Referrals
• get_referral_settings — Get referral config
• save_referral_settings — Update referral config
• generate_referral_code — Generate a referral code
• apply_referral — Apply a referral code
• list_referrals — List all referrals
Wallets
• set_user_wallet — Attach an asserted wallet
• get_user_wallet — Read a user's wallet
• request_wallet_challenge — Request a proof message
• verify_wallet_signature — Verify wallet ownership
x402
• x402_supported — Discover accepted assets and prices
• buy_credits_x402 — Buy credits with stablecoinExample: AI Agent Conversation
Once connected, your AI assistant can manage credits through natural language:
User: "Issue 500 welcome credits to alice@example.com"
AI Agent calls → issue_credits({
user_email: "alice@example.com",
user_id: "alice",
amount: 500,
credit_type_id: "ct_abc123",
reason: "Welcome bonus"
})
→ ✅ Credits issued. New balance: 500Tips
- •The MCP server uses the same API keys as the REST API — no separate credentials needed.
- •All tools return structured JSON, making it easy for AI agents to process and present results.
- •Rate limits (100 req/min per key) apply the same as the REST API.
- •Use the "Copy Docs for AI" button on this page to give your AI assistant full API context.
Your first credit is one request away.
Create a project, copy an API key, and issue a credit from your server.
