
Refinery MCP
io.github.LareLabsPublished by GitHub account LareLabsv0.1.6Updated Oct 27, 2026
Clean raw HTML into LLM-ready text before agents spend tokens.
Overview
Local MCP server that turns raw HTML or URLs into clean, LLM-ready text with word counts, via an Apify actor.
- What you can do
- Fetch a URL through the Refinery Apify actor and get back clean text plus metadata
- Clean raw HTML already fetched by the agent, crawler or browser session
- Estimate token savings by comparing raw HTML against cleaned text locally
- When to use it
- Use it when an agent has already fetched a page or holds raw HTML and you want a deterministic cleanup pass before RAG ingestion, embedding or prompting. It is not a crawler or renderer, so pair it with your own fetcher.
- Requirements
- Runs locally over stdio, typically launched with npx from the npm package; Node.js is needed. Requires an Apify API token in APIFY_TOKEN, and optionally REFINERY_ACTOR_ID to select the actor. Network access to Apify for the URL and HTML cleaning tools.
Installation
In SourceWeft
- Open Refinery MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Refinery MCP
Clean HTML before your agent burns tokens.
Refinery MCP wraps the Refinery Apify Actor as an MCP server so Claude, Cursor, and other agents can turn raw HTML or URLs into clean LLM-ready text plus word_count.
[Agent pipeline: fetch, Refinery MCP, clean text, RAG]
The Problem
Agents are getting good at fetching web pages. The problem is what they fetch:
The model does not need most of that. It needs this:
[Before and after: bloated HTML vs clean LLM-ready text and token savings]
Refinery MCP gives your agent a tool for that middle step:
Why
Agents can fetch pages, but raw HTML is noisy and expensive:
- scripts, styles, tracking tags
- nav, footers, cookie banners
- repeated links and layout markup
- huge token burn before the model sees the real content
Refinery is the middle step your agent can call before it stuffs web context into a prompt:
It is not a crawler. Use Firecrawl, Crawl4AI, Playwright, browser automation, or your own fetcher when you need rendering. Use Refinery when you already have a URL or raw HTML and want a cheap cleanup pass before the LLM.
When To Use It
Use Refinery MCP when:
- your agent already fetched a page but got bloated HTML
- you want a deterministic cleanup step before RAG ingestion
- you need
word_count/ token-ish savings before embedding - you want to separate crawling from content cleanup
Do not use it as your browser renderer, anti-bot layer, or site crawler.
Tools
clean_url
Fetches a URL through the Refinery Apify Actor and returns dataset rows with clean text and metadata.
Example input:
clean_html
Cleans raw HTML your agent, crawler, or browser session already fetched.
Example input:
Example result:
estimate_savings
Local helper that compares raw HTML vs cleaned text and estimates token savings. This does not call Apify.
Example output:
Install
Set your Apify token:
Cursor / Claude Desktop config
Use the published package:
Or run from source during development:
Smoke Test
The smoke test starts the MCP server over stdio, lists tools, and calls estimate_savings without spending Apify credits.
Example Agent Prompt
Another useful prompt:
Roadmap
- Glama listing (
glama.jsonadded — submit at https://glama.ai/mcp/servers) - mcp.so directory PR (pending)
- Hosted HTTP/SSE MCP transport
- Batch URL cleanup tool
- Glama / PulseMCP / FindMCP / mcp.so listings
- Optional direct REST wrapper for RapidAPI
- Token savings benchmark page
License
MIT
Source: README.md at commit 491e2c0
Tools
0Version history
1- v0.1.6LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts