feat: add Klarna Agentic Product Protocol adapter for US product search - #34
Open
BuyWhere wants to merge 2 commits into
Open
feat: add Klarna Agentic Product Protocol adapter for US product search#34BuyWhere wants to merge 2 commits into
BuyWhere wants to merge 2 commits into
Conversation
added 2 commits
June 25, 2026 10:43
Merges Klarna US search results into BuyWhere MCP server when KLARNA_API_TOKEN env var is configured: - src/klarna-adapter.ts: thin wrapper around Klarna agentic API - searchKlarna() — US product search - getKlarnaOffers() — product offer lookup - pickBestOffer() — best-price picker - formatKlarnaForBuyWhere() — formats Klarna results to BuyWhere shape - src/index.ts: three integration points - search_products: merges Klarna results inline for US queries - get_product: routes krn:kpdc:product:* IDs to Klarna API - find_best_price: Klarna first short-circuit for US queries Built on Klarna Agentic Product Protocol
- README: Klarna integration section with badge, config docs, tool descriptions - RELEASE_NOTES: v1.1.0 entry covering all Klarna changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Klarna Agentic Product Protocol adapter that merges US product search results into BuyWhere MCP when the
KLARNA_API_TOKENenv var is configured.Changes
Code
src/klarna-adapter.ts— thin wrapper around Klarna agentic API withsearchKlarna(),getKlarnaOffers(),pickBestOffer(), andformatKlarnaForBuyWhere()src/index.ts— three integration points:search_products: merges Klarna results inline for US queries (withsource: Klarna (US)provenance)get_product: routeskrn:kpdc:product:*IDs to Klarna APIfind_best_price: Klarna-first short-circuit for US queries when BuyWhere has no resultsDocumentation
README.md— Added Klarna integration section with configuration docs and "Built on Klarna Agentic Product Protocol" badgeRELEASE_NOTES.md— v1.1.0 entryBuilt on Klarna Agentic Product Protocol
This integration uses the Klarna Agentic Product Protocol API (v2) for US product search. See https://docs.klarna.com/agentic-product-protocol for details.
Testing
Requires
KLARNA_API_TOKENenv var to activate. Non-US queries are unaffected (Klarna merge only activates forcountry=usorregion=us).