MCP.so
ログイン

Creating an MCP Server in Go and Serving it with Docker

@ollama-tlms-golang

基本情報

カテゴリ

クラウドとインフラ

トランスポート

stdio

作者

ollama-tlms-golang

Creating an MCP Server in Go and Serving it with Docker について

概要はまだありません

Creating an MCP Server in Go and Serving it with Docker の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "05-make-your-mcp-server": {
      "command": "docker",
      "args": [
        "build",
        "-t",
        "mcp-curl",
        "."
      ]
    }
  }
}

Creating an MCP Server in Go and Serving it with Docker のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is mcp-curl?

mcp-curl is a Model Context Protocol (MCP) server written in Go that exposes a single tool to fetch the content of a webpage using curl. It is designed to be packaged with Docker and used with an MCP client like mcphost to give LLMs the ability to retrieve and analyze web content.

How to use mcp-curl?

Build the Docker image with docker build -t mcp-curl . from the provided Dockerfile. Then create an mcp.json file for mcphost that runs the Docker container interactively. Start mcphost with mcphost --config ./mcp.json --model ollama:qwen2.5-coder:14b to make the server available to the LLM.

Key features of mcp-curl

  • Written in Go using the mcp-go SDK.
  • Exposes a single tool use_curl that takes a required url parameter.
  • Communicates via standard input/output (stdio).
  • Packaged in a Docker image that includes both the Go binary and curl.
  • Designed for simplicity – easy to extend or modify.

Use cases of mcp-curl

  • Let an LLM fetch and summarize the content of a webpage.
  • Allow an LLM to extract information from a URL for analysis.
  • Provide a lightweight, containerized MCP server for local or remote use.
  • Serve as a starting template for building custom MCP tools in Go.

よくある質問

1

What dependencies are required to build and run mcp-curl?

Building requires Go 1.23.4 and Docker. Running requires Docker and an MCP client like `mcphost` (or any stdio‑based MCP client). The Docker image bundles `curl` from the `curlimages/curl:8.6.0` image.

2

What transport does mcp-curl use?

mcp-curl uses standard input/output (stdio) as its transport layer, as set up by `server.ServeStdio`.

3

How do I configure mcphost to use the Docker container?

Create an `mcp.json` file with the command `"docker"` and arguments `["run", "--rm", "-i", "mcp-curl"]`. Then run `mcphost --config ./mcp.json --model <model>`.

4

Can I modify mcp-curl to add more tools?

Yes. The README shows the minimal implementation, and the `mcp-go` library supports adding additional tools and handlers. You can extend `main.go` with new `mcp.NewTool` calls.

5

Where does my data live when using mcp-curl?

The server runs inside a Docker container and fetches web content on demand. Data is passed back to the MCP client via stdio and is not persistently stored by the server.

コメント

「クラウドとインフラ」の他のコンテンツ