add fetch MCP server

This commit is contained in:
Jack Adamson
2024-11-22 12:33:19 +00:00
parent 8e63b5e9b8
commit 781571b40d
8 changed files with 967 additions and 0 deletions

126
src/fetch/README.md Normal file
View File

@@ -0,0 +1,126 @@
# Fetch MCP Server
A Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.
Presently the server only supports fetching HTML content.
### Available Tools
- `fetch` - Fetches a URL from the internet and extracts its contents as markdown.
### Prompts
- **fetch**
- Fetch a URL and extract its contents as markdown
- Argument: `url` (string, required): URL to fetch
## Installation
### Using uv (recommended)
When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-fetch*.
### Using PIP
Alternatively you can install `mcp-server-fetch` via pip:
```
pip install mcp-server-fetch
```
After installation, you can run it as a script using:
```
python -m mcp_server_fetch
```
## Configuration
### Configure for Claude.app
Add to your Claude settings:
<details>
<summary>Using uvx</summary>
```json
"mcpServers": {
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
```
</details>
<details>
<summary>Using pip installation</summary>
```json
"mcpServers": {
"fetch": {
"command": "python",
"args": ["-m", "mcp_server_fetch"]
}
}
```
</details>
### Configure for Zed
Add to your Zed settings.json:
<details>
<summary>Using uvx</summary>
```json
"context_servers": [
"mcp-server-fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
],
```
</details>
<details>
<summary>Using pip installation</summary>
```json
"context_servers": {
"mcp-server-fetch": {
"command": "python",
"args": ["-m", "mcp_server_fetch"]
}
},
```
</details>
## Debugging
You can use the MCP inspector to debug the server. For uvx installations:
```
npx @modelcontextprotocol/inspector uvx mcp-server-fetch
```
Or if you've installed the package in a specific directory or are developing on it:
```
cd path/to/servers/src/fetch
npx @modelcontextprotocol/inspector uv run mcp-server-fetch
```
## Contributing
We encourage contributions to help expand and improve mcp-server-fetch. Whether you want to add new tools, enhance existing functionality, or improve documentation, your input is valuable.
For examples of other MCP servers and implementation patterns, see:
https://github.com/modelcontextprotocol/servers
Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements to make mcp-server-fetch even more powerful and useful.
## License
mcp-server-fetch is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.