Skip to content

Commit 2b4e438

Browse files
authored
Update README (#5)
- Update ToolHive install doc link - Update thv client config command - Format with Prettier
1 parent 8d6c359 commit 2b4e438

File tree

1 file changed

+56
-36
lines changed

1 file changed

+56
-36
lines changed

README.md

Lines changed: 56 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@ An SSE Go implementation of the `fetch` MCP server that retrieves web content.
1111

1212
## Why _this_ fetch and not `mcp/fetch`?
1313

14-
This Go implementation provides similar functionality as the original [Python MCP fetch server](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch) but has the following benefits:
14+
This Go implementation provides similar functionality as the original
15+
[Python MCP fetch server](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch)
16+
but has the following benefits:
1517

1618
- Lower memory usage
1719
- Faster startup time / shutdown time
18-
- Single binary deployment - making tool poisoning attacks harder than in interpreted languages
20+
- Single binary deployment - making tool poisoning attacks harder than in
21+
interpreted languages
1922
- Better concurrent request handling
20-
- Better container security [than original](https://github.com/modelcontextprotocol/servers/blob/main/src/fetch/Dockerfile)
21-
- Non root user
22-
- Distroless / minimal image
23-
- Container signing with build provenance
24-
- SSE not STDIO
23+
- Better container security
24+
[than original](https://github.com/modelcontextprotocol/servers/blob/main/src/fetch/Dockerfile)
25+
- Non-root user
26+
- Distroless / minimal image
27+
- Container signing with build provenance
28+
- Uses SSE transport instead of STDIO
2529
- More test coverage
2630

2731
## Prerequisites
@@ -33,22 +37,22 @@ This Go implementation provides similar functionality as the original [Python MC
3337

3438
1. Clone the repository:
3539

36-
```bash
37-
git clone https://github.com/StacklokLabs/fetch.git
38-
cd fetch
39-
```
40+
```bash
41+
git clone https://github.com/StacklokLabs/fetch.git
42+
cd fetch
43+
```
4044

4145
2. Install dependencies:
4246

43-
```bash
44-
task install
45-
```
47+
```bash
48+
task install
49+
```
4650

4751
3. Build the server:
4852

49-
```bash
50-
task build
51-
```
53+
```bash
54+
task build
55+
```
5256

5357
## Usage
5458

@@ -61,13 +65,16 @@ task run
6165
```
6266

6367
The server will start and expose:
68+
6469
- SSE endpoint: `http://localhost:8080/sse`
6570
- Message endpoint: `http://localhost:8080/message`
6671

6772
#### Command Line Options
6873

69-
- `--addr`: Address to listen on (default: ":8080", can be set via MCP_PORT env var)
70-
- `--user-agent`: Custom User-Agent string (default: "Mozilla/5.0 (compatible; MCPFetchBot/1.0)")
74+
- `--addr`: Address to listen on (default: ":8080", can be set via MCP_PORT env
75+
var)
76+
- `--user-agent`: Custom User-Agent string (default: "Mozilla/5.0 (compatible;
77+
MCPFetchBot/1.0)")
7178
- `--ignore-robots-txt`: Ignore robots.txt rules
7279
- `--proxy-url`: Proxy URL for requests
7380

@@ -121,14 +128,18 @@ The server provides a single tool called `fetch` with the following parameters:
121128

122129
### Tool: `fetch`
123130

124-
Fetches a URL from the internet and optionally extracts its contents as markdown.
131+
Fetches a URL from the internet and optionally extracts its contents as
132+
markdown.
125133

126134
#### Parameters
127135

128136
- `url` (required): The URL to fetch
129-
- `max_length` (optional): Maximum number of characters to return (default: 5000, max: 1000000)
130-
- `start_index` (optional): Starting character index for content extraction (default: 0)
131-
- `raw` (optional): Return raw HTML content without simplification (default: false)
137+
- `max_length` (optional): Maximum number of characters to return (default:
138+
5000, max: 1000000)
139+
- `start_index` (optional): Starting character index for content extraction
140+
(default: 0)
141+
- `raw` (optional): Return raw HTML content without simplification (default:
142+
false)
132143

133144
#### Examples
134145

@@ -143,7 +154,7 @@ Fetches a URL from the internet and optionally extracts its contents as markdown
143154

144155
```json
145156
{
146-
"name": "fetch",
157+
"name": "fetch",
147158
"arguments": {
148159
"url": "https://example.com",
149160
"max_length": 1000,
@@ -180,20 +191,24 @@ task deps
180191

181192
## Running as an MCP Server with ToolHive
182193

183-
fetch can be run as a Model Context Protocol (MCP) server using [ToolHive](https://github.com/stacklok/toolhive), which simplifies the deployment and management of MCP servers.
194+
fetch can be run as a Model Context Protocol (MCP) server using
195+
[ToolHive](https://github.com/stacklok/toolhive), which simplifies the
196+
deployment and management of MCP servers.
184197

185198
### Prerequisites
186199

187-
1. Install ToolHive by following the [installation instructions](https://github.com/stacklok/toolhive#installation).
200+
1. Install ToolHive by following the
201+
[installation instructions](https://docs.stacklok.com/toolhive/guides-cli/install).
188202
2. Ensure you have Docker or Podman installed on your system.
189203

190204
### Running fetch with ToolHive (Recommended)
191205

192-
The easiest way to run fetch is using the packaged version available in ToolHive's registry:
206+
The easiest way to run fetch is using the packaged version available in
207+
ToolHive's registry:
193208

194209
```bash
195-
# Enable auto-discovery to automatically configure supported clients
196-
thv config auto-discovery true
210+
# Register a supported client so ToolHive can auto-configure your environment
211+
thv client setup
197212

198213
# Run the fetch server
199214
thv run fetch --transport sse
@@ -207,14 +222,16 @@ thv registry info fetch
207222

208223
### Advanced Usage with Custom Configuration
209224

210-
For advanced users who need custom configuration, you can also run fetch using the container image directly:
225+
For advanced users who need custom configuration, you can also run fetch using
226+
the container image directly:
211227

212228
```bash
213229
# Run the fetch server using the published container image
214230
thv run --name fetch --transport sse --target-port 8080 ghcr.io/stackloklabs/fetch/server:latest
215231
```
216232

217233
This command:
234+
218235
- Names the server instance "fetch"
219236
- Uses the SSE transport protocol
220237
- Uses the latest published fetch image from GitHub Container Registry
@@ -233,7 +250,8 @@ To verify that the fetch server is running:
233250
thv list
234251
```
235252

236-
This will show all running MCP servers managed by ToolHive, including the fetch server.
253+
This will show all running MCP servers managed by ToolHive, including the fetch
254+
server.
237255

238256
To stop the fetch server:
239257

@@ -251,14 +269,16 @@ thv rm fetch
251269

252270
## Contributing
253271

254-
We welcome contributions to this MCP server! If you'd like to contribute, please review
255-
the [CONTRIBUTING guide](./CONTRIBUTING.md) for details on how to get started.
272+
We welcome contributions to this MCP server! If you'd like to contribute, please
273+
review the [CONTRIBUTING guide](./CONTRIBUTING.md) for details on how to get
274+
started.
256275

257276
If you run into a bug or have a feature request, please
258-
[open an issue](https://github.com/StacklokLabs/fetch/issues) in the
259-
repository or join us in the `#mcp-servers` channel on our
277+
[open an issue](https://github.com/StacklokLabs/fetch/issues) in the repository
278+
or join us in the `#mcp-servers` channel on our
260279
[community Discord server](https://discord.gg/stacklok).
261280

262281
## License
263282

264-
This project is licensed under the Apache v2 License - see the LICENSE file for details.
283+
This project is licensed under the Apache v2 License - see the LICENSE file for
284+
details.

0 commit comments

Comments
 (0)