
Fitter
io.github.PxyUp由 GitHub 账号 PxyUp 发布v1.8.3更新于 Oct 24, 2026
Turn any website or API into structured JSON with LLM-authored declarative scraping configs.
概览
Fitter MCP 让助手编写并运行 Fitter 抓取配置,把网站和 API 转成结构化 JSON,所有抓取都在本地完成。
- 可以做什么
- 运行内联传入、从本地 JSON/YAML 文件读取或从 HTTP(S) URL 下载的配置,以 JSON 返回提取的数据,并可将可选输入值注入配置。检查 URL 并返回精简的结构概要和候选选择器或 JSON 路径,可选择用无头浏览器渲染客户端渲染的单页应用。在不执行的情况下校验配置,检查结构、响应类型、连接器数据源和模型。获取完整配置格式的精简参考,同时以 MCP 资源形式提供,使模型无需外部文档即可编写配置。
- 适用场景
- 适合让助手从缺少便捷接口的网页或 API 中提取结构化数据,或构建并迭代可复用的提取配置,包括嵌套 API 调用和浏览器渲染的页面。
- 运行要求
- 作为本地 stdio 进程运行,可通过一键 .mcpb 包、原生二进制或 Docker 镜像安装。HTTP、静态和文件连接器开箱即用;浏览器配置需要 Playwright 浏览器,可在首次使用时下载,或使用内置浏览器的 playwright 镜像。可选 FITTER_PLUGINS 指向插件目录。托管 HTTP 模式使用 FITTER_MCP_HTTP_ADDR 和 FITTER_MCP_AUTH_TOKEN。
安装
在 SourceWeft 中
- 打开 控制台中的 Fitter,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Fitter — web data for AI agents
[Release] [License: MIT] [Go Reference] [Sponsor]
Fitter turns any website or API into structured JSON — declaratively. One JSON/YAML config describes where the data lives (HTTP request, headless browser, file, static value) and what to extract (JSON paths, CSS selectors, XPath). No code, no brittle scraping scripts.
🚀 Try it in your browser — the real engine compiled to WebAssembly: live examples, a visual config builder, no install.
Because configs are plain data, LLMs can author them. The built-in MCP server lets Claude Code, Claude Desktop, or any MCP client write and run scraping pipelines on your machine, on demand:
"Get the top 5 HackerNews stories with titles and scores" → the model authors a fitter config, validates it, runs it locally, and gets clean JSON back.
One engine, five ways to use it:
Why fitter for AI agents?
- Declarative & auditable — the agent produces a config you can read, save and re-run, not throwaway code
- Local-first — all fetching happens on your machine; no third-party scraping API, no keys, no per-request billing
- Batteries included — HTTP client, headless browser (Playwright/Chromium/Docker), JSON/HTML/XML/XPath/PDF parsing, pagination, cached references, host rate-limits — in a single static binary
- Reusable — what the agent authored today becomes tomorrow's cron job or service config
[fitter demo — declarative config to structured JSON]
How to use Fitter_MCP
Fitter MCP is a Model Context Protocol server (stdio transport) which lets any MCP client — Claude Code, Claude Desktop, IDE assistants, custom agents — run Fitter configs and get structured JSON back.
Quick start (Claude Desktop — one click)
Download fitter-mcp-<os>-<arch>.mcpb from the release page and open it — Claude Desktop installs the server automatically.
Quick start (Claude Code)
Then just ask:
Get the top 5 HackerNews stories with titles and scores using fitter
The model calls fitter_config_reference, authors a config, optionally checks it with fitter_validate_config and executes it via fitter_run — all data fetching happens locally on your machine. For a ready-made pipeline try examples/config_morning_briefing.json:
Run examples/config_morning_briefing.json with fitter and give me the briefing
Register in Claude Desktop
Browser support (Playwright)
The .mcpb bundle and native binary ship without browsers: HTTP, static and file connectors work out of the box, but browser configs (the playwright connector) need Playwright's browsers. A few ways to get them:
- On first use (native binary /
.mcpb): set"install": truein the playwright connector — fitter downloads the driver + browser matching its built-inplaywright-goversion on first use (one-time, cached), so no separate install step is needed. - Ahead of time (native, optional): to avoid the first-run download, install the browsers beforehand with the same
playwright-goversion fitter is built against (checkgo.mod, currentlyv0.6100.0): The version must matchgo.modexactly —playwright-gorefuses to run against a mismatched driver. Then run configs without"install": true. - Docker: use the
ghcr.io/pxyup/fitter-mcp:playwrightimage, which bundles Chromium, Firefox and WebKit preinstalled (no"install": trueneeded).
Tools
The reference is also exposed as MCP resource fitter://config-reference for clients that support resources.
The config format is exactly the same as for Fitter_CLI: a top-level object with item (required), limits and references. Notifiers work too (the result is additionally pushed to http/telegram/redis/file/console); trigger_config and http_server are service-mode only and are ignored in MCP calls.
Remote / hosted mode (streamable HTTP)
By default fitter_mcp talks stdio. Pass --http to serve the streamable HTTP transport instead — for a shared team server, a container, or any remote deployment:
--http <addr>(envFITTER_MCP_HTTP_ADDR) — listen address; stdio mode when emptyFITTER_MCP_AUTH_TOKEN— when set, every/mcprequest must sendAuthorization: Bearer <token>; without it the endpoint is unauthenticated, so bind to localhost or put it behind a proxy--stateless(envFITTER_MCP_STATELESS=true) — no per-session state, so replicas can sit behind a load balancer without sticky sessions--metrics-addr <addr>(envFITTER_MCP_METRICS_ADDR) — serve Prometheus metrics on a separate address (e.g.127.0.0.1:9091); works in stdio mode too; empty disables. Exposes MCP request counts by method, tool call durations by tool and outcome, and outbound HTTP request durations by host, method and status. The endpoint is unauthenticated — bind it to localhost or a private interface
The server shuts down gracefully on SIGINT/SIGTERM.
Docker
A slim multi-arch image (linux/amd64 + linux/arm64) ships with every release:
The slim image contains only the fitter binary and CA certificates: server/static/file connectors work, browser connectors (chromium/docker/playwright) do not.
For browser-based configs use the playwright variant, which bundles Playwright with Chromium, Firefox and WebKit (matched to the playwright-go version fitter is built against, so no "install": true is needed in configs):
It is built from Dockerfile.mcp-playwright; build with --build-arg PLAYWRIGHT_BROWSERS=chromium for a smaller Chromium-only image.
OAuth2 accounts in Docker
Both images ship fitter_cli, so the one-time OAuth2 login can run inside the container. Store the token on a volume mounted at /tokens (pre-created writable in the image) and share it with the MCP server:
Note: 8988 is only for the one-time browser-flow login; the MCP server itself needs no port in stdio mode and only 8080 in hosted HTTP mode.
Logged-in browser sessions in Docker
Browser sessions need the playwright image (the slim one has no browsers). The one-time headed login needs a display, so run it on the host, then bind-mount the session dir into the container (the image pre-creates a writable /sessions):
Use a bind mount (not a named volume): the container writes refreshed cookies back after every run, so the host copy stays current and can be re-extended with browser-login at any time.
The volume must stay writable for the server: rotated refresh tokens are written back on every refresh.
Environment variables
- FITTER_PLUGINS - string[""] - path for plugins folder, same as the
--pluginsflag of Fitter/Fitter_CLI - FITTER_MCP_HTTP_ADDR - string[""] - listen address for remote mode, same as
--http - FITTER_MCP_AUTH_TOKEN - string[""] - bearer token protecting the HTTP endpoint
- FITTER_MCP_STATELESS - bool[false] - stateless HTTP transport, same as
--stateless - FITTER_MCP_METRICS_ADDR - string[""] - Prometheus metrics listen address, same as
--metrics-addr
Recipes
Complete, tested configs showing the main patterns. All of them run unchanged via Fitter_MCP (fitter_run_file), Fitter_CLI or the library — more in examples/.
Scrape a page that has no API, enrich from one that does
GitHub trending has no official API — scrape the HTML for repo slugs (html_attribute reads the href), then fan each one out into the GitHub REST API with {PL}:
examples/config_github_trending.json
Join on a JSON field with an expression
When array items are objects, the join key lives inside them — pull it out with {{{FromExp=...}}} (expr-lang over fRes, the current item). Book search → author details, search query supplied via input:
examples/config_book_authors.json
Write results to a local file
The file_storage generated field turns fields into writes — top-5 crypto coins appended to a CSV, one row per item. Bare {{{json.path}}} placeholders read the current item; {HUMAN_INDEX} stamps the 1-based rank (items are processed in parallel, so appends land in completion order — sort by the rank column):
examples/config_crypto_csv.json
Extract text from a PDF
response_type: "pdf" turns any fetched PDF into a JSON document — {"text": "...", "pages": ["..."], "total_pages": N} — so regular JSON paths (text, pages.0) and expressions work on it. The Bitcoin whitepaper, page count plus a trimmed intro:
Way to collect information
- Server - parsing response from some API's or http request(usage of http.Client)
- Browser - emulate real browser using chromium + docker + playwright/cypress and get DOM information
- Static - parsing static string as data
Format which can be parsed
- JSON - parsing JSON to get specific information
- XML - parsing xml tree to get specific information
- HTML - parsing dom tree to get specific information
- XPath - parsing dom tree to get specific information but by xpath
- PDF - extracting text from PDF documents; the content is exposed as JSON
{"text": "...", "pages": ["..."], "total_pages": N}so regular JSON paths liketextorpages.0work
Use like a library
Output:
Use lib.ParseCtx(ctx, ...) to pass a context.Context: cancelling it aborts in-flight fetches (HTTP requests, headless browsers, docker containers) and applies deadlines end-to-end. lib.Parse is equivalent to lib.ParseCtx(context.Background(), ...).
How to use Fitter
Download latest version from the release page
or locally:
Arguments
- --path - string[""] - path for the configuration of the Fitter
- --url - string[""] - url for the configuration of the Fitter
- --verbose - bool[false] - enable logging
- --plugins - string[""] - path for plugins for Fitter
- --log-level - enum["info", "error", "debug", "fatal"] - set log level(only if verbose set to true)
How to use Fitter_CLI
Download latest version from the release page
or locally:
Arguments
- --path - string[""] - path for the configuration of the Fitter_CLI
- --url - string[""] - url for the configuration of the Fitter_CLI
- --copy - bool[false] - copy information into clipboard
- --pretty - bool[true] - make readable result(also affect on copy)
- --verbose - bool[false] - enable logging
- --omit-error-pretty - bool[false] - Provide pure value if pretty is invalid
- --plugins - string[""] - path for plugins for Fitter
- --log-level - enum["info", "error", "debug", "fatal"] - set log level(only if verbose set to true)
- --input - string[""] - specify input value for formatting. Examples:
--input=\""124"\"--input=124--input='{"test": 5}'
fitter_cli auth — connect an OAuth2 account
One-time interactive login which stores a (refresh) token for the oauth2 connector config:
Arguments:
- --provider - preset with known endpoints:
github|google|microsoft|gitlab|spotify - --client-id / --client-secret - OAuth2 app credentials (some device flows work without secret)
- --token-file - where to store the received token (0600 permissions); reference the same path in
oauth2.token_file - --flow -
auto(device if available, else browser),device(visit a url + enter a code) orbrowser(localhost callback with PKCE, default port 8988 — registerhttp://127.0.0.1:8988/callbackas the app callback url) - --scopes - comma separated scopes
- --auth-url/--token-url/--device-auth-url/--auth-style - endpoint overrides for providers without preset
- --port - int[8988] - browser flow callback port (env
FITTER_AUTH_PORT); with the default the callback url to register at the provider ishttp://127.0.0.1:8988/callback - --listen - browser flow bind address, default
127.0.0.1; set0.0.0.0inside a container so the published port reaches the listener (envFITTER_AUTH_LISTEN) - --redirect-url - callback url registered at the provider when it differs from the listen address, e.g. docker port mapping (env
FITTER_AUTH_REDIRECT_URL) - --no-browser - only print the authorization url
Running inside Docker: see OAuth2 accounts in Docker.
After login the command prints the ready-to-use oauth2 config block. The connector refreshes the access token automatically and writes rotated refresh tokens back to the token file, so the login is needed only once.
fitter_cli browser-login — reuse a real login session
For sites without an API/OAuth: log in once by hand in a real (headed) browser window — any auth scheme works, including passwords, 2FA, SSO and captchas — and save the session for headless scraping via storage_state_file:
Arguments:
- --url - login page to open (required)
- --storage-state - where to save the session (cookies + localStorage, 0600 permissions); reference the same path in
playwright.storage_state_file(required) - --browser - enum["Chromium", "FireFox", "WebKit"] default "Chromium"; use the same value as the scraping config — sites may bind sessions to the browser fingerprint
- --install - bool[false] - install playwright browsers first
- --indexeddb - bool[false] - include IndexedDB in the snapshot (Firebase Auth and similar)
Re-running the command loads the existing state first, so you can extend/refresh a session without logging in from scratch. The scraping connector also writes refreshed cookies back after every run, keeping the session alive as long as it is used regularly. Needs a display: inside Docker run this command on the host and mount the file — see browser sessions in Docker.
Examples:
- Server version HackerNews + Quotes + Guardian News - using API + HTML + XPath parsing
- Chromium version Guardian News + Quotes - using HTML parsing + browser emulation
- Docker version Docker version: Guardian News + Quotes - using HTML parsing + browser from Docker image
- Playwright version Playwright version: Guardian News + Quotes - using HTML parsing + browser from Playwright framework
- Playwright version Playwright version: England Cities + Weather - using HTML + XPath parsing + browser from Playwright framework
- JSON version Generate pagination - using static connector for generate pagination array
- Server version Get current time - get time from url and format it
How to use Fitter_Agent
Fitter Agent is an AI-powered CLI that uses Claude to convert natural language requests into Fitter configurations and execute them automatically.
Download latest version from the release page
or locally:
Arguments
- --api-key - string[""] - Anthropic API key. Prefer the
ANTHROPIC_API_KEYenvironment variable so the key does not end up in your shell history - --model - string["claude-opus-4-8"] - Claude model to use
- --effort - enum["low", "medium", "high", "xhigh", "max"] - reasoning effort, default "high". Lower it for faster/cheaper configs, raise it for harder extractions
- --verbose - bool[false] - enable logging
- --log-level - enum["info", "error", "debug", "fatal"] - set log level
- --plugins - string[""] - path for plugins for Fitter
- --chromium-limit - uint[0] - limit concurrent Chromium instances
- --docker-limit - uint[0] - limit concurrent Docker containers
- --playwright-limit - uint[0] - limit concurrent Playwright instances
How it works
Refining a config
The agent keeps the conversation, so after a config is generated you can just say what to change instead of restating the whole request:
Use new to forget the current config and start a fresh session.
Interactive REPL Commands
- help - show help message
- new/reset - forget the current config and start fresh
- clear - clear the screen
- exit/quit/q - exit the agent
Example Session
Example Requests
Supported Capabilities
The agent can generate configs for:
- JSON APIs - REST APIs with GET/POST methods
- HTML Scraping - CSS selector-based extraction
- XPath Scraping - XPath-based extraction
- Nested API Calls - Fetch details for each item in a list
- Browser Emulation - Playwright for JS-rendered pages
- Formatted Fields - URL templates with placeholders
- Array Limiting - Limit results to N items
Configuration
Connector
It is the way how you fetch the data
- NullOnError[false] - if set to true then all errors a ignored
- ResponseType - enum["HTML", "json", "xpath", "XML", "pdf"] - in which format data comes from the connector
- Attempts - how many attempts to use for fetch data by connector
- Url - define which address to request. Important: can be with inject of the parent value as a string
https://api.open-meteo.com/v1/forecast?latitude={{{latitude}}}&longitude={{{longitude}}}&hourly=temperature_2m&forecast_days=1
Config can be one of:
- ServerConfig
- BrowserConfig
- StaticConfig
- PluginConnectorConfig
- ReferenceConfig
- IntSequenceConfig
- FileConfig
Example:
PluginConnectorConfig
Connector can be defined via plugin system. For use that you need apply next flags to Fitter/Cli(location of the plugins):
--plugins - looking for all files with ".so" extension in provided folder(subdirs excluded)
- Name - name of the plugin
- Config - json config of the plugin
How to build plugin
Build plugin
Make sure you export Plugin variable which implements pl.ConnectorPlugin interface
Example for CLI:
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_plugin.json#L5
Plugin example:
ReferenceConnectorConfig
Connector which allow get prefetched data from references
Example
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_ref.json#L66
- Name - reference name from references map
IntSequenceConnectorConfig
Improved version of static connector which generate int sequence as result
- Start[0] - start point for generation(included)
- End[0] - end point for generation(excluded from final result like range in any lang)
- Step[1] - interval for sequence
Example
FileConnectorConfig
Connector type which fetch data from provided file
- Path - file path. Support formatting
- UseFormatting[false] - use formatting file content or not
StaticConnectorConfig
Connector type which fetch data from provided string
- Value - static string as data, can be html, json
- Raw - accept raw json. Example. Also support formatting
Example:
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_static_connector.json#L5
ServerConnectorConfig
Connector type which fetch data using golang http.Client(server side request like curl)
- Method - supported all http methods: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD
- Headers - predefine headers for using during request can be injected into key/value
- Timeout[sec] - default 60sec timeout or used provided
- Body - body of the request, parsed value can be injected
- JsonRawBody - body of the request in json format; value can be injected
- ErrorOnStatus - optional, default
false. Whentrue, an HTTP response status>= 400is treated as a fetch error (flowing throughattempts/null_on_error) instead of parsing the error body — so you can distinguish a failed fetch from a genuinely empty result. Leaving itfalsekeeps the original behavior of parsing whatever body came back. - Proxy - setup proxy for request config
- OAuth2 - fetch/refresh an access token automatically and send it as
Authorizationheader config
Requests send an identifiable
User-Agent(fitter (+https://github.com/PxyUp/fitter)) by default; set your ownUser-AgentinHeadersto override it.
Example:
OAuth2 config
Automatically obtains an access token before the request and injects it as the Authorization header (overriding one set via headers). Tokens are cached in memory and refreshed before expiry; on a 401 response the cached token is dropped and the request is retried once with a fresh one.
- TokenUrl - token endpoint URL. Also support formatting
- GrantType - enum["client_credentials", "refresh_token"], default is "client_credentials". Use "refresh_token" for APIs where the user consented once (Google, Microsoft, ...) and you hold a long-lived refresh token
- ClientId/ClientSecret - client credentials. Also support formatting, e.g.
{{{FromEnv=CLIENT_SECRET}}} - Scopes - requested scopes
- RefreshToken - required for the "refresh_token" grant. Also support formatting
- EndpointParams - extra token endpoint parameters (e.g.
audiencefor Auth0), "client_credentials" grant only - AuthStyle - enum["", "header", "params"] - how client credentials are passed to the token endpoint: basic auth header or request body; empty means auto detect
- TokenFile - optional path (supports
~/) for persisting tokens between runs; the stored token is preferred over RefreshToken and rotated refresh tokens are written back — required for providers with single-use refresh tokens (GitHub Apps and similar). Create it with fitter_cli auth
Example:
Proxy config
- Server - address with schema of proxy server. Also support formatting
- Username - username for proxy(can be empty). Also support formatting
- Password - password for proxy(can be empty). Also support formatting
Environment variables
- FITTER_HTTP_WORKER - int[1000] - default concurrent HTTP workers
BrowserConnectorConfig
Connector type which emulate fetching of data via browser
Config can be one of:
- Chromium - use local installed Chromium for fetch data
- Docker - use docker as service for spin up container for fetch data
- Playwright - use playwright framework for fetch data
Example:
Chromium
Use locally installed Chromium for fetch the data
- Path - path to binary of Chromium
- Timeout[sec] - timeout for execution of the chromium
- Wait[msec] - timeout of page loading
- Flags - flags for Chromium default: "--headless", "--proxy-auto-detect", "--temp-profile", "--incognito", "--disable-logging", "--disable-extensions", "--no-sandbox"
Example:
Docker
Use Docker for spin up container for fetch data
Docker default image: docker.io/zenika/alpine-chrome
- Image - image for the docker registry(provide with registry host)
- EntryPoint - cmd which will be run inside container
- Timeout[sec] - timeout for run container(without pulling image)
- Wait[msec] - timeout of page loading (works just for Chromium based containers)
- Flags - cmd arguments for run containers, default for Chromium based: "--no-sandbox","--headless", "--proxy-auto-detect", "--temp-profile", "--incognito", "--disable-logging", "--disable-gpu"
- Purge - should we remove container after work done(like docker rm)
- NoPull - prevent pulling of the image
- PullTimeout - define timeout for pull contains
Environment variables
- DOCKER_HOST - string - (EnvOverrideHost) to set the URL to the docker server.
- DOCKER_API_VERSION - string - (EnvOverrideAPIVersion) to set the version of the API to use, leave empty for latest.
- DOCKER_CERT_PATH - string - (EnvOverrideCertPath) to specify the directory from which to load the TLS certificates (ca.pem, cert.pem, key.pem).
- DOCKER_TLS_VERIFY - bool - (EnvTLSVerify) to enable or disable TLS verification (off by default)
Example:
Playwright
Run browsers via playwright framework
- Browser - enum["Chromium", "FireFox", "WebKit"] - which browser to use
- Install - should we install browser (downloads the driver + browser matching the built-in
playwright-goversion on first use; not needed with theghcr.io/pxyup/fitter-mcp:playwrightimage, which ships them preinstalled) - Timeout[sec] - timeout to run playwright
- Wait[sec] - timeout of page loading
- TypeOfWait - enum["load", "domcontentloaded", "networkidle", "commit"] which state of page we waiting, default is "load"
- PreRunScript[""] - script which will be injected via AddInitScript and executed before any page script runs (on document creation, before navigation completes). Useful for patching the environment (navigator overrides, API stubs). Cannot access the loaded DOM. Also support placeholder {PL}
- PostRunScript[""] - script which will be executed after page load, before reading content of the page. Useful for DOM interaction (clicks, scrolling). Also support placeholder {PL}
- Stealth[false] - add script for trying passing bot defends
- StorageStateFile[""] - path (supports
~/) to a playwright storage state json (cookies + localStorage): loaded into the browser context before navigation, written back after every run so refreshed sessions stay alive. Lets headless runs reuse a real login — create the file once with fitter_cli browser-login. Use the samebrowserfor login and scraping: sites may bind sessions to the browser fingerprint. Also support formatting - IndexedDB[false] - include IndexedDB in the persisted storage state (some SPAs, e.g. Firebase Auth, keep tokens there)
- Proxy - setup proxy for request config
Example
Model
With model we define result of the scrapping
Config can be one of:
- ObjectConfig - configuration of object format
- ArrayConfig - configuration of array format
- BaseField - configuration of single/generated field
- IsArray - bool[false] - force indicate that field is array(usable in case of model field with base field)
Example:
ObjectConfig
Configuration of the object and fields
- Condition - optional condition expression evaluated against the source node before resolution; when false the whole object is omitted from the parent (fields are not resolved at all)
Config can be one of:
- Fields - map of each field definition; key - field name, value - configuration
- Field - used for element of array; fields which will be deserialized like basic type like "string", "int" and etc (used here for case array of basic types)
- ArrayConfig - used for element of array; deserialization array of array
Example:
ArrayConfig
Configuration of the array and fields
- RootPath - selector for find root element of the array or repeated element in case of html parsing, size of array will be amount of children element under the root
- Reverse - bool[false] - indicate that need use reverse iteration(n to 1)
- LengthLimit - fixed size of the array (generated arrays only; not for static). Note: when the source has fewer elements than the limit, the array is padded with trailing
nulls to preserve the declared size (this is intentional) — omitlength_limitto get exactly the source length instead - Condition - optional condition expression evaluated against the source node before resolution; when false the whole array is omitted from the parent
- ItemCondition - optional condition expression evaluated against every built item (fRes - item value, fSrc - source element, fIndex - item index); items resolving to false are dropped from the array - declarative filtering. Not applied to static_array
Config can be one of:
- ItemConfig - configuration of each element of the array
- StaticConfig - configuration of the static array
Example:
Field
Common of the field
Config can be one of:
- BaseField - fields which will be deserialized like basic type like "string", "int" and etc
- ObjectConfig - in case our field in nested object
- ArrayConfig - in case our field in array
- FirstOf - first not empty resolved field will be selected
Example:
BaseField
In case we want get some static information or generate new one
- FieldType - enum["null", "boolean", "string", "int", "int64", "float", "float64", "array", "object", "html", "raw_string"] - static field for parse. Important: type html will only works from connector which return HTML (HTMLAttribute - have no effect in this case). Example
- Path - selector(relative in case it is array child) for parsing
- HTMLAttribute - extra value which have effect only in HTML parsing via goquery. Here you can specify which attribute need to be parsed.
- Condition - optional condition expression evaluated against the extracted value (fRes/fResJson/fResRaw, fIndex; fSrc - the node the field was resolved from, siblings included); when false the field is omitted from the parent object/array instead of producing null. Evaluated before Generated, so a false condition also skips generated work (sub-requests, file downloads)
Important: by default "string" type trimmed and all special chars is replaced, if you need plain string use "raw_string"
Config can be one of or empty:
- Generated - field can be generated one which custom configuration
- FirstOf - first not empty resolved field will be selected
Examples
Conditional fields
Every field can carry a condition - an expr-lang expression (predefined values). When it evaluates to anything except true the field is omitted from the output (the key/item disappears), not set to null. An invalid expression also omits the field and logs an error.
Where the condition is evaluated:
- BaseField.
condition- after extraction:fResis the extracted value,fSrcthe node the field was resolved from (its siblings included) - sofSrc.on_sale == truecan gate a field on data you did not extract. A false condition skips generated work entirely (no sub-request, no file download) - ObjectConfig.
condition/ ArrayConfig.condition- before resolution:fRes/fSrcare the source node (parsed value for json, text content for html) - ArrayConfig.
item_condition- against every built item:fResis the item,fSrcthe source element it was built from,fIndexits index; false items are dropped - declarative array filtering. UsefSrcto filter on source attributes without adding them to the output
Filter array items - fSrc.in_stock reads the source element (not extracted into the output), fRes.price the built item:
Omit a key unless the value passes a check:
Special cases:
- in a static array an omitted item stays
null(positions are fixed by definition, indexes never shift) - if the root model config is omitted the parse result is
null - inside first_of a branch with a false condition counts as empty, so the next branch is tried
Runnable example: examples/config_conditions.json
GeneratedFieldConfig
Provide functionality of generating field on the flight
Config can be one of:
- UUID - generate random UUID V4
- Static - generate static field
- Formatted - format field
- Model - model generated from the other connector and model
- Plugin - plugin field
- Calculated - calculated field
- File - file field (for download file from server)
- FileStorage - file field which can be saved to local file
Examples:
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_cli.json#L58
UUID
Generate random UUID V4 on the flight, can be used for generate uniq id
- Regexp - provide matcher which can be used for get part of generated uuid
Static
Generate static field
- Type - enum["null", "boolean", "string", "int","int64","float","float64", "array", "object"] - type of the field
- Value - string value of the field
- Raw - pure json value of the field
Example
Formatted Field Config
Generate formatted field which will pass value from parent base field
Example: https://github.com/PxyUp/fitter/blob/master/examples/cli/config_cli.json#L98
File Storage Field
Field can be used for store field result as local file
- Content - template string for content. Important: can be with inject of the parent value as a string
- Raw - raw json content of field. Important: can be with inject of the parent value as a string
- FileName - local file name for storing file. By default, it is try get FileName from header, after that from url. Important: can be with inject of the parent value as a string.
- Path - local file parent directory for storing file. Default path it is process directory. Important: can be with inject of the parent value as a string
- Append[false] - append to file or not
File Field
Field can be used for download file from server locally
- Config - ServerConfig use default fitter http.Client for send request
- Url - url of the image. Important: URL in the connector can be with inject of the parent value as a string
- FileName - local file name for storing file. By default, it is try get FileName from header, after that from url. Important: can be with inject of the parent value as a string.
- Path - local file parent directory for storing file. Default path it is process directory. Important: can be with inject of the parent value as a string
Result of the field will be local file path as string
With propagated URL (inject of the parent value as a string)
Config example:
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_image.json
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_image_multiple.json
Calculated field
Field can generate different types depends from expression
- Type - resulting type of expression\
- Expression - expression for calculation (we use this lib for calculated expression)
Predefined values
FNull - alias for builder.Nullvalue
FNil - alias for nil
isNull(value T) - function for check is value is FNull
fRes - it is raw(with proper type) result from the parsing base field
fIndex - it is index in parent array(only if parent was array field)
fResJson - it is JSON string representation of the raw result
fResRaw - result in bytes format
fSrc - only in condition/item_condition expressions: the source node the value was resolved from (parsed value for json - siblings included, text content for html). Not available in calculated/formatted/notifier expressions
FNewLine - new line separator
Plugin field
Field can be some external plugin for fitter
- Name - name of the plugin(without extension just name)
- Config - json config of the plugin
Model Field
Field type which can be generated on the flight by news model and connector
- ConnectorConfig - which connector to use. Important: URL in the connector can be with inject of the parent value as a string
- Model - configuration of the underhood model
- Type - enum["null", "boolean", "string", "int", "int64", "float", "float64", "array", "object"] - type of generated field
- Path - in case we cant extract some information from generated field we can use json selector for extract
- Expression - string which can be used for post processing of the Model (ignoring path field)
Examples:
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_cli.json#L60
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_weather.json#L37
Static Array Config
Provide static(fixed length) array generation
- Items - map[uint32]*Field - key is index in array, value is field definition
- Length - if set(1+) can be used for define custom length of array
Examples:
Placeholder list
- {PL} - for inject value
- {INDEX} - for inject index in parent array
- {HUMAN_INDEX} - for inject index in parent array in human way
- {{{json_path}}} - will get information from propagated "object"/"array" field
- {{{RefName=SomeName}}} - get reference value by name. Example
- {{{RefName=SomeName json.path}}} - get reference value by name and extract value by json path. Example
- {{{FromEnv=ENV_KEY}}} - get value from environment variable
- {{{FromExp=fRes + 5 + fIndex}}} - get value from the expression. Predefined values
- {{{FromInput=.}}} or {{{FromInput=json.path}}} - get value from input of trigger or library
- {{{FromFile=./test_file.log}}} - get value from file by path. Content of file also can contain placeholders
- {{{FromURL=http://localhost:8081}}} - get response from url
Examples:
References
Special map which prefetched(before any processing) and can be user for connector or for placeholder
Can be used for:
- Cache jwt token and use them in headers
- Cache values
- Etc
Reference
- ModelField - is embedded struct, you can use same fields
- Expire[sec] - duration when reference is expired after fetching. Not set => forever cached. Set to 0 => every time re-fetch. Set to n > 0 => cached for n second
For Fitter
For Fitter Cli
- References - map[string]*Reference - object where is key if ReferenceName (can be user for connector or placeholder) and value is Reference
- Limits
Example
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_ref.json#L2
Notifiers
Optional per-item config item.notifier_config which pushes the parse result somewhere after processing. The result is still returned as usual (CLI/MCP output, service logs); the notifier additionally delivers it. Works in Fitter (service mode), Fitter_CLI and Fitter_MCP.
- Expression - optional expr-lang condition: notify only when it evaluates to true. The parse result is available as
fRes(parsed value),fResRaw(raw bytes),fResJson(JSON string), e.g.len(fResRaw) > 0 - Force - notify even if parsing finished with an error
- SendArrayByItem - if the result is an array, send each element as a separate notification
- Template - optional template applied to the result before sending, placeholders allowed
- Destination - exactly one of
console,telegram_bot,http,redis,file
Destination configs:
The file destination uses the same FileStorageField as the file field type.
Example (examples/config_telegram.json):
Limits
Provide limitation for prevent DDOS, big usage of memory
- HostRequestLimiter - map[string]int64 - limitation per host name, key is host, value is amount of parallel request(usage for server connector)
- ChromiumInstance - amount of parallel chromium instance
- DockerContainers - amount of parallel docker instance
- PlaywrightInstance - amount of parallel playwright instance
https://github.com/PxyUp/fitter/blob/master/examples/cli/config_cli.json#L2
来源:README.md,提交 67b2e8f
工具
0版本历史
1- v1.8.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分