Skip to Content

MCP tools reference

The StyleRef MCP server exposes 15 tools. Five are anonymous and read-only; ten require a connected StyleRef account and a scope. This page documents each with its parameters and behavior.

Account-scoped tools gate on a scope (styles:read, styles:write, or extract). An anonymous call to one is answered with HTTP 401 and a WWW-Authenticate header, which is what makes an OAuth-capable client offer sign-in — see Authentication & scopes. A connected call whose token lacks the scope returns an INSUFFICIENT_SCOPE message instead.

Costs and limits

WhatFree planPro
Read tools, apply_style_to_prompt, validate_style_mdfreefree
extract_style30 credits per extraction, first generation of the saved draft includedincluded
generate_style5 creditsincluded
Requests to the server60 a minute per IP60 a minute per IP
extract_style calls5 a minute5 a minute
publish_style calls10 an hour10 an hour

Credit prices are the current ones; Plans & limits is the source of truth. A call over a rate limit returns HTTP 429 with Retry-After.

The context parameter

Every tool takes one parameter not listed in its table below: a required context string. Say in a short sentence what you are trying to accomplish with the call — for example "find a minimal style for a landing page hero". It is used to understand what agents come to StyleRef for, so the tools can be made to serve those goals better. It never changes what a tool returns.

Anonymous tools

No login. These read and apply public styles.

search_styles

Search the public gallery. The entry point for finding a style.

ParameterTypeNotes
querystring2–5 keywords: what is being made plus the look (for example fintech dashboard light). Optional.
categorystringDiscipline/category filter. Optional.
sortpopular | recentOrdering. Defaults to recent.
limitinteger 1–10Max results. Defaults to 8.

Returns compact cards — name, slug, @handle, essence, URL, hero image, and up to six palette hex colors so a client can show swatches without a second call. Feed a slug to get_style_md, get_style or apply_style_to_prompt.

Results are ranked by meaning as well as by keyword, so a query like billing dashboard with readable tables finds styles that describe the same thing in other words. Each card ends with a why line — the words that matched and in which field, or “close in meaning”.

Clients that render MCP Apps (Claude.ai, Claude Desktop, ChatGPT) also get an interactive card list. Coding agents get text only, so the result stays small in their context.

get_style

Fetch a style compiled into a ready-to-use spec.

ParameterTypeNotes
refstringRequired. A style reference — a share slug, a /share URL, or (connected) your own style’s id or /styles/{id} URL.
formatdefault | flux | midjourney | diffusion | stylemd | jsonOutput dialect. Defaults to default.
sectionsstring[]Return only these sections (for example ["colors","typography"]) to cut tokens.
compactbooleanStrip boilerplate and collapse whitespace to save tokens.

Every response carries the canonical StyleRef URL. json and stylemd return their own structure; other formats get a metadata header and attribution footer. A second text block names the style, its author and its link, for the agent to pass on to the user — it is never part of the spec.

The image dialects (flux, midjourney, diffusion) leave out writing-voice items — formality, emoji and hashtag usage, tone of copy — which only add noise to an image prompt. default and stylemd keep them.

Your own styles compile from your last generation. get_style, get_style_md and apply_style_to_prompt serve what you last generated — on styleref.io or with generate_style (below) — not your live edits. It is the same rule the REST API follows, so every surface hands out the same thing. Gallery styles are already frozen published snapshots and are unaffected. A style you have never generated returns this as the tool’s output:

This style hasn’t been generated yet. Call generate_style with the same ref first, then retry.

apply_style_to_prompt

Wrap a request in a style and return one ready-to-paste prompt for a target tool. No AI call, no credits.

ParameterTypeNotes
promptstringRequired. The raw user request to style.
refstringRequired. The style to apply.
targetchatgpt | claude | gemini | midjourney | flux | dalle | stable-diffusion | genericRequired. Sets the dialect and how the style is placed relative to the request.

get_style_md

Return a complete STYLE.md body for a style, ready to write into a repo.

ParameterTypeNotes
refstringRequired. The style to export.

The first text block is the file. A second text block names the style and its link for the agent to tell the user; it does not belong in the file.

validate_style_md

Lint a STYLE.md document. Read-only.

ParameterTypeNotes
textstringRequired. The STYLE.md document to check.

Returns valid, errors, warnings, and parsed meta. See Validate & lint.

Account-scoped tools

These require a connected StyleRef account. The scope is listed per tool.

list_my_styles · styles:read

List the styles in the connected user’s library — name, visibility, last update, link.

ParameterTypeNotes
limitinteger 1–50Max styles. Defaults to 20.

save_style · styles:write

