searchfetch 3.2.2__tar.gz → 3.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {searchfetch-3.2.2/searchfetch.egg-info → searchfetch-3.3.0}/PKG-INFO +8 -1
  2. {searchfetch-3.2.2 → searchfetch-3.3.0}/README.md +7 -0
  3. {searchfetch-3.2.2 → searchfetch-3.3.0}/pyproject.toml +1 -1
  4. {searchfetch-3.2.2 → searchfetch-3.3.0/searchfetch.egg-info}/PKG-INFO +8 -1
  5. {searchfetch-3.2.2 → searchfetch-3.3.0}/searchfetch.egg-info/SOURCES.txt +10 -1
  6. {searchfetch-3.2.2 → searchfetch-3.3.0}/server.py +21 -7
  7. searchfetch-3.3.0/templates/devto.json +45 -0
  8. searchfetch-3.3.0/templates/gitlab.json +49 -0
  9. searchfetch-3.3.0/templates/go-pkg.json +50 -0
  10. searchfetch-3.3.0/templates/javadoc.json +43 -0
  11. searchfetch-3.3.0/templates/mdn-web-docs.json +39 -0
  12. searchfetch-3.3.0/templates/raw.json +14 -0
  13. searchfetch-3.3.0/templates/reddit.json +65 -0
  14. searchfetch-3.3.0/templates/wikipedia.json +46 -0
  15. searchfetch-3.3.0/templates/youtube.json +44 -0
  16. {searchfetch-3.2.2 → searchfetch-3.3.0}/LICENSE +0 -0
  17. {searchfetch-3.2.2 → searchfetch-3.3.0}/MANIFEST.in +0 -0
  18. {searchfetch-3.2.2 → searchfetch-3.3.0}/searchfetch.egg-info/dependency_links.txt +0 -0
  19. {searchfetch-3.2.2 → searchfetch-3.3.0}/searchfetch.egg-info/entry_points.txt +0 -0
  20. {searchfetch-3.2.2 → searchfetch-3.3.0}/searchfetch.egg-info/requires.txt +0 -0
  21. {searchfetch-3.2.2 → searchfetch-3.3.0}/searchfetch.egg-info/top_level.txt +0 -0
  22. {searchfetch-3.2.2 → searchfetch-3.3.0}/setup.cfg +0 -0
  23. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/crates-package.json +0 -0
  24. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/docker-hub.json +0 -0
  25. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/docs-page.json +0 -0
  26. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/docs-rs.json +0 -0
  27. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/duckduckgo-search.json +0 -0
  28. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/github-issue.json +0 -0
  29. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/github-repo.json +0 -0
  30. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/google-search.json +0 -0
  31. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/npm-package.json +0 -0
  32. {searchfetch-3.2.2 → searchfetch-3.3.0}/templates/pypi-package.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: searchfetch
3
- Version: 3.2.2
3
+ Version: 3.3.0
4
4
  Summary: A maximum fault-tolerant, stealth-enabled MCP server for web searching and fetching.
5
5
  Author: Max
6
6
  License-Expression: MIT
@@ -105,6 +105,13 @@ Template extraction supports `text`, `markdown`, `attribute`, and `html` formats
105
105
 
106
106
  Built-in templates live in `templates/*.json` and are shared by the Node.js and Python implementations.
107
107
 
108
+ **Available page templates** (auto-detected by URL or selectable by name):
109
+ `wikipedia`, `reddit`, `mdn-web-docs`, `gitlab`, `youtube`, `devto`, `go-pkg`, `javadoc`,
110
+ `github-repo`, `github-issue`, `npm-package`, `pypi-package`, `crates-package`,
111
+ `docker-hub`, `docs-rs`, `docs-page`
112
+
113
+ **`raw`** — special template that applies minimal filtering and returns full body content as markdown. Use when you need the complete page without template-specific extraction.
114
+
108
115
  ---
109
116
 
110
117
  ## Local Development
@@ -84,6 +84,13 @@ Template extraction supports `text`, `markdown`, `attribute`, and `html` formats
84
84
 
85
85
  Built-in templates live in `templates/*.json` and are shared by the Node.js and Python implementations.
86
86
 
