ask-web-fetch-mcp 0.1.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1aa57d85315d18fe95c6db0a3eac3ee66cb5e74618e316de5fc248710fc2d5d3
4
+ data.tar.gz: 6597f0ee539ee331510baeeebeb72a1e6dc1a2b9d6a9812bf18348bc3c080f0b
5
+ SHA512:
6
+ metadata.gz: 250774dd7ae46c7c137d4795a37372c3e92ff823de088ba990a2fa6ea6d35899e6646066c3218cbc6831f52fb02f816023ae1904a4b45c7af566a0ff182305f5
7
+ data.tar.gz: 8b57d4f583f1cf887031cf92697cf37dfa3638dbc15c49710f5a07c3e2ae116ebabeac673466373f098b79d7ed1c288c1247af98ee6d133706b316131daaab18
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ ## [0.1.0] — 2026-08-04
2
+
3
+ ### Added
4
+
5
+ - Initial release: MCP (Model Context Protocol) server over stdio exposing
6
+ `Ask::Tools::WebFetch` as the `ask_web_fetch` tool.
7
+ - Exposes the full backend chain (local pure-Ruby fetch with automatic Jina
8
+ Reader fallback) to any MCP client (ZCode, Claude Code, etc.).
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kaka Ruto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # ask-web-fetch-mcp
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/ask-web-fetch-mcp.svg)](https://badge.fury.io/rb/ask-web-fetch-mcp)
4
+
5
+ A minimal MCP (Model Context Protocol) server that exposes
6
+ `Ask::Tools::WebFetch` as a callable tool over stdio. Designed for use with
7
+ clients that support MCP (ZCode, Claude Code, etc.), it fetches a URL and
8
+ returns clean markdown for LLM consumption — via the local pure-Ruby backend
9
+ by default, with an automatic Jina Reader fallback for JS-rendered or blocked
10
+ pages.
11
+
12
+ ## Installation
13
+
14
+ ```ruby
15
+ gem "ask-web-fetch-mcp"
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ Run the server:
21
+
22
+ ```sh
23
+ ask-web-fetch-mcp
24
+ ```
25
+
26
+ The server listens for JSON-RPC messages on stdin and writes responses to
27
+ stdout — the standard MCP stdio transport. Register it as an MCP server in
28
+ your client configuration:
29
+
30
+ ```json
31
+ {
32
+ "mcp": {
33
+ "servers": {
34
+ "ask-web-fetch-mcp": {
35
+ "type": "stdio",
36
+ "command": "ask-web-fetch-mcp",
37
+ "args": []
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ The exposed tool is named `ask_web_fetch` (the `ask_` prefix avoids
45
+ collisions with client-side tools of the same name, matching
46
+ `ask-web-search-mcp`). It accepts a `url` argument and an optional
47
+ `max_chars`, and returns the page content as markdown:
48
+
49
+ ```
50
+ {"jsonrpc":"2.0","id":1,"method":"tools/call",
51
+ "params":{"name":"ask_web_fetch","arguments":{"url":"https://www.ruby-lang.org/en/"}}}
52
+ ```
53
+
54
+ ## Configuration
55
+
56
+ The `ask-web-fetch` backend chain applies unchanged. Optional environment
57
+ variables:
58
+
59
+ - `JINA_API_KEY` — enables the Jina fallback with higher rate limits
60
+ - `DEBUG=1` — ask-mcp debug logging on stderr
61
+
62
+ ## Full documentation
63
+
64
+ The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs.
65
+ [Core: Web Fetch](https://ask-rb.github.io/ask-docs/core/web-fetch) covers
66
+ ask-web-fetch in depth. API reference: https://ask-rb.github.io/ask-docs/reference/api.
67
+
68
+ ## Development
69
+
70
+ ```
71
+ bundle install
72
+ bundle exec rake test
73
+ ```
74
+
75
+ ## License
76
+
77
+ MIT
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'ask/web_fetch/mcp'
5
+
6
+ Ask::WebFetch::MCP.start
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ask
4
+ module WebFetch
5
+ module MCP
6
+ VERSION = '0.1.0'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ask/mcp'
4
+ require 'ask/web_fetch'
5
+ require_relative 'mcp/version'
6
+
7
+ module Ask
8
+ module WebFetch
9
+ # MCP (Model Context Protocol) server for ask-web-fetch.
10
+ module MCP
11
+ # Builds the tool exposed over MCP: Ask::Tools::WebFetch renamed to
12
+ # "ask_web_fetch" to avoid collisions with client-side tools of the
13
+ # same name (ask-web-search-mcp follows the same convention).
14
+ def self.tool
15
+ tool = Ask::Tools::WebFetch.new
16
+ tool.define_singleton_method(:name) { 'ask_web_fetch' }
17
+ tool
18
+ end
19
+
20
+ # Start the MCP server over stdio, exposing the ask_web_fetch tool.
21
+ #
22
+ # $ ask-web-fetch-mcp
23
+ #
24
+ # The server listens for JSON-RPC messages on stdin and writes
25
+ # responses to stdout — the standard MCP stdio transport. Register
26
+ # this executable as an MCP server in your client configuration:
27
+ #
28
+ # "mcp": {
29
+ # "servers": {
30
+ # "ask-web-fetch-mcp": {
31
+ # "type": "stdio",
32
+ # "command": "ask-web-fetch-mcp",
33
+ # "args": []
34
+ # }
35
+ # }
36
+ # }
37
+ def self.start
38
+ Ask::MCP::Server.start_stdio(
39
+ name: 'ask-web-fetch-mcp',
40
+ tools: [tool],
41
+ capabilities: { tools: {} },
42
+ debug: ENV['DEBUG'] == '1'
43
+ )
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ask/web_fetch/mcp'
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ask-web-fetch-mcp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kaka Ruto
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: ask-mcp
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0.1'
26
+ - !ruby/object:Gem::Dependency
27
+ name: ask-web-fetch
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0.2'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0.2'
40
+ - !ruby/object:Gem::Dependency
41
+ name: minitest
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '5.25'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '5.25'
54
+ - !ruby/object:Gem::Dependency
55
+ name: rake
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '13.0'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '13.0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: webmock
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.26'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.26'
82
+ description: |
83
+ A minimal MCP (Model Context Protocol) server that exposes Ask::Tools::WebFetch
84
+ as a callable tool over stdio. Designed for use with clients that support MCP
85
+ (ZCode, Claude Code, etc.), it fetches a URL and returns clean markdown via the
86
+ local pure-Ruby backend, with an automatic Jina Reader fallback.
87
+ email:
88
+ - kaka@myrrlabs.com
89
+ executables:
90
+ - ask-web-fetch-mcp
91
+ extensions: []
92
+ extra_rdoc_files: []
93
+ files:
94
+ - CHANGELOG.md
95
+ - LICENSE
96
+ - README.md
97
+ - bin/ask-web-fetch-mcp
98
+ - lib/ask-web-fetch-mcp.rb
99
+ - lib/ask/web_fetch/mcp.rb
100
+ - lib/ask/web_fetch/mcp/version.rb
101
+ homepage: https://github.com/ask-rb/ask-web-fetch-mcp
102
+ licenses:
103
+ - MIT
104
+ metadata:
105
+ homepage_uri: https://github.com/ask-rb/ask-web-fetch-mcp
106
+ source_code_uri: https://github.com/ask-rb/ask-web-fetch-mcp
107
+ changelog_uri: https://github.com/ask-rb/ask-web-fetch-mcp/blob/master/CHANGELOG.md
108
+ rubygems_mfa_required: 'true'
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '3.2'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubygems_version: 4.0.3
124
+ specification_version: 4
125
+ summary: MCP server for web fetch
126
+ test_files: []