Skip to main content

PSN Blade MCP

PlayStation Network MCP server for Sidereal. Trophy tracking, game library, friends, presence, and messaging — all through token-efficient compact output designed for LLM consumption.

Why This Exists

Several PSN libraries exist (psn-api, PSNAWP, psn-php). None are MCP servers. This blade bridges that gap:

psn-api (npm) PSNAWP (Python) psn-php PSN Blade MCP
MCP protocol No No No Yes — stdio + HTTP
Token-efficient output JSON blobs Python objects PHP arrays Compact text — 3-5x fewer tokens
Auto token refresh No Yes Unknown Yes (via PSNAWP)
Rate limiting No Yes No Yes — 300/15min enforced
Write safety No gate No gate No gate Write-gated — messaging and friend ops require explicit opt-in
Contract compliance N/A N/A N/A gaming-v1 — portable across PSN, Steam, Xbox
Sidereal integration None None None Full — marketplace, packs, webhook triggers

Built on PSNAWP for its mature auth handling, rate limiting, and broadest API coverage (trophies + games + messaging + search + entitlements).

Quick Start

Install

# With uv (recommended)
uv pip install psn-blade-mcp

# Or from source
git clone https://github.com/groupthink-dev/psn-blade-mcp
cd psn-blade-mcp
make install-dev

Get Your NPSSO Token

  1. Log in at store.playstation.com in your browser
  2. Visit ca.account.sony.com/api/v1/ssocookie
  3. Copy the npsso value from the JSON response

Security: Use a dedicated PSN account for API access. Sony may restrict accounts with excessive API usage. The NPSSO token is equivalent to your password — never share it.

Configure

# Required
export PSN_NPSSO="your-npsso-token-here"

# Optional — enable messaging and friend management
export PSN_WRITE_ENABLED=true

Run

# stdio transport (default — for Claude Code, Sidereal)
psn-blade-mcp

# HTTP transport (for remote/tunnel access)
PSN_MCP_TRANSPORT=http PSN_MCP_PORT=8780 psn-blade-mcp

Claude Code Configuration

Add to ~/.claude.json:

{
  "mcpServers": {
    "psn": {
      "type": "stdio",
      "command": "psn-blade-mcp",
      "env": {
        "PSN_NPSSO": "your-npsso-token"
      }
    }
  }
}

Tools (17)

Profile & Social

  • psn_profile — User profile (name, avatar, PS Plus status)
  • psn_friends — Friends list
  • psn_presence — Online/in-game status
  • psn_search_users — Find users by name
  • psn_devices — Registered consoles

Trophies

  • psn_trophy_summary — Overall trophy level, tier, and counts
  • psn_trophies — Per-game trophy list with earned/locked status
  • psn_trophy_compare — Head-to-head trophy comparison
  • psn_trophy_groups — Base game + DLC trophy group breakdown

Games

  • psn_games — Game library with playtime stats
  • psn_games_recent — Recently played games
  • psn_entitlements — Purchase history
  • psn_game_details — Title metadata
  • psn_search_games — Search PlayStation Store

Messaging (write-gated)

  • psn_send_message — Send text message to a group
  • psn_friend_accept — Accept friend request
  • psn_friend_remove — Remove friend

Contract: gaming-v1

This MCP implements the gaming-v1 Sidereal contract — a portable interface across gaming platforms. The same contract will be implemented by steam-blade-mcp, xbox-blade-mcp, and retroachievements-blade-mcp, enabling cross-platform pack skills.

Classification Operations Status
Required profile, achievements, achievement_summary, games_played Implemented
Recommended games_recent, friends, presence, search_users Implemented
Optional achievement_compare, achievement_groups, games_purchased, devices, game_details, search_games Implemented
Gated send_message, friend_add, friend_remove Implemented (write-gated)

Architecture

psn-blade-mcp/
├── src/psn_blade_mcp/
│   ├── server.py       # FastMCP tool definitions (17 tools)
│   ├── client.py       # PSNAWP wrapper with error handling
│   ├── models.py       # Constants, write-gate, shared types
│   ├── formatters.py   # Token-efficient compact text output
│   └── auth.py         # Bearer token middleware (HTTP transport)
├── tests/              # pytest + asyncio (mocked, no live API)
├── sidereal-plugin.yaml  # Marketplace manifest
└── SKILL.md            # LLM usage guide

Key design decisions:

  • PSNAWP as client layer — proven auth handling, auto token refresh, built-in rate limiting (300 req/15min), typed exceptions for every HTTP status
  • Compact text output — all formatters return pipe-delimited strings, not JSON. 3-5x fewer tokens than raw API responses
  • Lazy client initialization — PSN auth only happens on first tool call, not server startup
  • Write-gated operations — messaging and friend management require explicit PSN_WRITE_ENABLED=true

Rate Limiting

Sony enforces ~300 requests per 15-minute window. PSNAWP's built-in rate limiter (1 request per 3 seconds via SQLite-backed bucket) prevents exceeding this. The MCP server adds no additional rate limiting — PSNAWP handles it transparently.

If rate limited, the server returns a clear error: "Rate limited by PSN — wait a few minutes before retrying."

Token Lifecycle

Token Lifetime Refresh
NPSSO Browser session (~24h) Manual — re-visit ssocookie URL
Access token ~60 minutes Automatic (PSNAWP handles transparently)
Refresh token ~2 months Automatic (PSNAWP handles transparently)

When your NPSSO expires, the server returns an auth error with instructions to regenerate it.

Development

make install-dev     # Install with dev/test dependencies
make test            # Run unit tests
make test-cov        # Tests with coverage report
make check           # Lint + format + type-check
make run             # Run the MCP server

Disclaimer

This project uses Sony's unofficial, undocumented PlayStation Network API via PSNAWP. There is no official Sony API for PSN data. Sony may change or break these endpoints at any time. Use at your own risk and consider using a dedicated PSN account.

License

MIT

Metadata

Release files for psn-blade-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psn-blade-mcp 0.2.0
File Size Uploaded
psn_blade_mcp-0.2.0.tar.gz 105.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for psn-blade-mcp 0.2.0
File Interpreter ABI Platform
psn_blade_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 121.0 kB

Release files / psn_blade_mcp-0.2.0.tar.gz

Download URL psn_blade_mcp-0.2.0.tar.gz
Size 105.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7c1d8bf7d3e236eec27bd109f152616feda3a20b33ebc41e65753c141548da3b
BLAKE2b-256 checksum
How to use checksums
6495543bc863bbae86514b9959626bc03221560068352ff8f6d897d750c819f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Release files / psn_blade_mcp-0.2.0-py3-none-any.whl

Download URL psn_blade_mcp-0.2.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be1cf5add2fda07ecd0d60091ef9fce530a4dd3eecb03dd2d4378a4145a6d018
BLAKE2b-256 checksum
How to use checksums
a71d339593ee35ec9628bd278e11cd7f489a6f36d040f5c4878a7c824e71f256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page