87
+ **Available page templates** (auto-detected by URL or selectable by name):
88
+ `wikipedia`, `reddit`, `mdn-web-docs`, `gitlab`, `youtube`, `devto`, `go-pkg`, `javadoc`,
89
+ `github-repo`, `github-issue`, `npm-package`, `pypi-package`, `crates-package`,
90
+ `docker-hub`, `docs-rs`, `docs-page`
91
+
92
+ **`raw`** — special template that applies minimal filtering and returns full body content as markdown. Use when you need the complete page without template-specific extraction.
93
+
87
94
  ---
88
95
 
89
96
  ## Local Development
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "searchfetch"
7
- version = "3.2.2"
7
+ version = "3.3.0"
8
8
  description = "A maximum fault-tolerant, stealth-enabled MCP server for web searching and fetching."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: searchfetch
3
- Version: 3.2.2
3
+ Version: 3.3.0
4
4
  Summary: A maximum fault-tolerant, stealth-enabled MCP server for web searching and fetching.
5
5
  Author: Max
6
6
  License-Expression: MIT
@@ -105,6 +105,13 @@ Template extraction supports `text`, `markdown`, `attribute`, and `html` formats
105
105
 
106
106
  Built-in templates live in `templates/*.json` and are shared by the Node.js and Python implementations.
107
107
 
108
+ **Available page templates** (auto-detected by URL or selectable by name):
109
+ `wikipedia`, `reddit`, `mdn-web-docs`, `gitlab`, `youtube`, `devto`, `go-pkg`, `javadoc`,
110
+ `github-repo`, `github-issue`, `npm-package`, `pypi-package`, `crates-package`,
111
+ `docker-hub`, `docs-rs`, `docs-page`
112
+
113
+ **`raw`** — special template that applies minimal filtering and returns full body content as markdown. Use when you need the complete page without template-specific extraction.
114
+
108
115
  ---
109
116
 
110
117
  ## Local Development
@@ -10,12 +10,21 @@ searchfetch.egg-info/entry_points.txt
10
10
  searchfetch.egg-info/requires.txt
11
11
  searchfetch.egg-info/top_level.txt
12
12
  templates/crates-package.json
13
+ templates/devto.json
13
14
  templates/docker-hub.json
14
15
  templates/docs-page.json
15
16
  templates/docs-rs.json
16
17
  templates/duckduckgo-search.json
17
18
  templates/github-issue.json
18
19
  templates/github-repo.json
20
+ templates/gitlab.json
21
+ templates/go-pkg.json
19
22
  templates/google-search.json
23
+ templates/javadoc.json
24
+ templates/mdn-web-docs.json
20
25
  templates/npm-package.json
21
- templates/pypi-package.json
26
+ templates/pypi-package.json
27
+ templates/raw.json
28
+ templates/reddit.json
29
+ templates/wikipedia.json
30
+ templates/youtube.json
@@ -11,7 +11,7 @@ from markdownify import markdownify as md
11
11
  from mcp.server.fastmcp import FastMCP
12
12
  from playwright.async_api import TimeoutError as PlaywrightTimeoutError
13
13
 
14
- __version__ = "3.2.2"
14
+ __version__ = "3.3.0"
15
15
 
16
16
  mcp = FastMCP("searchfetch")
17
17
 
@@ -1108,14 +1108,25 @@ async def webfetch(
1108
1108
  block_media: bool = True,
1109
1109
  ) -> str:
1110
1110
  """
1111
- Fetch a webpage and extract structured information using templates.
1111
+ Fetch and extract the main text content from any webpage. Fully executes
1112
+ JavaScript to load React/SPAs and aggressively strips images/media
1113
+ (including base64) to save context tokens.
1112
1114
 
1113
1115
  Args:
1114
- url: The full URL to fetch.
1115
- template: "auto", a built-in name, or inline JSON. Default: "auto".
1116
+ url: The full URL of the webpage to fetch (must start with http/https).
1117
+ template: Template to use: 'auto' (auto-detect from URL), a built-in
1118
+ page template name (see list below), 'raw' for
1119
+ minimal-filtering full-page output, or inline JSON.
1120
+ Default: 'auto'.
1116
1121
  start_index: Character offset for pagination. Default: 0.
1117
- max_length: Max characters to return. Default: 10000.
1118
- block_media: Block images/media/fonts. Default: True.
1122
+ max_length: Maximum characters to return per request. Default is 10000.
1123
+ block_media: Block images, videos, and fonts entirely at the network
1124
+ layer. Default is true.
1125
+
1126
+ Built-in page templates (use by name to force a specific extractor):
1127
+ wikipedia, reddit, mdn-web-docs, gitlab, youtube, devto, go-pkg,
1128
+ javadoc, github-repo, github-issue, npm-package, pypi-package,
1129
+ crates-package, docker-hub, docs-rs, docs-page, raw
1119
1130
  """
