
pinin
io.github.UmbertoBiz/pinin
Restore, colorize and upscale old photographs. Enterprise plan required, one credit per restoration.
Documentation
Pinin MCP Server
Photo restoration for AI agents — repair, colorize and upscale old photographs from Claude, Cursor, VS Code or any MCP client.
Quick start · Tools · Clients · API docs · Requirements
What this is
Pinin repairs damaged photographs: dust, scratches, tears, fading, mould staining. It also colorizes black-and-white photographs and upscales or deblurs soft scans.
This package connects a Model Context Protocol (MCP) client to Pinin's hosted MCP endpoint at https://pinin.ai/api/mcp. Ask your agent to restore a photo and it queues a job, follows it to completion and hands back a signed download link.
You: Restore https://example.com/scan.jpg and give me the link when it's done.
Agent: pinin_restore_photo → job 887b66ff… · pending · 1 credit
pinin_get_restoration → processing · retry_after 5
pinin_get_restoration → completed in 12s
pinin_download_restoration → https://images.pinin.ai/…?exp=…&sig=…
This repository is the pipe, not the engine. Every tool call is an HTTPS request to Pinin's own endpoint, made with your key. Modes, credits, scopes, rate limits and retention are all enforced in one place, by the service.
Quick start
Two things are needed: an Enterprise Pinin plan and an API key.
- Create the key at https://pinin.ai/developers → API keys. A key can only be minted on an Enterprise plan, and every call additionally requires a positive credit balance.
- Give the key to your client. It is the only configuration.
Claude Desktop
Edit claude_desktop_config.json (~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows):
{
"mcpServers": {
"pinin": {
"command": "npx",
"args": ["-y", "pinin-mcp"],
"env": { "PININ_API_KEY": "pnn_live_your_key_here" }
}
}
}
Restart Claude Desktop, then ask it to restore a photograph.
Claude Code, Cursor, VS Code, Cline, Continue
Each client has its own config shape. Copy-paste versions live in docs/clients.md, and the JSON files themselves in examples/.
# Claude Code
claude mcp add pinin --env PININ_API_KEY=pnn_live_your_key_here -- npx -y pinin-mcp
Any client that speaks HTTP
The endpoint is a stateless Streamable HTTP MCP server. Point the client at it and send the key as a bearer token:
curl -s https://pinin.ai/api/mcp \
-H "Authorization: Bearer $PININ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
X-API-Key: pnn_live_… works too, for clients that own the Authorization header.
Tools
Eight, fixed. A client cannot reach anything the API does not already publish.
| Tool | What it does | Cost |
|---|---|---|
pinin_restore_photo | Queue one photograph, or a batch of up to 100. Takes a public https URL or inline base64. Supports seed, idempotency_key and dry_run. | 1 credit per image |
pinin_get_restoration | Status, charge state, expires_at, signed image URLs. Returns retry_after while it runs. | free |
pinin_list_restorations | Cursor-paginated history; updated_since reconciles everything that changed. | free |
pinin_download_restoration | The signed URL for the restored file — or image: "original" for the source. Valid at least an hour. | free |
pinin_cancel_restoration | Cancel a job that has not started. Nothing was charged, so nothing is refunded. | free |
pinin_get_account | Plan, credit balance, batch cap, concurrency, the calling key's ceiling. | free |
pinin_get_usage | Requests, errors, restorations and credits per day, and the month by key. | free |
pinin_list_modes | The five restoration modes this account can request. | free |
Full reference — arguments, responses, failure modes: docs/tools.md.
Modes
| Mode | Use it for |
|---|---|
all-in-one | Everything at once — damage repair, colour, sharpening. The default. |
dust-scratch | Speckles, tears, fold lines, emulsion damage. |
colorize | Black-and-white to colour. An interpretation, not a record. |
deblur-upscale | Soft focus, motion blur, low resolution. |
upscale-only | Enlarge without changing anything else. |
How it works
MCP client ──stdio──▶ pinin-mcp (one file, no deps) ──HTTPS──▶ pinin.ai/api/mcp ──▶ api-v1 ──▶ models
The local process is a bridge: it reads JSON-RPC on stdin, forwards each message to the hosted endpoint with your key, and writes the answer to stdout. Nothing else — deliberately. A bridge that reimplemented the tools would be a second implementation to keep in sync, and a second place for a credit check to go missing.
The hosted endpoint decides nothing about pricing or entitlement. api-v1 does, once, for the REST API, the webhooks and every integration (this server, n8n, Zapier, Make). Consequences worth knowing:
initializeandtools/listare answered locally, fromtools.snapshot.json— a copy of the hosted catalogue committed beside the bridge. The server therefore starts and lists its eight tools with no key at all, which is what lets a directory or a CI job containerise it, and it still picks up a tool added upstream the moment a key is present. Onlytools/callneeds the key, and a missing one comes back as a-32001message namingPININ_API_KEYrather than a process that exits with "Connection closed".- A refusal comes back in the API's own words —
insufficient_credits,api_requires_enterprise,invalid_api_key— not rewritten into "something went wrong". - Your key is never logged, never echoed, never stored. It lives in the client's environment and in one request header.
Requirements
| Plan | Enterprise. A key cannot be created on another plan, and a request cannot be served without an active subscription. |
| Credits | One per image, charged when the job settles, refunded when it fails. dry_run prices a request without spending. |
| Node | ≥ 18.17 for the local bridge (fetch, AbortSignal.timeout). Docker and raw HTTP clients skip this. |
| Image source | A public https URL, or inline base64 under a few MB. |
Pricing, credits and the exact ceilings: docs/pricing-and-limits.md.
Security
- The key is a credential. Keep it on a server or in the client's environment — not in a browser bundle, a repository or a screenshot. Keys are shown once at creation.
- Your photographs never touch this repository. The bridge moves JSON on a pipe and makes HTTPS calls. It writes no files, caches nothing, keeps no queue.
- Retention is 30 days from submission. Every job states the moment as
expires_at; an expired job answers410 restoration_expiredrather than vanishing. - The endpoint is stateless. No sessions, no SSE, no server-side registry of clients.
GETandDELETEanswer405withAllow: POST, OPTIONS. - Scopes are yours to set. A key holds any combination of
restorations:read,restorations:write,usage:read,webhooks:manage,keys:manage. Give an agent's key the narrowest set that works, plus a monthly credit cap.
Reporting a vulnerability: SECURITY.md.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
401 and "That is not a Pinin API key" | The value does not start with pnn_live_. | Copy the key again; the prefix is part of it. |
401 invalid_api_key | Revoked, mistyped, or from another project. | Mint a new one. Revocation applies on the next request. |
401 missing_api_key | No key reached the endpoint. | Set PININ_API_KEY, or send Authorization: Bearer … / X-API-Key: …. |
403 api_requires_enterprise | Not on Enterprise, or the subscription is inactive. | Check the plan and its status. |
402 insufficient_credits | Balance is zero. | Top up. pinin_get_account and pinin_get_usage stay readable while blocked, on purpose. |
429 | The key's requests-per-minute ceiling. | Back off; the response carries retry-after. |
410 restoration_expired | The 30-day window closed. | Submit the image again. |
| A tool returns an error result with no protocol error | Tool failures are results, not JSON-RPC errors. | Read the result text — it carries the API's code and request_id. |
More: docs/errors.md.
FAQ
Is the MCP server free? The software is — MIT, no telemetry, no call-home. The service is not: restorations run on Enterprise plans and cost one credit per image.
Does it work on a free or Pro plan?
No. 403 api_requires_enterprise is the answer at any other tier, in code rather than in policy text.
Can I batch? Yes — up to 100 images per call, inside your plan's batch cap (500 on Enterprise) and 24 jobs in flight. Twenty photographs cost twenty credits.
What happens if a restoration fails? The credit comes back automatically. A credit is charged only when a job settles successfully.
Where do my photos go? Pinin fetches the image you point at, restores it, and stores the original and the result for 30 days. This repository stores nothing.
Which clients are tested? Claude Desktop and Claude Code, Cursor and VS Code over stdio, and Streamable HTTP for everything else — docs/clients.md has the configs.
Can I self-host? The server, yes: it is one file with no dependencies. The models are not in this repository, and the endpoint is Pinin's.
Documentation
| docs/tools.md | Every tool: arguments, responses, errors |
| docs/clients.md | Per-client setup, Docker, remote HTTP |
| docs/errors.md | Error codes and what to do about them |
| docs/pricing-and-limits.md | Credits, plans, quotas, retention |
| GLAMA.md | Glama listing settings, remote and Docker |
| pinin.ai/developers/docs | The REST API behind this server |
| pinin.ai/openapi.json | OpenAPI 3.1 description |
| pinin.ai/developers | Console, keys, usage |
Other integrations
The same API, with the same gate:
- n8n — community node
n8n-nodes-pinin: restore, poll, cancel and download as workflow steps. - Zapier — trigger on a finished restoration, plus actions for restore, get, cancel and usage.
- Make — importable scenario blueprints on the plain HTTP module.
- REST — https://pinin.ai/developers/docs.
Where to find it
The endpoint is registered with the official MCP Registry and indexed by the directories below. The registry entry carries both transports, so a client can install the npm package or connect to the remote URL from the same record.
| Official MCP Registry | io.github.UmbertoBiz/pinin — remote + npm, current version |
| npm | pinin-mcp — published from this repository over OIDC, with provenance |
| Glama | connector · server page |
| mcptry | Pinin — uptime checks, browser playground, ranking |
| mcpservers.org | Submitted — free tier, in review |
| awesome-mcp-servers | PR #21169 |
| awesome-remote-mcp-servers | PR #6506 |
| PulseMCP | Ingests the official registry; listings appear there on the next crawl |
Contributing
Issues and pull requests are welcome — CONTRIBUTING.md has the test command and the two rules that matter (never log a key, never reimplement a tool). Security reports go through SECURITY.md, never a public issue.
License
MIT © Pinin SRL. The licence covers the code here, not the service or the name: Pinin is a proprietary hosted service, and using the API requires an account and is governed by https://pinin.ai/terms-conditions.
pinin-mcpnpm install pinin-mcp