Save (like) a public gallery style to the user’s library. Idempotent.

ParameterTypeNotes
refstringRequired. The gallery style to save.

fork_style · styles:write

Remix a public style into the user’s library as a private, editable copy with lineage back to the original.

ParameterTypeNotes
refstringRequired. The gallery style to remix.

create_style · styles:write

Author a style from structured blocks, or duplicate one of your own styles with from_ref (a plain copy, no lineage). To remix someone else’s style, use fork_style, which credits the original and respects the creator’s remix setting. You can pass both to duplicate-then-tweak. Read the styleref://schema resource first for valid block types.

ParameterTypeNotes
namestringStyle name. Optional when duplicating.
descriptionstringOne-paragraph description. Optional.
blocksarrayStyle blocks per the schema. Required unless from_ref is given.
from_refstringDuplicate one of your own styles. Other creators’ styles are refused; use fork_style instead.

Each block is { type, value } where type is a schema block type and value matches the shape the schema defines.

update_style · styles:write

Rename a style and/or add or replace blocks (a supplied block replaces the existing block of the same type). Blocks cannot be deleted through MCP.

ParameterTypeNotes
refstringRequired. One of your styles — its share slug or id. list_my_styles returns a ready-to-use ref.
namestringNew name. Optional.
set_blocksarrayBlocks to add or replace, matched by type. Optional.

generate_style · styles:write

Generate one of your own styles so get_style, get_style_md and apply_style_to_prompt can use it — the same as pressing Generate on styleref.io. Call it after create_style, update_style or fork_style. It freezes the style as it is at that moment; later edits wait for the next generation.

ParameterTypeNotes
refstringRequired. One of your styles — its share slug or id.

Costs 5 credits on the Free plan and nothing on Pro. The result states the cost and your remaining balance. Without enough credits it returns the price and a link to the pricing page, and spends nothing; if saving fails, any credits spent are refunded.

extract_style · extract

Run AI extraction to derive a structured style from any combination of sources. Async — returns an id to poll. Spends extraction credits on the Free plan (see Plans & limits).

ParameterTypeNotes
textstringA description or brand brief. To capture a project’s look: a summary with its exact colors (with role and rough share), fonts, radii, spacing, layout and mood. Raw theme code also works but extracts less well. Up to 40,000 characters.
referencestringA named aesthetic to emulate (for example “Bauhaus”).
image_urlstring (https)A public image URL.
document_urlstring (https)A public PDF or text file URL.
imagesarrayUp to 3 images sent inline: { data, media_type?, name? }, data as base64 or a data: URL. 1 MB each, 3 MB total. For screenshots the agent has locally.

Provide at least one source; multiple are fused into one style. Poll check_extraction_status for the result.

To capture a project’s existing look, send a summary of it as text plus screenshots or finished pieces as images. The text gives the exact values and the images give the proportions; the capture-project-style prompt runs the whole flow.

check_extraction_status · extract

Poll an extraction started by extract_style.

ParameterTypeNotes
extraction_idstringRequired. The id returned by extract_style.
save_as_draftbooleanOn completion, save the result as a draft style in your library.
namestringName for the draft. Defaults to the AI-suggested title.

Saving is idempotent — polling twice with save_as_draft returns the same style rather than creating a duplicate. The draft is saved already generated (included in the extraction’s price), so get_style_md and get_style can use it right away. When the extraction came from an image, that image is attached to the draft as an inspiration image, the same as in the app.

On the free plan an extraction is capped to the top style items by rank. When items are withheld, the result says so on its own line (“Free plan: the top 10 style items were returned and 12 more are locked — Pro unlocks the full extraction”) instead of returning a silently shortened list. Relay that line to the user.

publish_style · styles:write

Publish one of your styles through the moderation pipeline. public lists it in the gallery. unlisted means what it means everywhere in StyleRef: anyone with the link can open it, and it is not in the gallery. Both run an automated safety and metadata review.

ParameterTypeNotes
refstringRequired. One of your styles.
visibilitypublic | unlistedDefaults to public.
confirm_rightsbooleanMust be true — confirms you have the rights to publish.

Publishing to public requires at least 10 style items. unlisted has no minimum.

Re-publishing an already published style keeps the current public version live while the new version is reviewed. The new version replaces it only once it passes review; if it is rejected, the current version stays up.

set_style_visibility · styles:write

Lightweight visibility control: private revokes the share link; unlisted takes a listed style out of the gallery and keeps its link working. Activating a link for the first time must go through publish_style (it needs moderation).

ParameterTypeNotes
refstringRequired. One of your styles.
visibilityprivate | unlistedRequired.

Next steps

Last updated on