rakuten-mcp
README.md
# @sohampatwardhan/rakuten-mcp
[](https://www.npmjs.com/package/@sohampatwardhan/rakuten-mcp)
Unofficial read-only MCP server for public [Rakuten](https://www.rakuten.com/f/allstores) cash back rates. It looks up stores by name, lists the highest public rates, and lists a category. Every result includes the shop URL.
This server does not sign in, does not click or activate offers, and does not read account data. Rates are whatever Rakuten shows to a signed-out visitor. They change.
## Tools
| Tool | What you get |
| --- | --- |
| `search_stores` | Stores whose names contain `query` (`nike`, `kate spade`). Cash back text, the previous rate when Rakuten still shows one, a structured amount and type, logo, and shop URL. |
| `get_store` | One store by name, shop slug, `/shop/<slug>`, or `https://www.rakuten.com/shop/<slug>`. A merchant id works after that store was already returned in this process. |
| `list_top_cashback` | The public catalog in Rakuten's cash-back order. |
| `list_category` | One category in that same order. Names and ids come from `list_categories`. |
| `list_categories` | Category names and ids, including All. |
`limit` is at most 36, which is one page. When the tool returns a full page and Rakuten has another, the JSON includes `next_cursor`. Pass that cursor back to read the next page. A short page sets `has_more` and leaves `next_cursor` null; raise `limit` instead of skipping the rest of the page.
`search_stores` uses Rakuten's `term:` filter. It is a case-insensitive substring (`ray` matches Ray-Ban and Caliray). It is not a separate search index.
### Examples
Find Nike:
```json
{ "name": "search_stores", "arguments": { "query": "nike" } }
```
One shop URL:
```json
{ "name": "get_store", "arguments": { "store": "https://www.rakuten.com/shop/nike" } }
```
Highest public rates:
```json
{ "name": "list_top_cashback", "arguments": { "limit": 10 } }
```
Clothing:
```json
{ "name": "list_category", "arguments": { "category": "Clothing", "limit": 10 } }
```
A store looks like:
```json
{
"merchant_id": "9528",
"name": "Nike",
"cash_back": "10% Cash Back",
"previous_cash_back": "was 2%",
"reward": { "amount": 10, "type": "Percentage", "text": "10.00% Cash Back", "tiered": false, "up_to": false },
"url": "https://www.rakuten.com/shop/nike",
"slug": "nike",
"logo": "https://static.rakuten.com/img/store/9528/nike-mark-fullcolor-9528@4x.png"
}
```
`reward.type` is `Percentage` or `Fixed`. `amount` is the percent, or the dollar amount for a fixed reward. `up_to` means the tile said "Up to". `previous_cash_back` is Rakuten's "was …" text, or null.
Prompts that work once the server is connected:
- "What is the Rakuten cash back at Nike, and what was it before?"
- "Which stores on the public list are paying the most right now?"
- "Show clothing stores with the highest Rakuten cash back."
## Setup
Requires Node.js 20 or newer.
```bash
npx -y @sohampatwardhan/rakuten-mcp@latest
```
Stdio is the default. Logs go to stderr so they stay off the JSON-RPC stream. The MCP server name is `rakuten-mcp`.
### Cursor
Add this to `~/.cursor/mcp.json` or the project's `.cursor/mcp.json`:
```json
{
"mcpServers": {
"rakuten": {
"command": "npx",
"args": ["-y", "@sohampatwardhan/rakuten-mcp@latest"]
}
}
}
```
### Claude Desktop
The same `mcpServers` block goes in the desktop config:
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
- Linux: `~/.config/Claude/claude_desktop_config.json`
Restart Claude Desktop after saving.
### Claude Code
```bash
claude mcp add rakuten -- npx -y @sohampatwardhan/rakuten-mcp@latest
```
### VS Code
Create `.vscode/mcp.json`:
```json
{
"servers": {
"rakuten": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@sohampatwardhan/rakuten-mcp@latest"]
}
}
}
```
Other MCP clients use the same stdio command: `npx -y @sohampatwardhan/rakuten-mcp@latest`.
### Streamable HTTP
HTTP mode is stateless and has no authentication. Bind it to localhost.
```bash
npx -y @sohampatwardhan/rakuten-mcp@latest --http --port 3333
```
The MCP endpoint is `http://127.0.0.1:3333/mcp`. A client config looks like:
```json
{
"mcpServers": {
"rakuten": {
"url": "http://127.0.0.1:3333/mcp"
}
}
}
```
`GET /health` returns `ok`.
### MCP Inspector
```bash
npm install
npm run build
npx @modelcontextprotocol/inspector node dist/cli.js
```
## Data source
The client calls one public endpoint:
`GET https://www.rakuten.com/feedapi/v1/regions/USA/topic?topicId=16867&sort=cashback_desc`
The first page of that endpoint is the same 36 stores embedded in `__NEXT_DATA__` on `https://www.rakuten.com/f/allstores`. The HTML document also carries member data, so this server does not download it. Later pages use the topic `cursor`. The required header is `X-Platform: DESKTOP_WEB`. Without it Rakuten returns 400.
Checked against the live site on 2026-11-30:
- `filter=term:` is a real case-insensitive substring search. Search does not download the full catalog (about 3,203 stores, 36 per page).
- `filter=category:<id>` pages one category. `category` and `term` are not sent together. A combined `category|term` filter is ignored or rejected.
- `filter=merchant_id:` and `filter=store_id:` are ignored. A numeric merchant id is resolved only from stores this process has already seen. Pass a name or shop URL otherwise.
- `tile_length` stays the full catalog size on filtered pages, so it is not used as a match count.
- The category `selected` flag stays on All even when a category filter is applied. The server reports the category it requested.
- Sort is always `cashback_desc`, including fixed-dollar rewards such as `$50 Cash Back` (`reward.type` `Fixed`).
- The viewer on these responses is `UnauthenticatedViewer`.
Shop URLs look like `https://www.rakuten.com/shop/<slug>`. Opening one in a browser is a normal store page. This server never activates the offer.
## Polite use
The client keeps one catalog request in flight and waits at least one second between starts. Responses are cached in memory for 30 minutes. The User-Agent is `rakuten-mcp/<version> (+https://github.com/sohampatwardhan/rakuten-mcp)`.
| Variable | Default | Purpose |
| --- | --- | --- |
| `RAKUTEN_API_URL` | `https://www.rakuten.com` | Site origin |
| `RAKUTEN_MIN_INTERVAL_MS` | `1000` | Minimum gap between catalog calls |
| `RAKUTEN_CACHE_TTL_MS` | `1800000` | Memory cache lifetime |
| `RAKUTEN_CACHE` | enabled | Set to `0` to disable the memory cache |
Do not point this at a lower interval for bulk downloads. The public catalog is a shared site.
## Disclaimer
This project is not affiliated with, endorsed by, or sponsored by Rakuten. Rakuten and its cash back program are their marks. Store names, rates, and logos belong to their owners. Confirm a rate on Rakuten before you buy. Nothing here is a promise of cash back.
## License
MIT. See [LICENSE](LICENSE).
## Development
```bash
npm install
npm run lint
npm test
npm run typecheck
npm run build
node dist/cli.js --help
npm run smoke
```
`npm test` uses recorded fixtures and does not call Rakuten. `RAKUTEN_LIVE=1 npm test` also runs `test/live.test.ts` against the public catalog, one request per second. CI does not set that variable.
`npm run lint` checks TSDoc comments with `eslint-plugin-tsdoc`. CI runs lint, typecheck, test, build, and smoke.
`prepublishOnly` compiles TypeScript into `dist/` before the package is packed.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues