Repository avatar
Other Tools
v1.1.3
active

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.

CI npm Node License: MIT Model Context Protocol Glama mcptry

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.

  1. 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.
  2. 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.

ToolWhat it doesCost
pinin_restore_photoQueue 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_restorationStatus, charge state, expires_at, signed image URLs. Returns retry_after while it runs.free
pinin_list_restorationsCursor-paginated history; updated_since reconciles everything that changed.free
pinin_download_restorationThe signed URL for the restored file — or image: "original" for the source. Valid at least an hour.free
pinin_cancel_restorationCancel a job that has not started. Nothing was charged, so nothing is refunded.free
pinin_get_accountPlan, credit balance, batch cap, concurrency, the calling key's ceiling.free
pinin_get_usageRequests, errors, restorations and credits per day, and the month by key.free
pinin_list_modesThe five restoration modes this account can request.free

Full reference — arguments, responses, failure modes: docs/tools.md.

Modes

ModeUse it for
all-in-oneEverything at once — damage repair, colour, sharpening. The default.
dust-scratchSpeckles, tears, fold lines, emulsion damage.
colorizeBlack-and-white to colour. An interpretation, not a record.
deblur-upscaleSoft focus, motion blur, low resolution.
upscale-onlyEnlarge 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:

  • initialize and tools/list are answered locally, from tools.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. Only tools/call needs the key, and a missing one comes back as a -32001 message naming PININ_API_KEY rather 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

PlanEnterprise. A key cannot be created on another plan, and a request cannot be served without an active subscription.
CreditsOne 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 sourceA 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 answers 410 restoration_expired rather than vanishing.
  • The endpoint is stateless. No sessions, no SSE, no server-side registry of clients. GET and DELETE answer 405 with Allow: 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

SymptomCauseFix
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_keyRevoked, mistyped, or from another project.Mint a new one. Revocation applies on the next request.
401 missing_api_keyNo key reached the endpoint.Set PININ_API_KEY, or send Authorization: Bearer … / X-API-Key: ….
403 api_requires_enterpriseNot on Enterprise, or the subscription is inactive.Check the plan and its status.
402 insufficient_creditsBalance is zero.Top up. pinin_get_account and pinin_get_usage stay readable while blocked, on purpose.
429The key's requests-per-minute ceiling.Back off; the response carries retry-after.
410 restoration_expiredThe 30-day window closed.Submit the image again.
A tool returns an error result with no protocol errorTool 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.mdEvery tool: arguments, responses, errors
docs/clients.mdPer-client setup, Docker, remote HTTP
docs/errors.mdError codes and what to do about them
docs/pricing-and-limits.mdCredits, plans, quotas, retention
GLAMA.mdGlama listing settings, remote and Docker
pinin.ai/developers/docsThe REST API behind this server
pinin.ai/openapi.jsonOpenAPI 3.1 description
pinin.ai/developersConsole, keys, usage

Other integrations

The same API, with the same gate:

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 Registryio.github.UmbertoBiz/pinin — remote + npm, current version
npmpinin-mcp — published from this repository over OIDC, with provenance
Glamaconnector · server page
mcptryPinin — uptime checks, browser playground, ranking
mcpservers.orgSubmitted — free tier, in review
awesome-mcp-serversPR #21169
awesome-remote-mcp-serversPR #6506
PulseMCPIngests 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.


MCP server · Model Context Protocol · photo restoration · image restoration API · colorize black and white photos · upscale old photos · Claude Desktop · Cursor · VS Code
NPM
pinin-mcp
Install Command
npm install pinin-mcp

Remote