🎃 Import a HAR file (browser network capture) as REST tools
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend-api-design, documentation, frontend, security
Hướng nghiên cứu
Start with curl.parser.ts, postman.parser.ts, and the ParsedTool shape in openapi.parser.ts; then trace parser registration and importTools() in the backend, and IMPORT_SOURCES/handleImportTools in the connector page. Build the HAR parser and cover it with har.parser.spec.ts, then verify additive imports, the file-upload flow, and the requested docs updates. Done means the listed security, parsing, UI, test, and documentation acceptance criteria pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of the October Challenge #846.
Why
Many internal and legacy web apps have no OpenAPI spec and no Postman collection. What users can always do is open DevTools, click through the app and "Save all as HAR". Turning that capture into REST tools would make AnythingMCP useful for exactly the APIs nobody documented. Similar tools: Postman and Insomnia import HAR; mitmproxy2swagger turns captures into specs.
Self-hosted vs Cloud
- Self-hosted: available in Community and Business, no licence gate.
- Cloud (
DEPLOYMENT_MODE=cloud): same feature. The parser runs only on uploaded text and never makes outbound requests (unlike the OpenAPI/Postmanurloption), so there is no new SSRF surface. Captures are sensitive (session cookies, tokens, personal data in bodies), so nothing from the HAR may be stored except the endpoint shapes described below. - Who can use it: same as the other import sources.
POST /api/connectors/:id/importrequiresassertCanWrite(connector owner or ADMIN; VIEWER refused), and the connector belongs to the caller's organization.
What to build
- Parser
packages/backend/src/connectors/parsers/har.parser.ts(HarParser,@Injectable,parse(content: string, opts: { baseUrl: string }): ParsedTool[]), registered inPARSERSinconnectors.module.ts:- Validate the HAR 1.2 shape (
log.entries[]). Reject content over 10 MB (the JSON body limit inmain.ts:53) and stop after 2,000 entries, with a clear error. - Keep only entries whose origin equals the connector's
baseUrlorigin, and make each path relative to thebaseUrlpath. SkipOPTIONS,data:/blob:URLs, static assets (by extension and byresponse.content.mimeType: js, css, images, fonts, html) and non-2xx/3xx responses. - Path parameter inference: a segment that is numeric, a UUID, a hex/base64-ish id of 16 or more characters, or a date becomes
{name}, named from the preceding segment (/orders/123/items/9gives/orders/{order_id}/items/{item_id}). Use the{var}form thatcurl.parser.tsemits. - Dedupe by
METHOD + templated path. Merge query parameter names and JSON body keys across duplicates. - Parameters: query params become string params. A JSON request body becomes a body schema with types only, using the Postman parser's
inferJsonTypeapproach. Form-urlencoded fields become string params. - Never copy captured values into defaults, examples or descriptions. A login request's body contains a password.
- Headers: drop
Authorization,Proxy-Authorization,Cookie,Set-Cookie, any name whereisSecretName()is true, HTTP/2 pseudo-headers (:authority…), and browser noise (sec-*,user-agent,accept-encoding,referer,origin,host,content-length). Query params whose name is a secret (e.g.api_key,token) are dropped, and their names are returned as a warning ("configure auth on the connector instead"). - Ignore
response.content.text,cookies,postData.paramsfile contents, and_initiator/_securityDetails. - Tool names:
<method>_<path words>, passed throughcapToolName(), made unique.
- Validate the HAR 1.2 shape (
- Controller: add
'har'toImportToolsDto.sourceand acase 'har'inimportTools()(content only, nourl). Treat HAR likecurl/json: additive, so it does not retire existing tools (additiveflag). - Frontend: add "HAR file (browser capture)" to
IMPORT_SOURCESin the connector page, with a Choose file button (accept=".har,application/json"). Read the file withFileReader. Before upload, removeresponse.content.textandcookiesfrom each entry (less data sent, smaller upload). Warn above 10 MB. Add a one-line hint: "Only requests to are imported; cookies and auth headers are discarded."
Where to look
packages/backend/src/connectors/parsers/curl.parser.ts:20: closest pattern (header handling at:138,{var}paths at:225,generateToolNameat:318).packages/backend/src/connectors/parsers/postman.parser.ts:223: header skip list;:433inferJsonType.packages/backend/src/connectors/parsers/openapi.parser.ts:12: theParsedToolshape.packages/backend/src/connectors/parsers/tool-name.util.ts:23:capToolName.packages/backend/src/connectors/connector-secrets.util.ts:77:isSecretName.packages/backend/src/connectors/connectors.controller.ts:323:ImportToolsDto;:1489importTools();:1656theadditiverule.packages/backend/src/connectors/connectors.module.ts:36:PARSERS.packages/frontend/src/app/connectors/[id]/page.tsx:23:IMPORT_SOURCES;:450handleImportTools.
Acceptance criteria
-
har.parser.spec.tsnext to the parser, with a small fixture HAR. It covers: other-origin and static entries skipped;/users/42and/users/43collapse into oneGET /users/{user_id}tool;Authorization/Cookie/X-Api-Keyabsent from everyendpointMapping; no captured value (e.g. a password in a login body) appears anywhere in the output (JSON.stringify(result)check); over-size input rejected. Run withcd packages/backend && npx jest src/connectors/parsers/har. - Importing a HAR never disables existing tools.
- The UI option works end to end (Playwright spec under
packages/frontend/tests/e2e/). - Docs: mention HAR in the import list of
docs/connectors/rest.md(line 3), and add asource: "har"example next to the other/importexamples indocs/api-reference.md(around line 121). Include a privacy note: "captures contain cookies; we discard them, but sanitize before sharing the file".
Out of scope
- Inferring
outputSchemafrom captured responses (follow-up). - Auto-configuring connector auth from captured tokens.
- GraphQL/WebSocket entries in a HAR.
- Creating a new connector from a HAR (import into an existing REST connector only).
Size
M (1–2 days)
How to claim
Comment "I'd like to work on this" and we'll assign you. Rules in #846.
- Ngôn ngữ chính
- TypeScript
- Star
- 856
- Fork
- 82
- Merge trung bình
- 6 giờ 15 phút
- Pull request đã merge (30 ngày)
- 141
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của HelpCode-ai/anythingmcp
-
Docs: document all SMTP_* and other undocumented env vars for self-hostingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
HelpCode-ai/anythingmcp#1049 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
HelpCode-ai/anythingmcp#996 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
HelpCode-ai/anythingmcp#995 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue hacktoberfest help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
HelpCode-ai/anythingmcp#982 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
HelpCode-ai/anythingmcp#745 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của HelpCode-ai/anythingmcp
Issue tương tự
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
redhat-developer/rhdh-plugin-export-overlays#4391 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Luligu/matterbridge#655 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
software-mansion/argent#1457 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
schmayterling/hibi#245 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
After a failed save, the red error banner stays on every page until the app is reloadedCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
linagora/twake-contacts-frontend#241 ·
Maintainer thường phản hồi trong vòng 1 ngày