Agent Framework
Connect THC Store to your AI
THC Store India publishes a REST API, an MCP (Model Context Protocol) server, and a chat endpoint that any LLM — Claude, ChatGPT, Cursor, or your own agent — can call. MCP-aware clients (Claude Desktop, ChatGPT MCP Connectors) sign in via OAuth 2.0 (MCP 2025-06-18 spec) — no manual token paste. REST clients use a Personal Access Token. Anonymous read access works out of the box.
Three ways to connect
MCP
Model Context Protocol. Best for Claude Desktop, Cursor, and other MCP-aware clients.
https://mcp.thcstore.in/mcpChat
A managed conversational front-door (PAT-gated). Good when you want THC Store to handle tool routing for you.
https://chat.thcstore.in/chatAuthentication
MCP clients: OAuth 2.0 (automatic)
Claude Desktop and ChatGPT MCP Connectors auto-discover OAuth via the resource metadata endpoint on first connect. Your browser opens for sign-in and scope approval; the token is stored locally by the client (90-day lifetime). OAuth-issued tokens appear in Connected AI under the AI client's reported name (e.g. Claude Desktop, ChatGPT MCP Connector) — revoke there to force the client to re-authorize. PKCE S256 + dynamic client registration follow the MCP 2025-06-18 spec.
REST / Custom GPT / DeepSeek / your own agent: Personal Access Tokens
For ChatGPT Custom GPTs (free tier), a DeepSeek function-calling integration, or any other agent you build yourself — REST + a Personal Access Token needs no MCP support on the client side at all. Mint a PAT from Connected AI and send it as a Bearer token to agent-api.thcstore.in. Each PAT can be scoped to specific tools (e.g. cart:write, orders:read).
Anonymous (tier-0) reads — product search, blog, doctor list, pincode resolve — work with no PAT and are IP rate-limited. Every tool is an HTTP POST with a JSON body of the form {"args": {...}} — never GET (a GET returns an error, not data). Required args: searchProducts.query and getProduct.productId.
Two different hosts, two different jobs: mcp.thcstore.in serves only the MCP endpoint and OAuth discovery docs. Every REST call (/v1/tools/*, /v1/public/*) goes to agent-api.thcstore.in instead — a REST call sent to the MCP host will 404.
Code samples
curl — anonymous tier-0 search
curl -X POST https://agent-api.thcstore.in/v1/public/searchProducts \
-H 'Content-Type: application/json' \
-d '{"args":{"query":"ashwagandha","limit":3}}'curl — anonymous tier-0 product detail
curl -X POST https://agent-api.thcstore.in/v1/public/getProduct \
-H 'Content-Type: application/json' \
-d '{"args":{"productId":1}}'curl — authenticated tool call (PAT required)
curl -X POST https://agent-api.thcstore.in/v1/tools/addToCart \
-H 'Authorization: Bearer thc_pat_xxx' \
-H 'Content-Type: application/json' \
-d '{"args":{"productId":1,"quantity":1}}'Claude Desktop — claude_desktop_config.json (auto-OAuth)
{
"mcpServers": {
"thc-store": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.thcstore.in/mcp"]
}
}
}Cursor — mcp.json
{
"mcpServers": {
"thc-store": {
"url": "https://mcp.thcstore.in/mcp"
}
}
}ChatGPT MCP Connectors (Plus / Pro / Team)
Settings → Connectors → Add MCP server → https://mcp.thcstore.in/mcpChatGPT Custom GPT (free tier — REST + PAT)
OpenAPI URL: https://agent-api.thcstore.in/.well-known/ai-plugin.json
Auth: API Key → Bearer → paste a PAT from /account/connected-aiTool catalogue (76)
Live from https://agent-api.thcstore.in/v1/openapi.json — refreshes hourly.
account:read (10)
- POST
/v1/tools/exportMyAgentActivityexportMyAgentActivity - POST
/v1/tools/getAddressesgetAddresses - POST
/v1/tools/getLoyaltyPointsgetLoyaltyPoints - POST
/v1/tools/getMyMembershipgetMyMembership - POST
/v1/tools/getReferralCodegetReferralCode - POST
/v1/tools/getWalletBalancegetWalletBalance - POST
/v1/tools/getWishlistgetWishlist - POST
/v1/tools/listBrandsForMelistBrandsForMe - POST
/v1/tools/listMyAlertslistMyAlerts - POST
/v1/tools/listMySubscriptionslistMySubscriptions
auth (3)
- GET
/v1/auth/session/{sessionId}/pollPoll an OAuth session for the redeemed PAT - POST
/v1/auth/session/startStart an OAuth session (auth-link / device-code) - POST
/v1/tools/whoamiwhoami
cart:read (4)
- POST
/v1/tools/getCartgetCart - POST
/v1/tools/getCartTotalsgetCartTotals - POST
/v1/tools/getCheckoutBlockersgetCheckoutBlockers - POST
/v1/tools/listCouponslistCoupons
cart:write (5)
- POST
/v1/tools/addToCartaddToCart - POST
/v1/tools/applyCouponapplyCoupon - POST
/v1/tools/clearCartclearCart - POST
/v1/tools/removeFromCartremoveFromCart - POST
/v1/tools/updateQuantityupdateQuantity
catalog:read (6)
- POST
/v1/tools/checkStockcheckStock - POST
/v1/tools/getBrandStorefrontgetBrandStorefront - POST
/v1/tools/getCategoriesgetCategories - POST
/v1/tools/getProductgetProduct - POST
/v1/tools/getRxRequiredForgetRxRequiredFor - POST
/v1/tools/searchProductssearchProducts
consultations:read (5)
- POST
/v1/tools/getDoctorAvailabilitygetDoctorAvailability - POST
/v1/tools/getDoctorProfilegetDoctorProfile - POST
/v1/tools/joinAppointmentVideojoinAppointmentVideo - POST
/v1/tools/listDoctorslistDoctors - POST
/v1/tools/listMyAppointmentslistMyAppointments
consultations:stage (2)
- POST
/v1/tools/confirmStagedConsultationconfirmStagedConsultation - POST
/v1/tools/stageConsultationstageConsultation
consultations:write (1)
- POST
/v1/tools/cancelAppointmentcancelAppointment
messages:read (2)
- POST
/v1/tools/getMyBrandThreadsgetMyBrandThreads - POST
/v1/tools/listMyReferralslistMyReferrals
orders:read (8)
- POST
/v1/tools/checkCancellationEligibilitycheckCancellationEligibility - POST
/v1/tools/getOrdergetOrder - POST
/v1/tools/getOrderPrescriptionStatusgetOrderPrescriptionStatus - POST
/v1/tools/getOrderTrackinggetOrderTracking - POST
/v1/tools/getRefundStatusgetRefundStatus - POST
/v1/tools/listMyInvoiceslistMyInvoices - POST
/v1/tools/listMyReturnRequestslistMyReturnRequests - POST
/v1/tools/listOrderslistOrders
orders:stage (4)
- POST
/v1/tools/cancelStagedOrdercancelStagedOrder - POST
/v1/tools/confirmStagedOrderconfirmStagedOrder - POST
/v1/tools/requestSupportActionrequestSupportAction - POST
/v1/tools/stageOrderstageOrder
prescriptions:read (1)
- POST
/v1/tools/listMyPrescriptionslistMyPrescriptions
prescriptions:write (3)
- POST
/v1/tools/linkPrescriptionToOrderlinkPrescriptionToOrder - POST
/v1/tools/requestPrescriptionUploadrequestPrescriptionUpload - POST
/v1/tools/submitPrescriptionsubmitPrescription
public (17)
- POST
/v1/public/checkStockpublic.checkStock - POST
/v1/public/getBlogPostpublic.getBlogPost - POST
/v1/public/getBrandProfilepublic.getBrandProfile - POST
/v1/public/getCategoriespublic.getCategories - POST
/v1/public/getDoctorProfilepublic.getDoctorProfile - POST
/v1/public/getDosageGuidepublic.getDosageGuide - POST
/v1/public/getProductpublic.getProduct - POST
/v1/public/getProductClaimpublic.getProductClaim - POST
/v1/public/getStateCitypublic.getStateCity - POST
/v1/public/listBrandspublic.listBrands - POST
/v1/public/listCouponspublic.listCoupons - POST
/v1/public/listDoctorspublic.listDoctors - POST
/v1/public/listMembershipPlanspublic.listMembershipPlans - POST
/v1/public/listServiceablePincodespublic.listServiceablePincodes - POST
/v1/public/resolvePincodepublic.resolvePincode - POST
/v1/public/searchBlogpublic.searchBlog - POST
/v1/public/searchProductspublic.searchProducts
recos:read (1)
- POST
/v1/tools/getPersonalizedRecommendationsgetPersonalizedRecommendations
wishlist:write (4)
- POST
/v1/tools/addToWishlistaddToWishlist - POST
/v1/tools/removeFromWishlistremoveFromWishlist - POST
/v1/tools/setPriceAlertsetPriceAlert - POST
/v1/tools/setStockAlertsetStockAlert