mcp-ps-store
Enables AI assistants to access a PlayStation Network account's gaming history, including playtime, trophies, and library, to provide personalized game recommendations based on real data.
README
mcp-ps-store
MCP server that exposes a PlayStation Network account's own gaming history — playtime, trophy progress, purchased library — so an AI assistant can recommend games from real data instead of guesswork.
Русская версия: README.ru.md.
About
PSN has no public API. This server talks to the same internal API the PlayStation mobile app uses, authenticating with an NPSSO cookie taken from a browser session. Every request is a read; nothing is ever written back to the account.
The layout follows a layered architecture: an API layer (MCP tools), a core layer (services, repositories, DTOs), a DI container and an infrastructure layer.
Core technologies
- Language: Python 3.11+
- Protocol: Model Context Protocol (
mcp) - HTTP client: httpx (async)
- DI container:
dependency-injector - Settings:
pydantic-settings - Dependency management: Poetry
- Testing: Pytest,
pytest-asyncio
What it exposes
| Tool | What it is for |
|---|---|
psn_taste_profile |
The main one: a single digest — top games by hours, favourite franchises, playstyle habits (average session, share of deep dives, platinum rate), games close to 100%, games abandoned after an hour, and purchases never launched. Start here for any recommendation question. |
psn_library |
Filterable game list: search by title, sort by hours / last played / trophy progress, filter by platform, hours, dates and progress. |
psn_game_trophies |
Every trophy of one game: earned or not, date, rarity, share of players who have it. |
psn_owned_games |
What is already bought or claimed through PS Plus, with hours where known — so nothing already owned gets recommended. |
psn_recently_played |
What was launched most recently. |
psn_profile |
Online ID, PS Plus, trophy level, lifetime trophy counts. |
psn_refresh |
Drops the response cache (PSN answers are cached for 10 minutes). |
Plus a recommend_games prompt — a ready-made "build my profile and recommend games"
scenario that takes an optional steer such as "something short" or "co-op for two".
Quick start
Python 3.11+ is required.
1. Install
With Poetry:
poetry install
Or with a plain virtualenv:
python3.11 -m venv .venv && .venv/bin/pip install -e .
2. Sign in to PSN
- Sign in at https://www.playstation.com in a browser.
- Open https://ca.account.sony.com/api/v1/ssocookie — it returns
{"npsso":"..."}. - Copy the 64-character
npssovalue and run:
poetry run psn-login PASTE_NPSSO_HERE
Tokens go to ~/.mcp-ps-store/tokens.json with 0600 permissions.
About session lifetime. The access token lives an hour and the refresh token only ten
days, but the NPSSO itself lives about two months. The NPSSO is therefore stored next to
the tokens, and the server re-authenticates on its own when the refresh token dies. In
practice one psn-login lasts about 60 days.
3. Check it works
poetry run psn-doctor
It prints the account name, how many games are visible and the top five by hours.
Connecting a client
Claude Code
claude mcp add ps-store -- /path/to/mcp-ps-store/.venv/bin/python -m app.main
Claude Desktop
In 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 speaks stdio to local MCP servers, so it works the same way. Either run
codex mcp add, or add this to ~/.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"
Check it with /mcp inside a Codex session.
ChatGPT
ChatGPT cannot launch a local process. Custom connectors are added in Developer mode (Settings → Apps → Advanced) and must be a public HTTPS endpoint speaking SSE or Streamable HTTP. So the server has to be switched to HTTP transport and published:
PSN_MCP_TRANSPORT=streamable-http PSN_MCP_PORT=8000 poetry run mcp-ps-store
Then expose http://127.0.0.1:8000/mcp over HTTPS — with OpenAI's Secure MCP Tunnel, or
a tunnel such as cloudflared / ngrok — and add the resulting URL as a custom connector.
This publishes your PSN history to whoever finds the URL. The server has no authentication of its own, so put the tunnel behind auth, keep it running only while you need it, and prefer Codex CLI if a local client will do.
Configuration
All settings are read from the environment or a .env file (see .env.example).
| Variable | Default | Meaning |
|---|---|---|
PSN_NPSSO |
— | NPSSO cookie. An alternative to psn-login: if set, the server signs in by itself. |
PSN_TOKENS_PATH |
~/.mcp-ps-store/tokens.json |
Where tokens are cached. |
PSN_CACHE_TTL |
600 |
How long PSN responses are reused, in seconds. |
PSN_STORE_LOCALE |
en-us |
Locale used in store.playstation.com links. |
PSN_REQUEST_TIMEOUT |
30 |
HTTP timeout for PSN requests, in seconds. |
PSN_MCP_TRANSPORT |
stdio |
stdio, streamable-http or sse. |
PSN_MCP_HOST |
127.0.0.1 |
Bind address for the HTTP transports. |
PSN_MCP_PORT |
8000 |
Port for the HTTP transports. |
Limitations
- Playtime exists only for PS4 / PS5 / PC versions. PSN reports PS3 and Vita games
with trophies only, so they appear with
hours: null. - There is no PS Store catalogue here. The store is entirely client-side, and its
GraphQL API only accepts persisted queries whose hashes Sony rotates on every deploy —
keeping that working is not realistic. Recommendation candidates come from the model's
own knowledge of games, while
psn_owned_gamesstops it suggesting something already bought. - The purchased library goes through PSN's private GraphQL API. If Sony changes the
query, that one tool stops working; everything else keeps running and the digest gains
a
backlog_unavailablenote. - Playtime and trophies are joined by title, so a re-release can merge with the original
when they share a trophy set. Editions, platform suffixes and roman numerals are
normalised away on purpose —
Alan Wake IIandAlan Wake 2are one game. - The API is unofficial: Sony can change it at any time.
Project structure
.
├── 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
Development
poetry run pytest # unit tests; no network and no account needed
poetry run psn-doctor # live check against the signed-in account
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。