mcp-catalog -example
Go MCP server example for AI-agent workflows with tools, resources, and prompts.
claude mcp add --transport stdio bearhuddleston-mcp-catalog-server-example bash -lc go build -o mcp-template-server ./cmd/mcpserver && ./mcp-template-server \ --env CGO_ENABLED="0" \ --env GO111MODULE="on"
How to use
This MCP server is a Go-based template designed to be driven by AI agents through spec-driven onboarding. It ships with a catalog-centric design that can be configured via mcp-spec.json to expose a dynamic set of items, tools, resources, and prompts. By default, you can list catalog items, fetch item details, and work with a plan/recommendation prompt to tailor recommendations to budget or goals. The server supports running in stdio or HTTP transport, and can be started with or without a spec file. When you provide a spec, the server reads it at startup and configures its behavior accordingly, while keeping the core transports and protocol stable. To explore the included capabilities, you can run the server and use the default tools (listItems, getItemDetails), the catalog resource, and the provided prompts (planRecommendation, itemBrief). The repository also includes demos that show ready-to-run mcp-spec.json files for different use cases such as service catalog, knowledge front door, and Playbook recommender.
How to install
Prerequisites:
- Go (1.18+ recommended)
- Git
- Optional: Docker if you want containerized runs
Steps:
- Install Go from https://golang.org/dl/ and ensure
go versionis available in your PATH. - Clone or download this repository.
- Build the MCP server:
go build -o mcp-template-server ./cmd/mcpserver - Run the server locally (default stdio transport):
./mcp-template-server - Run the server with HTTP transport on port 8080 and a spec file:
./mcp-template-server -transport http -port 8080 -spec ./mcp-spec.example.json - If you want to use the prebuilt demos, point the spec flag to one of the demo specs, for example:
./mcp-template-server -transport http -port 8080 -spec demos/service-catalog/mcp-spec.json
Docker (optional):
- Build and run a container for reproducible environments:
docker build -t mcp-template-server:local . docker run --rm -p 8080:8080 mcp-template-server:local ./mcp-template-server --transport http --port 8080 --spec /root/mcp-spec.example.json
Additional notes
Tips and caveats:
- The server is designed to be spec-driven; unknown JSON fields are rejected at load time, so keep your mcp-spec.json aligned with the schema described in the repo.
- For production, Docker is recommended to achieve isolation and reproducibility (use --read-only and security options as described in the Security Recommendation).
- If you modify the spec, you can validate startup by noting that startup will fail with a validation error if the spec is invalid.
- The default tools/resources/prompts can be overridden by the spec, so consult your mcp-spec.json to see which names and inputs are in use (e.g., list_items, get_item_details, catalog_items, plan_recommendation, item_brief).
- The included demos under demos/ provide ready-to-run examples and schemas to help bootstrap your own MCP server customization.
Related MCP Servers
go
deprecated: use the official MCP sdk! (https://github.com/modelcontextprotocol/go-sdk) / ⚡ A type-safe, intuitive Go SDK for building MCP servers with ease and confidence
go-utcp
Official Go implementation of the UTCP
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
mcp-catalog -template
Spec-driven Go MCP server template for AI-agent onboarding with tools, resources, and prompts.
miro
MCP server for controlling Miro whiteboards with AI assistants