1120
1131
  # 1. Resolve template
1121
1132
  matched_template, template_name = resolve_page_template(url, template)
@@ -1167,7 +1178,10 @@ async def webfetch(
1167
1178
 
1168
1179
 
1169
1180
  def main():
1170
- mcp.run(transport="stdio")
1181
+ try:
1182
+ mcp.run(transport="stdio")
1183
+ except BrokenPipeError:
1184
+ pass
1171
1185
 
1172
1186
 
1173
1187
  if __name__ == "__main__":
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "devto",
3
+ "description": "DEV Community article — title, author, and content",
4
+ "order": 20,
5
+ "url_patterns": [
6
+ "^https?://dev\\.to/[^/]+/[^/]+"
7
+ ],
8
+ "remove": [
9
+ "script",
10
+ "style",
11
+ "svg",
12
+ "img",
13
+ "nav",
14
+ "footer",
15
+ ".sidebar",
16
+ ".crayons-layout__sidebar-left",
17
+ ".crayons-layout__sidebar-right",
18
+ ".crayons-article-actions",
19
+ ".reaction-button",
20
+ ".crayons-btn",
21
+ ".spec__tags",
22
+ ".article-engagement-bar",
23
+ ".comments-container"
24
+ ],
25
+ "sections": [
26
+ {
27
+ "name": "Title",
28
+ "selector": "h1",
29
+ "format": "text",
30
+ "required": true
31
+ },
32
+ {
33
+ "name": "Author",
34
+ "selector": ".crayons-article__header__meta a, a.crayons-avatar",
35
+ "format": "text",
36
+ "required": false
37
+ },
38
+ {
39
+ "name": "Content",
40
+ "selector": "#article-body, .crayons-article__body, article.crayons-article",
41
+ "format": "markdown",
42
+ "required": true
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "gitlab",
3
+ "description": "GitLab project — description, file listing, and README",
4
+ "order": 12,
5
+ "url_patterns": [
6
+ "^https?://gitlab\\.com/[^/]+/[^/]+/?$",
7
+ "^https?://gitlab\\.com/[^/]+/[^/]+/-/tree/[^/]+/?$"
8
+ ],
9
+ "remove": [
10
+ "script",
11
+ "style",
12
+ "svg",
13
+ "nav",
14
+ "footer",
15
+ "header",
16
+ ".navbar-gitlab",
17
+ ".nav-sidebar",
18
+ ".issuable-list",
19
+ ".super-sidebar",
20
+ "aside"
21
+ ],
22
+ "sections": [
23
+ {
24
+ "name": "Title",
25
+ "selector": "h1",
26
+ "format": "text",
27
+ "required": true
28
+ },
29
+ {
30
+ "name": "Description",
31
+ "selector": "meta[name='description']",
32
+ "format": "attribute",
33
+ "attribute": "content",
34
+ "required": false
35
+ },
36
+ {
37
+ "name": "Files",
38
+ "selector": "table[data-qa-selector='file_tree_table'], .tree-table",
39
+ "format": "markdown",
40
+ "required": false
41
+ },
42
+ {
43
+ "name": "README",
44
+ "selector": ".readme-holder .md, .file-content .md, .readme-holder",
45
+ "format": "markdown",
46
+ "required": false
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "go-pkg",
3
+ "description": "Go package documentation on pkg.go.dev — name, overview, and docs",
4
+ "order": 22,
5
+ "url_patterns": [
6
+ "^https?://pkg\\.go\\.dev/[^/]+/?$",
7
+ "^https?://pkg\\.go\\.dev/[^/]+/[^/]+/?$",
8
+ "^https?://pkg\\.go\\.dev/[^/]+/[^/]+/[^/]+/?$"
9
+ ],
10
+ "remove": [
11
+ "script",
12
+ "style",
13
+ "svg",
14
+ "nav",
15
+ "footer",
16
+ ".go-Header",
17
+ ".go-SiteHeader",
18
+ ".go-Footer",
19
+ ".UnitMeta",
20
+ ".UnitMeta-repo",
21
+ ".UnitFiles",
22
+ ".JumpDrawer",
23
+ ".go-Main-nav",
24
+ ".go-Main-headerSubmenu",
25
+ ".Site-header",
26
+ ".UnitHeader-version",
27
+ ".UnitHeader-breadcrumb",
28
+ ".UnitHeader-details"
29
+ ],
30
+ "sections": [
31
+ {
32
+ "name": "Title",
33
+ "selector": "h1",
34
+ "format": "text",
35
+ "required": true
36
+ },
37
+ {
38
+ "name": "Overview",
39
+ "selector": ".Documentation-overview, .Overview",
40
+ "format": "markdown",
41
+ "required": false
42
+ },
43
+ {
44
+ "name": "Documentation",
45
+ "selector": ".Documentation-content, .Documentation, #documentation",
46
+ "format": "markdown",
47
+ "required": false
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "javadoc",
3
+ "description": "Java SE API documentation — class/method details",
4
+ "order": 8.5,
5
+ "url_patterns": [
6
+ "^https?://docs\\.oracle\\.com/.*/docs/api/.*"
7
+ ],
8
+ "remove": [
9
+ "script",
10
+ "style",
11
+ "svg",
12
+ "nav",
13
+ "footer",
14
+ "header",
15
+ ".topNav",
16
+ ".bottomNav",
17
+ ".subNav",
18
+ ".navListSearch",
19
+ ".skipNav",
20
+ ".searchTag",
21
+ ".searchTagResult",
22
+ ".useSummary",
23
+ ".inheritedList",
24
+ ".details",
25
+ ".memberSummary",
26
+ ".colFirst",
27
+ ".colLast"
28
+ ],
29
+ "sections": [
30
+ {
31
+ "name": "Title",
32
+ "selector": ".header h2, h2.title, h2:first-of-type",
33
+ "format": "text",
34
+ "required": false
35
+ },
36
+ {
37
+ "name": "Content",
38
+ "selector": "[role='main'], .document, .rst-content, article, .content, .markdown-body, .prose, main, .contentContainer",
39
+ "format": "markdown",
40
+ "required": true
41
+ }
42
+ ]
43
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "mdn-web-docs",
3
+ "description": "MDN Web Docs article — title and main content",
4
+ "order": 15,
5
+ "url_patterns": [
6
+ "^https?://developer\\.mozilla\\.org/.*"
7
+ ],
8
+ "remove": [
9
+ "script",
10
+ "style",
11
+ "svg",
12
+ "nav",
13
+ "footer",
14
+ "header",
15
+ ".sidebar",
16
+ ".toc",
17
+ ".interactive",
18
+ ".playground",
19
+ ".bc-data",
20
+ ".prev-next",
21
+ ".notecard",
22
+ ".language-menu",
23
+ ".breadcrumbs-container"
24
+ ],
25
+ "sections": [
26
+ {
27
+ "name": "Title",
28
+ "selector": "h1",
29
+ "format": "text",
30
+ "required": true
31
+ },
32
+ {
33
+ "name": "Content",
34
+ "selector": "#content, article, main, .main-page-content",
35
+ "format": "markdown",
36
+ "required": true
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "raw",
3
+ "description": "Raw page content — minimal filtering, full body as markdown (use when you need the complete page without template extraction)",
4
+ "order": 999,
5
+ "remove": [],
6
+ "sections": [
7
+ {
8
+ "name": "Content",
9
+ "selector": "body",
10
+ "format": "markdown",
11
+ "required": false
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "reddit",
3
+ "description": "Reddit post — title, content, and comments",
4
+ "order": 13,
5
+ "url_patterns": [
6
+ "^https?://(?:www\\.|old\\.)?reddit\\.com/r/[^/]+/comments/[^/]+"
7
+ ],
8
+ "remove": [
9
+ "script",
10
+ "style",
11
+ "svg",
12
+ "img",
13
+ "nav",
14
+ "footer",
15
+ "header",
16
+ ".promoted-post",
17
+ "shreddit-ad-post",
18
+ ".side",
19
+ ".sidebar",
20
+ ".footer-parent",
21
+ "#header",
22
+ ".sr-header-area",
23
+ ".menuarea",
24
+ ".linkinfo",
25
+ ".panestack-title",
26
+ ".report-button",
27
+ "shreddit-join-button",
28
+ "#overlayScrollContainer",
29
+ "#right-sidebar-container",
30
+ "#left-sidebar-container"
31
+ ],
32
+ "sections": [
33
+ {
34
+ "name": "Subreddit",
35
+ "selector": "a[href*='/r/'], shreddit-post a[href*='/r/']",
36
+ "format": "text",
37
+ "required": false
38
+ },
39
+ {
40
+ "name": "Title",
41
+ "selector": "h1, shreddit-post [slot='title']",
42
+ "format": "text",
43
+ "required": true
44
+ },
45
+ {
46
+ "name": "Author",
47
+ "selector": "a[href*='/user/'], shreddit-post a[href*='/user/'], [slot='authorName']",
48
+ "format": "text",
49
+ "required": false
50
+ },
51
+ {
52
+ "name": "Link",
53
+ "selector": "a[slot='external-anchor'], a.outbound-link, a[data-testid='outbound-link']",
54
+ "format": "attribute",
55
+ "attribute": "href",
56
+ "required": false
57
+ },
58
+ {
59
+ "name": "Content",
60
+ "selector": "[slot='text-body'], .text-body, .expando, .usertext-body .md",
61
+ "format": "markdown",
62
+ "required": false
63
+ }
64
+ ]
65
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "wikipedia",
3
+ "description": "Wikipedia article — title and main content",
4
+ "order": 11,
5
+ "url_patterns": [
6
+ "^https?://[a-z]{2,4}\\.wikipedia\\.org/wiki/[^:]+$"
7
+ ],
8
+ "remove": [
9
+ "script",
10
+ "style",
11
+ "svg",
12
+ "nav",
13
+ "footer",
14
+ ".mw-editsection",
15
+ ".reflist",
16
+ ".navbox",
17
+ ".sisterproject",
18
+ ".metadata",
19
+ ".sidebar",
20
+ ".infobox",
21
+ "#toc",
22
+ ".mw-jump-link",
23
+ ".printfooter",
24
+ ".catlinks",
25
+ ".mw-authority-control",
26
+ ".shortdescription",
27
+ ".mw-indicators",
28
+ ".page-actions",
29
+ ".mw-page-title-namespace",
30
+ ".mw-heading-subtitle"
31
+ ],
32
+ "sections": [
33
+ {
34
+ "name": "Title",
35
+ "selector": "#firstHeading, h1",
36
+ "format": "text",
37
+ "required": true
38
+ },
39
+ {
40
+ "name": "Content",
41
+ "selector": "#mw-content-text .mw-parser-output",
42
+ "format": "markdown",
43
+ "required": true
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "youtube",
3
+ "description": "YouTube video — title, channel, description",
4
+ "order": 30,
5
+ "url_patterns": [
6
+ "^https?://(?:www\\.)?(?:youtube\\.com/watch\\?v=|youtu\\.be/).+"
7
+ ],
8
+ "remove": [
9
+ "script",
10
+ "style",
11
+ "svg",
12
+ "img",
13
+ "nav",
14
+ "header",
15
+ "ytd-guide-renderer",
16
+ "ytd-mini-guide-renderer",
17
+ "#comments",
18
+ "#related",
19
+ "ytd-comments",
20
+ "ytd-live-chat-frame",
21
+ ".ytp-ad-module"
22
+ ],
23
+ "sections": [
24
+ {
25
+ "name": "Title",
26
+ "selector": "meta[name='title']",
27
+ "format": "attribute",
28
+ "attribute": "content",
29
+ "required": true
30
+ },
31
+ {
32
+ "name": "Channel",
33
+ "selector": "#owner a, ytd-video-owner-renderer a, #channel-name a",
34
+ "format": "text",
35
+ "required": false
36
+ },
37
+ {
38
+ "name": "Description",
39
+ "selector": "#description-inline-expander, ytd-text-inline-expander, #info-container",
40
+ "format": "markdown",
41
+ "required": false
42
+ }
43
+ ]
44
+ }
File without changes
File without changes
File without changes