go-mcp

go-mcp is a cursor rule for Cursor from dstotijn/mcp-cbs-cijfers-open-data. It costs 0 tokens per session (1,016 once invoked), scanned A, original, Apache-2.0.

A set of Go development rules for building MCP servers with the go-mcp library. MCP is a standard way for an AI assistant to use external tools and services.

In plain words
What is it for?
Creating MCP servers, configuring transports, registering tools, defining JSON parameters, handling results, and supporting graceful shutdown.
Why use it?
It gives the assistant consistent guidance for server setup, tool definitions, responses, errors, cancellation, and shutdown.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

Good fit Creating MCP servers, configuring transports, registering tools, defining JSON parameters, handling results, and supporting graceful shutdown.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/dstotijn/mcp-cbs-cijfers-open-data/go-mcp
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/dstotijn/mcp-cbs-cijfers-open-data

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-mcp

README.md
[![agentmods](https://agentmods.dev/badge/rules/dstotijn/mcp-cbs-cijfers-open-data/go-mcp/github.svg)](https://agentmods.dev/rules/dstotijn/mcp-cbs-cijfers-open-data/go-mcp)
Your own site
<a href="https://agentmods.dev/rules/dstotijn/mcp-cbs-cijfers-open-data/go-mcp"><img src="https://agentmods.dev/badge/rules/dstotijn/mcp-cbs-cijfers-open-data/go-mcp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-mcp

Your own site · 80×15
<a href="https://agentmods.dev/rules/dstotijn/mcp-cbs-cijfers-open-data/go-mcp"><img src="https://agentmods.dev/badge/rules/dstotijn/mcp-cbs-cijfers-open-data/go-mcp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,016 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01016
Opus 5 $0.00000 $0.00508
Sonnet 5 $0.00000 $0.00203
Haiku 4.5 $0.00000 $0.00102

Measured 10d ago against content hash cf3e31a8bdff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

go-mcp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • go-mcp — 95% identical, 19 lines differ
.cursor/rules/go-mcp.mdc · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Description

This rule provides guidelines for working with the Model Context Protocol (MCP) in Go applications using the go-mcp library. MCP is a protocol for AI assistants to interact with external tools and services.

Rule

When working with MCP in Go:

MCP Server Setup

  1. Use mcp.NewServer() with appropriate configuration options to create a new MCP server
  2. Configure transports based on requirements (stdio, HTTP/JSON-RPC, SSE)
  3. Always handle graceful shutdown of the server
  4. Use context for cancellation and timeouts
  5. Register all tools before starting the server

Tool Implementation

  1. Define tool parameters as Go structs with JSON tags
  2. Add descriptive comments to struct fields for parameter documentation
  3. Use mcp.CreateTool() to create new tools with proper definitions
  4. Focus on business logic in tool handlers (validation is automatic)
  5. Return appropriate mcp.CallToolResult objects with clear content

Content Types

  1. Use appropriate content types (mcp.TextContent, mcp.JSONContent, etc.)
  2. Structure complex responses using multiple content objects
  3. Set the IsError flag when returning error results
  4. Use helper functions for common response patterns

Context Handling

  1. Pass context through to all tool handlers
  2. Respect context cancellation in long-running operations
  3. Use context timeouts for external API calls
  4. Add appropriate values to context when needed

Error Handling

  1. Return error results rather than panicking
  2. Provide clear, user-friendly error messages
  3. Include relevant details in error messages
  4. Use helper functions for creating error responses

Testing

  1. Write unit tests for tool handlers
  2. Mock external dependencies in tests
  3. Test both success and error cases
  4. Use table-driven tests for multiple scenarios

Implementation

  • The Cursor IDE will enforce this rule by:
    • Providing suggestions for MCP implementation
    • Highlighting potential issues in MCP code
    • Offering refactoring options to improve code quality

Read the full file on GitHub · 149 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 149 lines · 1,016 tokens per session scan A cf3e31a8bdff

Subscribe to this mod's changes

go-mcp is a cursor rule published in the GitHub repository dstotijn/mcp-cbs-cijfers-open-data (8 stars, last pushed 1y ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,016 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.