mcp-ps-store
mcp-ps-store
PlayStation Networkアカウント自身のゲーム履歴(プレイ時間、トロフィー進捗、購入ライブラリ)を公開するMCPサーバー。AIアシスタントが推測ではなく実際のデータに基づいてゲームを推薦できるようにします。
Русская версия: README.ru.md。
概要
PSNには公開APIはありません。このサーバーはPlayStationモバイルアプリが使用しているのと同じ内部APIと通信し、ブラウザセッションから取得したNPSSOクッキーで認証します。すべてのリクエストは読み取り専用であり、アカウントに何かを書き込むことはありません。
レイアウトは階層型アーキテクチャに従っています:APIレイヤー(MCPツール)、コアレイヤー(サービス、リポジトリ、DTO)、DIコンテナ、インフラストラクチャレイヤー。
コア技術
言語: Python 3.11+
プロトコル: Model Context Protocol (
mcp)HTTPクライアント: httpx (非同期)
DIコンテナ:
dependency-injector設定:
pydantic-settings依存関係管理: Poetry
テスト: Pytest,
pytest-asyncio
Related MCP server: PersonalizationMCP
公開するツール
ツール | 目的 |
| メインのツール:時間順のトップゲーム、お気に入りのフランチャイズ、プレイスタイルの習慣(平均セッション時間、深掘り率、プラチナ率)、100%に近いゲーム、1時間で放棄したゲーム、一度も起動していない購入品をまとめたダイジェスト。推薦に関する質問はここから始めてください。 |
| フィルタ可能なゲームリスト:タイトル検索、時間/最終プレイ日/トロフィー進捗で並べ替え、プラットフォーム、時間、日付、進捗でフィルタリング。 |
| 1つのゲームのすべてのトロフィー:獲得済みかどうか、日付、レア度、所持プレイヤーの割合。 |
| すでに購入済みまたはPS Plusで入手済みのゲーム(時間がわかっているものも含む)。すでに所有しているゲームが推薦されないようにします。 |
| 最近起動したゲーム。 |
| オンラインID、PS Plus、トロフィーレベル、生涯トロフィー数。 |
| レスポンスキャッシュを削除します(PSNの応答は10分間キャッシュされます)。 |
さらに、recommend_games プロンプトも用意されています。「短めのゲーム」や「2人用協力プレイ」などのオプションの指示を受け付ける、「プロフィールを作成してゲームを推薦する」シナリオがすぐに使えます。
クイックスタート
Python 3.11+ が必要です。
1. インストール
Poetryを使用する場合:
poetry installまたは、通常のvirtualenvを使用する場合:
python3.11 -m venv .venv && .venv/bin/pip install -e .2. PSNにサインイン
ブラウザで https://www.playstation.com にサインインします。
https://ca.account.sony.com/api/v1/ssocookie を開きます。
{"npsso":"..."}が返されます。64文字の
npsso値をコピーして、以下を実行します:
poetry run psn-login PASTE_NPSSO_HEREトークンは ~/.mcp-ps-store/tokens.json に 0600 パーミッションで保存されます。
セッションの有効期間について。 アクセストークンは1時間、リフレッシュトークンは10日間しか有効ではありませんが、NPSSO自体は約2ヶ月有効です。そのため、NPSSOはトークンと一緒に保存され、リフレッシュトークンが期限切れになるとサーバーが自動的に再認証します。実際には、1回の psn-login で約60日間有効です。
3. 動作確認
poetry run psn-doctorアカウント名、表示可能なゲーム数、プレイ時間トップ5が表示されます。
クライアントの接続
Claude Code
claude mcp add ps-store -- /path/to/mcp-ps-store/.venv/bin/python -m app.mainClaude Desktop
claude_desktop_config.json に以下を追加:
{
"mcpServers": {
"ps-store": {
"command": "/path/to/mcp-ps-store/.venv/bin/python",
"args": ["-m", "app.main"],
"cwd": "/path/to/mcp-ps-store"
}
}
}Codex CLI
CodexはローカルのMCPサーバーとstdioで通信するため、同じように動作します。codex mcp add を実行するか、~/.codex/config.toml に以下を追加します:
[mcp_servers.ps-store]
command = "/path/to/mcp-ps-store/.venv/bin/python"
args = ["-m", "app.main"]
cwd = "/path/to/mcp-ps-store"Codexセッション内で /mcp で確認できます。
ChatGPT
ChatGPTはローカルプロセスを起動できません。カスタムコネクタはデベロッパーモード(設定 → アプリ → 詳細設定)で追加し、SSEまたはStreamable HTTPを話す公開HTTPSエンドポイントである必要があります。そのため、サーバーをHTTPトランスポートに切り替えて公開する必要があります:
PSN_MCP_TRANSPORT=streamable-http PSN_MCP_PORT=8000 poetry run mcp-ps-store次に、http://127.0.0.1:8000/mcp をHTTPS経由で公開します(OpenAIのSecure MCP Tunnel、または cloudflared / ngrok などのトンネルを使用)。そして、結果のURLをカスタムコネクタとして追加します。
これにより、URLを知っている誰にでもPSN履歴が公開されます。 サーバー自体には認証機能がないため、トンネルを認証の背後に置き、必要な間だけ実行し、ローカルクライアントで十分な場合はCodex CLIを優先してください。
設定
すべての設定は環境変数または .env ファイル(.env.example を参照)から読み取られます。
変数 | デフォルト | 意味 |
| — | NPSSOクッキー。 |
|
| トークンがキャッシュされる場所。 |
|
| PSNの応答が再利用される時間(秒)。 |
|
| store.playstation.com のリンクで使用されるロケール。 |
|
| PSNリクエストのHTTPタイムアウト(秒)。 |
|
|
|
|
| HTTPトランスポートのバインドアドレス。 |
|
| HTTPトランスポートのポート。 |
制限事項
プレイ時間はPS4 / PS5 / PC版のみ存在します。 PSNはPS3とVitaのゲームをトロフィーのみで報告するため、これらのゲームは
hours: nullとして表示されます。ここにはPS Storeのカタログはありません。 ストアは完全にクライアントサイドであり、そのGraphQL APIは、Sonyがデプロイのたびにハッシュを変更する永続クエリのみを受け付けます。これを維持することは現実的ではありません。推薦候補はモデル自身のゲーム知識から得られ、
psn_owned_gamesはすでに購入済みのゲームを提案しないようにします。購入ライブラリはPSNのプライベートGraphQL APIを経由します。Sonyがクエリを変更した場合、そのツールだけが動作しなくなります。他のすべては動作し続け、ダイジェストには
backlog_unavailableという注記が追加されます。プレイ時間とトロフィーはタイトルで結合されるため、トロフィーセットを共有するリマスター版はオリジナルと統合される可能性があります。エディション、プラットフォームの接尾辞、ローマ数字は意図的に正規化されます。
Alan Wake IIとAlan Wake 2は同じゲームとして扱われます。このAPIは非公式です。Sonyはいつでも変更する可能性があります。
プロジェクト構造
.
├── app/
│ ├── api/ # MCP layer: tools, prompts, serialisers, tool errors
│ │ ├── games/
│ │ ├── profile/
│ │ └── taste/
│ ├── core/ # Business logic: services, repositories, DTOs
│ │ ├── auth/ # NPSSO -> tokens, refresh, re-login
│ │ ├── games/ # Library, playtime/trophy merge, name normalisation
│ │ ├── profile/ # Account profile and trophy summary
│ │ └── taste/ # Taste digest aggregation
│ ├── di/ # DI containers and providers
│ ├── infra/adapters/ # HTTP client, token storage, TTL cache
│ ├── cli.py # psn-login, psn-doctor
│ └── main.py # MCP server entry point
├── settings/ # pydantic-settings configuration
├── tests/
│ ├── core/ # Merge and aggregation tests
│ └── factories/ # Builders for test data
└── pyproject.toml開発
poetry run pytest # unit tests; no network and no account needed
poetry run psn-doctor # live check against the signed-in accountThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to access and analyze your Hevy workout data, including workout history, exercise progress, personal records, and routines.4463MIT
- Alicense-qualityFmaintenanceEnables AI assistants to access and interact with personal data from platforms like Steam, YouTube, Bilibili, Spotify, and Reddit for personalized, context-aware interactions.58MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to directly access and analyze Strava activity data, including runs, rides, and swims, through natural language queries.410MIT
- Alicense-qualityBmaintenanceSyncs Epic/GOG/Steam game libraries with Chinese metadata, enabling AI agents to recommend games through natural language conversation.1MIT
Related MCP Connectors
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Connect your Player's Bank account to AI via Brazil's Open Finance: balances, statements, cards, inv
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/murzin-ml/mcp-ps-store'
If you have feedback or need assistance with the MCP directory API, please join our Discord server