Creating an MCP Server in Go and Serving it with Docker
@ollama-tlms-golang
关于 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",
"."
]
}
}
}工具
未检测到工具
工具是从 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-goSDK. - Exposes a single tool
use_curlthat takes a requiredurlparameter. - 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.
FAQ from mcp-curl
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.
What transport does mcp-curl use?
mcp-curl uses standard input/output (stdio) as its transport layer, as set up by server.ServeStdio.
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>.
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.
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.
云与基础设施 分类下的更多 MCP 服务器
Supabase MCP Server
supabase-communityConnect Supabase to your AI assistants
🐋 Docker MCP server
ckreilingMCP server for Docker
AWS MCP
RafalWilinskiTalk with your AWS using Claude. Model Context Protocol (MCP) server for AWS. Better Amazon Q alternative.
Kubernetes MCP Server
manusaModel Context Protocol (MCP) server for Kubernetes and OpenShift
container-use
daggerDevelopment environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack.
评论