rakuten-rms-mcp-remote

rakuten-rms-mcp-remote

Remote MCP host for Rakuten RMS, providing Streamable HTTP endpoint with OAuth 2.1/PKCE and Bearer auth. It enables MCP clients like ChatGPT and Claude to access Rakuten RMS tools via natural language.

Category
Visit Server

README

rakuten-rms-mcp-remote

rakuten-rms-mcp の Remote MCP ホストです。

  • Transport: Streamable HTTP(/mcp)
  • Auth: OAuth 2.1 + PKCE(共有パスコード)および任意の 静的 Bearer
  • ツール実装はコアパッケージを依存として利用(このリポに RMS ロジックは置きません)

Claude.ai / ChatGPT などの「URL を貼る」系クライアント向けです。Cursor のローカル stdio はコア側を使ってください。


必要条件

  • Node.js 20+
  • RMS の serviceSecret / licenseKey
  • 次のどちらか(または両方)
    • RMS_MCP_OAUTH_PASSCODE … OAuth 認可画面の共有パスコード
    • RMS_MCP_API_KEY … Authorization: Bearer … を直接書けるクライアント用

セットアップ

git clone https://github.com/moneyan9/rakuten-rms-mcp-remote.git
cd rakuten-rms-mcp-remote
cp .env.example .env   # 値を編集
npm install
npm run build
npm start

ローカルではコア未公開でも動くように、必要なら package.json の依存を一時的に:

"rakuten-rms-mcp": "file:../rakuten-rms-mcp"

に差し替えて npm install してください。


エンドポイント

Path 説明
GET /health 存活確認
GET /.well-known/oauth-authorization-server OAuth AS メタデータ
GET /.well-known/oauth-protected-resource Protected Resource メタデータ
GET /.well-known/oauth-protected-resource/mcp 同上(RFC 9728 path-aware)
POST /oauth/register Dynamic Client Registration
GET/POST /oauth/authorize パスコード入力 → auth code
POST /oauth/token code → access token(PKCE)
ALL /mcp MCP Streamable HTTP(Bearer 必須・SDK requireBearerAuth)

ChatGPT / Claude への接続

  1. このサーバを HTTPS で公開(Railway / Render / Fly など)
  2. ALLOWED_HOSTS に公開ホスト名を入れる(例: my-app.up.railway.app)
  3. ChatGPT: Developer Mode → カスタムコネクタに https://…/mcp を追加(OAuth)
  4. Claude.ai: Connectors → カスタムコネクタに同様に追加
  5. 認可画面で RMS_MCP_OAUTH_PASSCODE を入力

ヘッダを書けるクライアント(一部の MCP クライアント)向け:

{
  "mcpServers": {
    "rakuten-rms": {
      "url": "https://YOUR_HOST/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_RMS_MCP_API_KEY"
      }
    }
  }
}

環境変数

変数 必須 説明
RMS_SERVICE_SECRET はい RMS serviceSecret
RMS_LICENSE_KEY はい RMS licenseKey
RMS_SHOP_ID 任意 問い合わせ返信時
PORT 任意 デフォルト 8000
ALLOWED_HOSTS 推奨 カンマ区切りホスト名(公開時必須級)
RMS_MCP_OAUTH_PASSCODE OAuth 時 共有パスコード
RMS_MCP_API_KEY 任意 静的 Bearer
RMS_MCP_OAUTH_STORE_PATH 任意 トークン永続化パス

注意: 現状は 1 プロセス = 1 店舗の RMS 鍵(サーバ env)です。個人事業主ごとの鍵分離はまだありません。


Vercel

Express アプリとしてデプロイします(src/app.ts の default export)。

  1. このリポを Vercel に Import(または npx vercel)
  2. Environment Variables に少なくとも次を設定
    • RMS_SERVICE_SECRET / RMS_LICENSE_KEY
    • RMS_MCP_OAUTH_PASSCODE(自分で決めた共有パスコード)
  3. Deploy 後の MCP URL: https://<project>.vercel.app/mcp
  4. ChatGPT カスタムコネクタにその URL を追加し、認可画面でパスコードを入力

ALLOWED_HOSTS は任意(未設定でも VERCEL_URL 系を自動許可)。カスタムドメイン利用時は本番ホスト名を追加してください。

OAuth トークンはサーバレス上では原則 /tmp(インスタンス内)。コールドスタートで消えることがあるので、再認可が必要になる場合があります。


開発

npm run typecheck
npm test
npm run build

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured