Docs

MCP server

Near Fine’s search is open to assistants, free, with no account or API key. One call asks every bookseller serving the buyer’s country and returns their offers together. Assistants can also set a person’s alerts once the person signs in.

Server

URL
https://nearfine.com/mcp
Transport
Streamable HTTP, stateless, with JSON responses
Authentication
None to search or send feedback. The alert tools sign the person in with OAuth.
Tools
search_books and list_sources, both read-only, set_alert, list_alerts and cancel_alert, and send_feedback
Limits
Shared with the API: see Limits.

To connect ChatGPT, Gemini, Claude or Claude Code, follow the steps on AI assistants.

Tools

search_books

query
Required. An ISBN-10 or ISBN-13, hyphens and spaces allowed, or title and author keywords, with any criteria.
country
The buyer’s country, as an ISO 3166-1 alpha-2 code such as GB. Defaults to US.
seller
Optional. A list of booksellers whose offers alone to return, each named as the offers’ seller names it or by part of the name, so ["abe"] is every AbeBooks site, or by its own name where that’s in another script, as ["교보"] for Kyobo Book Centre. A whole name means that seller alone.

Returns the same JSON as the search API, each offer with its edition’s publisher and year where the bookseller gives them, as structured content and as text, but leaves out offers with a match below 0.5 and gives their number as doubtful. It adds cover, an image of the book matched best, served from nearfine.com. Called with a token whose grant has the favourites scope, it marks each offer and source from one of the person’s favourite booksellers favourite: true; the order doesn’t change.

Chat apps that support MCP Apps draw a card under the call, from the template at ui://nearfine/results-card: the cover and the cheapest offers in each format, with Buy buttons.

list_sources

country
Optional. Lists only the sources serving buyers there.

Returns each source’s name, its bookseller under seller (in its own script too where that isn’t Latin, as in 교보문고 (Kyobo Book Centre)) and the countries it serves, or all countries, with any it leaves out under except. With a token that carries the favourites scope, the person’s favourite booksellers are marked favourite: true.

set_alert

query
Required, as for search_books, with any criteria the alert should hold out for.
country
Required. The country the book has to reach.

Sets an alert for the signed-in person, or keeps the one already set on that query and country. Returns it as alert, with its id, status and url on Near Fine, and the person’s plan: alerts_allowed, alerts_in_use, how often each is checked and plans_url. A full plan comes back as a tool error.

list_alerts

Returns the person’s alerts, finds first, each with id, query, country, status, set_at, checked_at, expires_at, url, how many finds it has emailed and last_found_at and, once it has fired, the cheapest listing it last found: its title, seller, condition, price, shipping, total and url, in the person’s currency. Then their plan.

status
pending until its first check notes what’s listed already, which never counts; live while it watches, as a Pro alert does after a find; found once it has emailed a find and stopped; ended when the person got the book or stopped it; expired after six months; paused when the plan has room for fewer alerts.

cancel_alert

id
Required. The alert’s id.

Deletes the alert and returns it as cancelled, with the person’s plan.

send_feedback

message
Required. The feedback as the person approved it, up to 4,000 characters.
email
Optional. An address for our reply, only if the person chose to give one.
query
Optional. The search it’s about, as passed to search_books.
search_url
Optional. The search_url from search_books it’s about.

Emails the feedback to the people who run Near Fine, marked as sent by an assistant, and by which one where the person signed in. It needs no sign-in. Send it only when the person asks, or agrees when offered, after showing them the exact message, and with no personal details but an address they chose to give. Returns what was sent as sent. It takes five an hour from a signed-in person and twenty from an IP otherwise.

Alerts

An alert watches a search for six months and emails its owner once, when a new listing turns up with everything the query asks for. A Pro alert keeps watching after a find and emails again when newer listings turn up. Assistants set them with set_alert once the person signs in. The API can’t. On the website, a signed-in person searches and chooses Alert me, so the search_url works too. On a search for the book alone, Alert me sets a price cap just under the cheapest copy listed. On Pro, the alerts page also imports a want list, a query a line, criteria and all.

Sign-in

The alert tools act for a person, so they need an OAuth 2.1 access token for the MCP server. Searching never does, and nothing asks for one until an alert tool is called. ChatGPT, Claude and Claude Code do all of this themselves.

Challenge
A call to an alert tool without a token, or any call with a token that’s expired or revoked, gets a 401 whose WWW-Authenticate header names resource_metadata and scope="alerts favourites".
Resource
The MCP server’s URL as the assistant was given it, such as https://nearfine.com/mcp, described at /.well-known/oauth-protected-resource/mcp on the same host (RFC 9728). Send it as resource when authorizing and asking for tokens. Tokens work on that server alone.
Authorization server
https://nearfine.com, described at /.well-known/oauth-authorization-server (RFC 8414).
Registration
Dynamic, at /oauth/register (RFC 7591), for public clients. Redirect URIs must be https, or http on localhost, 127.0.0.1 or [::1], which match on any port. Every client is public. One nobody signs in with goes after 90 days.
Authorization
Authorization code with PKCE (S256) at /oauth/authorize. The scopes are alerts, which the alert tools need, and favourites, which lets the search tools mark the person’s favourite booksellers; a request that names none gets both, and every grant has alerts. The person signs in with a code we email them, then allows the client, who is told what each scope lets it see. Answers carry iss (RFC 9207).
Tokens
At /oauth/token. Codes last a minute and work once. Access tokens last an hour. Refresh tokens last 90 days and work once: each refresh returns a new one. A retry within a minute gets a fresh pair, and an old one used again after that revokes the connection.
Revocation
At /oauth/revoke (RFC 7009), as disconnecting the assistant from the account page does.