Cross-Platform MCP Server for Gopher and Gemini
Enable AI assistants to safely browse and interact with Gopher and Gemini using a modern, cross-platform MCP server.
npx -y @cameronrye/gopher-mcpOverview
This project provides a cross-platform MCP (Model Context Protocol) server that lets AI assistants safely browse, fetch, and interact with resources on the Gopher and Gemini networks. It exposes protocol-specific capabilities as MCP-compatible tools so language models can request content, follow links, and obtain rendered previews in a controlled, auditable fashion.
Running an MCP server for Gopher and Gemini centralizes policy, sanitization, and resource limits for browsing operations. Instead of letting a model open arbitrary network connections, you point it at this server and grant access only to well-defined tool actions (fetch, list, search, render). That improves safety and reproducibility while enabling assistants to use niche internet protocols that most modern clients no longer support.
Features
- Protocol support for Gopher and Gemini (fetching, listing, and rendering)
- MCP-compatible tool endpoints so models can call browsing actions
- Content sanitization and size limits to prevent abusive responses
- Configurable TLS support and host allowlists
- Docker and source build options for cross-platform deployment
- Lightweight, low-dependency runtime suitable for edge or cloud instances
Installation / Configuration
Clone the repository and run from source or use Docker. The repository is available at: https://github.com/cameronrye/gopher-mcp
Build from source (generic steps):
# If the project is implemented in Go:
# or run directly if using a language/runtime
Run with Docker:
Example minimal YAML configuration:
server:
listen: "0.0.0.0:8080"
tls:
cert_file: ""
key_file: ""
mcp:
service_name: "gopher-mcp"
max_response_bytes: 262144
request_timeout_seconds: 15
network:
user_agent: "gopher-mcp/1.0"
allowed_hosts:
logging:
level: "info"
Common configuration options
| Option | Type | Description |
|---|---|---|
| server.listen | string | IP:port to bind the HTTP/MCP server |
| server.tls.cert_file/key_file | string | Optional TLS certificate and key files |
| mcp.max_response_bytes | int | Maximum bytes returned to a model tool call |
| mcp.request_timeout_seconds | int | Per-request network timeout |
| network.user_agent | string | User-Agent header for outbound protocol requests |
| network.allowed_hosts | list | Host allowlist / wildcard patterns |
Adjust these values to match your deployment policies (for example, stricter timeouts and smaller response limits for publicly exposed instances).
Available Tools / Resources
The server exposes a set of MCP tools representing common browsing actions. Typical tool names and behaviors include:
- gopher.fetch — fetch a Gopher selector and return raw or parsed content
- gopher.list — list a Gopher directory (menu) entries
- gemini.fetch — fetch a Gemini URL and return raw bytes and metadata
- gemini.render — produce a sanitized, text/HTML preview suitable for model consumption
- search.index — optional indexing tool to provide keyword searches over fetched content
- link.preview — follow a link with safelisting and produce a short summary and content snippet
Each tool returns structured JSON-like results with status codes, MIME/type metadata, and truncated content to keep model context bounded. Refer to the MCP tool schema (embedded in the repo) for exact field names and error formats.
Use Cases
- Assistants that need to answer questions about legacy or niche content: an LLM can call gopher.list to enumerate a Gopher site and gopher.fetch to retrieve a specific document, then synthesize an answer without direct outbound network access.
- Content discovery and summarization: use gemini.fetch + gemini.render to retrieve Gemini capsules, convert them into sanitized text, and feed summaries back into a model for downstream analysis or indexing.
- Controlled browsing for multi-step tasks: chain MCP tool calls (search.index -> gopher.fetch -> link.preview) to let a model research and cite sources while enforcing size and host restrictions.
- Integration into pipelines: run the server behind an internal firewall and expose only the MCP surface to downstream agents or services, centralizing policy for TLS, timeouts, and logging.
Getting Started Tips
- Start with conservative limits (small max_response_bytes, short timeouts) and expand only after monitoring usage.
- Maintain an allowlist of trusted hosts rather than a broad allow-any policy for public instances.
- Enable TLS when exposing the server beyond a trusted network.
- Capture tool call logs for auditing model behavior and debugging agent interactions.
For full implementation details, usage examples, and schema references, consult the repository at https://github.com/cameronrye/gopher-mcp.