Get the FREE Ultimate OpenClaw Setup Guide →

05-make-your

MCP server from ollama-tlms-golang/05-make-your-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ollama-tlms-golang-05-make-your-mcp-server docker run --rm -i mcp-curl

How to use

This MCP server implements a simple Go-based MCP server that exposes a single tool named use_curl. The tool accepts a required parameter url and executes curl -s on that URL, returning the page content as text. The server is designed to be run inside a Docker image alongside a curl-enabled runtime, enabling you to combine MCP tooling with your preferred LLM workflows. You can interact with the server via mcphost, which will expose the available tools and allow you to pass a URL for content retrieval. This setup is useful for enabling an LLM to fetch web content, summarize pages, or extract code snippets by delegating the fetch task to the MCP server rather than making direct network calls from the LLM environment.

How to install

Prerequisites:

  • Go tooling (the project is demonstrated in Go, but the runtime is wrapped in Docker for portability)
  • Docker (for the provided docker-based deployment)
  • mcphost (to connect to MCP servers) or an MCP client compatible with the MCP Go SDK

Step 1: Install prerequisites

Step 2: Build the Go MCP server locally (optional)

  • Ensure go.mod and main.go are present as shown in the README
  • Run: go mod tidy go build -o mcp-curl ./mcp-curl

Step 3: Build the Docker image (as described in the README)

  • docker build -t mcp-curl .

Step 4: Run the Docker-based MCP server and connect with mcphost

  • Create an mcp.json file consistent with the example: { "mcpServers": { "mcp-curl-with-docker": { "command": "docker", "args": [ "run", "--rm", "-i", "mcp-curl" ] } } }
  • Start mcphost using your configuration: mcphost --config ./mcp.json --model ollama:your-model

Step 5: Verify the tools

  • Use the mcphost UI or CLI to query available tools (e.g., /tools) and invoke the use_curl tool with a URL parameter.

Additional notes

Notes:

  • The Docker setup uses a multi-stage Dockerfile: the first stage builds the Go MCP server, and the second stage uses curlimages/curl to provide curl in the runtime image. This keeps the final image lightweight while ensuring curl is available.
  • The example tool is named use_curl and requires a single parameter url (string). Ensure the LLM or client passes a valid URL string.
  • If you want to add more tools later, follow the pattern in main.go: define tools with mcp.NewTool and register handlers with s.AddTool.
  • Environment variables can be added to the mcp.json under env if you need to pass API keys or config to the server in Docker.
  • If you encounter permissions or network issues inside Docker, ensure the container has network access and that curl is available inside the image.

Related MCP Servers

Sponsor this space

Reach thousands of developers