Search Documentation
Search for a documentation page...
MCP Server
Connect an AI agent to a Your Next Store store over the Model Context Protocol — endpoint, authentication, and the two tools that cover the whole Store API.
Every store is also reachable over the Model Context Protocol, so an agent can run store operations without you building an integration first.
Streamable HTTP, scoped to one store, able to do anything the REST API can.
Authentication
Either credential works:
- Store API key — send
Authorization: Bearer sk-…, from Settings → API → API keys. - OAuth 2.1 — connect with a YNS account. Clients discover the authorization server the standard way: an unauthenticated request answers
401withWWW-Authenticate: Bearer resource_metadata="https://yns.store/.well-known/oauth-protected-resource". Authorized apps appear under Settings → Connected apps, and disconnecting one revokes access immediately.
Tools
The whole API is exposed through two tools rather than one per endpoint, which keeps the tool list small enough to stay in an agent's context:
| Tool | Use |
|---|---|
search_api | Discover endpoints. Returns a compact index of { method, path, operationId, summary }, optionally filtered by a substring query. Read-only. Call this first when you don't know the exact path. |
execute_api | Call one /api/v1/* endpoint. GET reads; POST, PUT, PATCH and DELETE write. Substitute path parameters inline and pass body as a raw JSON object. |
Nothing is evaluated server-side — the agent composes the calls in its own loop.
Storefront MCP server
A separate, unauthenticated MCP server runs on each storefront at https://<your-store-domain>/api/mcp, meant for shopping assistants rather than administration. It has two tools: search (find products by name or summary, returning each variant with price, image and a direct buy link) and fetch (get one variant by id).