extract-api
Skill16 starsChanged 10 days agoMITView on GitHub
Turn a logged-in website or web app with no public API into live agent tools through the toolsmelt hub. Use when the user wants an agent to read data from a site they log in to (dashboard, portal, internal tool), or asks to "record", "connect" or "extract the API" of a site.
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Ask the user, then wait:
- Distinctive: line 16
Read-only, or also actions?
- Very specific: line 31
Call smith_record_start(name, hosts) (name e.g.
- Very specific: line 34
Use navigate_page, take_snapshot, click, fill only to move around and read the page.
- Very specific: line 35
NEVER call get_network_request: it prints request headers, including session cookies, into the conversation.
- Distinctive: line 36
Stop and ask before any click that saves, submits, approves, sends, pays or deletes.
- Very specific: line 48
Read the digest and the guide fully, then edit <workdir>/plan.yaml yourself (see design-mcp-tools):
- Distinctive: line 49
Keep only tools for the goals from step 1.
- Very specific: line 51
Add transform on args and output.transforms for dates, unix times, minutes, currency.
- Distinctive: line 66
If a call says the session expired, ask the user to log in again in the shared Chrome window, then retry.
- Very specific: line 73
Call smith_app_desktop(har=<file>, hosts=[<the program's API host>], workdir=<dir>).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extract an API from a website and connect it
You record the site's own API calls in a shared Chrome, design a plan, and connect it as live tools in the toolsmelt hub. Needs the toolsmelt MCP server (claude mcp add toolsmelt -- uvx toolsmelt mcp) and Chrome DevTools MCP pointed at the shared Chrome (step 2). Connections are personal: one machine, one user. Respecting the site's terms is the user's responsibility.
Done means: every connected tool was called once and its output matches what the page shows.
1. Goal
Ask the user, then wait:
- Which questions or tasks should the agent answer with this site? Write them as concrete examples ("attendance for last month", "open invoices over 500"). List the features (pages, filters, detail views) they imply.
- Read-only, or also actions? Default read-only.
- Site URL and the hosts its data comes from (usually the site and an
api.host).
2. Shared Chrome and login
toolsmelt browser # starts or reuses Chrome on port 9222; --port N, --no-proxy
npx chrome-devtools-mcp@1.11.0 --browser-url=http://127.0.0.1:9222The second line is the Chrome DevTools MCP config: point it at the port toolsmelt browser printed, then restart the MCP client if it was configured differently. Open the site with DevTools navigate_page.
The user logs in themselves in that window (password, OTP, 2FA). Never ask for, read or type a password, token or one-time code. Logged-in cookies live only in that Chrome profile under ~/.toolsmelt (TOOLSMELT_HOME).
3. Record
Call smith_record_start(name, hosts) (name e.g. hr, hosts e.g. ["hr.example.com"]; subdomains included). Then drive the page with DevTools:
- Walk each feature at least twice with different inputs (dates, filters, page numbers, a different detail item) so the importer can tell parameters from constants.
- Trigger lazy UI: dropdowns, tabs, "show more", date pickers, sort headers.
- Use
navigate_page,take_snapshot,click,fillonly to move around and read the page. - NEVER call
get_network_request: it prints request headers, including session cookies, into the conversation. The recording already keeps bodies; headers with cookies and tokens are saved as<dropped>. - Stop and ask before any click that saves, submits, approves, sends, pays or deletes. Proceed only on a clear yes for that action.
Then smith_record_stop(name). It returns the HAR path and request count; zero requests means wrong hosts or the tab was not touched.
4. Inspect and design
smith_inspect(source=<har path>, workdir=<dir of the har>, hosts=[...])
smith_guide()
smith_draft(workdir=<same dir>)Read the digest and the guide fully, then edit <workdir>/plan.yaml yourself (see design-mcp-tools):
- Keep only tools for the goals from step 1; drop analytics, menus, config, auth plumbing.
- Rename cryptic fields and args to what a person says (
emp_idtoemployee_id,Item_dev_sort_datethroughmap: {newest: ...}). - Add
transformon args andoutput.transformsfor dates, unix times, minutes, currency. Settimezone(IANA name; empty means the machine's local zone). - Set
auth: {type: browser, login_path: /Account/Login};login_pathis the path the site redirects to when logged out. Also setsession_cookieto the login cookie's name: compare the cookie NAMES Chrome holds logged in vs logged out (toolsmelt.browser.cookies_for, names only, never print values). Some sites answer an ended session with HTTP 200 and an empty body. - Fill
examplefor every tool with values seen in the recording;read_only: falsefor anything that writes.
smith_validate(workdir=<dir>) # fix every error; read warnings
smith_connect(workdir=<dir>, name="hr")smith_connect adds the tools right now and saves the connection. If the client does not show new tools, use smith_tools(connection) and smith_call(connection, tool, args) (read-only tools only).
5. Verify against the page
Call each connected tool once with a real input. Open the same view in Chrome (take_snapshot) and compare the numbers, dates and row counts. Fix wrong units, time zones, missing fields or paging in plan.yaml, run smith_validate, then smith_connect again (same name replaces it). Call write tools only after the user confirms each call.
If a call says the session expired, ask the user to log in again in the shared Chrome window, then retry.
Desktop program (own or authorized)
For a desktop program's API, the developer records the program's own traffic with their own proxy; toolsmelt imports the HAR. Use this only for software the user owns or is authorized to analyze; certificate-pinned programs are out of scope, and you offer no way around that.
- Call
smith_app_desktop(workdir=<dir>)and show the user the steps. The user installs and runs mitmproxy (mitmdump --set hardump=<file>), points that one program at it (the program must trust mitmproxy's CA for HTTPS, per mitmproxy's certificate docs), uses the features they want as tools, and stops mitmdump with Ctrl-C (mitmweb: quit from the UI). Killing the process writes no HAR. Safer: record withmitmdump -p <port> -w flows.mitm, then convert withmitmdump -nr flows.mitm --set hardump=<file>. You never install, start or configure the proxy, install a certificate or change system proxy settings yourself. - Call
smith_app_desktop(har=<file>, hosts=[<the program's API host>], workdir=<dir>). Other programs' traffic on the same proxy is dropped byhosts. If it says nothing to import, the capture holds no JSON API calls: ask the user to record again. - Continue at step 4 (
smith_draft). The endpoints came from real responses, so they are verified. Delete the HAR afterwards (step 6).
Android app (own or authorized)
Only for an app the user owns or is authorized to analyze; nothing is run or bypassed. Call smith_app_android(apk=<abs path>, base_url=<API base URL>, workdir=<dir>) (needs REA's JADX jar; REA_JADX_MCP_JAR). Without class_name it lists candidate Retrofit classes: pick one and call again. Endpoints are read from code, so they are unverified until smith_probe(workdir) calls the GET ones with the user's credentials (writes=true only after the user confirms). A method or parameter kind that could not be read is listed in source.json description: an endpoint with no method fails smith_validate until you set it in the plan. Then continue at step 4.
Electron / JavaScript app (own or authorized)
Same rules. Call smith_app_js(path=<app dir, app.asar or one file>, base_url=<API base URL>, workdir=<dir>). Calls whose path is built at run time are skipped and noted, never guessed. Endpoints are unverified until smith_probe(workdir); set base_url first or probe refuses. Then continue at step 4.
6. Privacy and publishing
- Tool results go to the model like any conversation text. Tell the user which personal fields the tools return and trim
fieldsthey do not need. - Connections keep only scrubbed examples, not captured response bodies. Delete the HAR once
smith_connectworks. - Static secrets (API key, token) are entered by the developer:
toolsmelt secret set <connection> <ENV_NAME>(hidden prompt, OS keychain;--oncefor a one-time code). Never ask for them in chat or write them into a plan. toolsmelt connections/smith_connectionslists what is saved;smith_disconnect(name)removes one.- A tool says "Not signed in" or the session expired:
smith_login(connection)returns the step or link to show the user (an app that signs its own requests usesauth: {type: signin, provider: ...}, e.g.xiaomifor Mi Home). Call it again after the user signs in: it names the account and where its data is, which catches a wrong account or region. - To share a server publicly use
generate(seebuild-mcp-server). It refusesauth: browserplans: switch the plan to token/API-key auth first. Secrets are never exported.
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-mcp-serverSkill
- design-mcp-toolsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

