mcp-client-guidelines

mcp-client-guidelines is a cursor rule for Cursor from noveldig/mcp-xhs-publisher. It costs 1,165 tokens per session, scanned A, original, MIT.

A set of guidelines for building MCP clients—programs that connect to MCP servers to discover and use their tools, resources, and prompts.

In plain words
What is it for?
Use it when writing an MCP client that discovers server capabilities, retrieves or subscribes to resources, or runs server tools.
Why use it?
It gives developers a consistent way to configure connections, handle responses and errors, and communicate safely with MCP servers.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when writing an MCP client that discovers server capabilities, retrieves or subscribes to resources, or runs server tools.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/noveldig/mcp-xhs-publisher/mcp-client-guidelines
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/noveldig/mcp-xhs-publisher

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 mcp-client-guidelines

README.md
[![agentmods](https://agentmods.dev/badge/rules/noveldig/mcp-xhs-publisher/mcp-client-guidelines/github.svg)](https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/mcp-client-guidelines)
Your own site
<a href="https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/mcp-client-guidelines"><img src="https://agentmods.dev/badge/rules/noveldig/mcp-xhs-publisher/mcp-client-guidelines/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 mcp-client-guidelines

Your own site · 80×15
<a href="https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/mcp-client-guidelines"><img src="https://agentmods.dev/badge/rules/noveldig/mcp-xhs-publisher/mcp-client-guidelines.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,165 This file is loaded in full into every session.
When invoked 1,165 The same file — it is already loaded in full.
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.01165 $0.01165
Opus 5 $0.00583 $0.00583
Sonnet 5 $0.00233 $0.00233
Haiku 4.5 $0.00117 $0.00117

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

Security

Grade A, and why

mcp-client-guidelines 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.

.cursor/rules/mcp-client-guidelines.mdc · 64 lines

How it starts

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

MCP 客户端指南 (MCP Client Guidelines)

本指南为开发 MCP (Model Context Protocol) 客户端应用程序提供规范和最佳实践。MCP 客户端是与 MCP 服务器(如 coze-mcp-server)交互以利用其提供的资源和工具的程序。

参考:

1. 客户端角色与职责

根据 MCP 核心架构指南,MCP 客户端的核心职责包括:

  • 建立和维护与 MCP 服务器的安全连接。
  • 发现服务器提供的能力,主要是资源工具
  • 根据主机或 LLM 的指令,请求资源、执行工具或使用提示
  • 处理来自服务器的响应、更新和错误。
  • 将结果和信息传递回主机或 LLM。

2. 连接与配置

  • 服务器发现: 客户端需要机制来发现和配置 MCP 服务器的连接信息。参考 coze-mcp-server[README.md](mdc:README.md) 中的配置示例。
  • 传输协议: 客户端必须支持服务器所使用的 MCP 传输协议 (Transports)。
  • 安全性: 优先使用安全连接 (e.g., WSS)。

3. 与服务器交互

客户端通过 MCP 协议定义的方法与服务器交互以发现和使用其能力。

3.1. 能力发现

  • 列举资源 (listResources): 调用此方法发现服务器提供的可用资源。服务器端资源定义参见 MCP 资源指南
  • 列举工具 (listTools): 调用此方法获取服务器支持的工具列表及其定义。服务器端工具定义参见 MCP 工具指南
  • 列举提示 (listPrompts): (如果适用) 发现服务器提供的提示模板。相关概念参见 MCP 高级概念指南
  • 查询根 (getRoots): (如果适用) 通过查询服务器的根 (Roots) 来了解顶层资源类别。

3.2. 使用能力

  • 检索资源 (retrieveResource): 根据 URI 获取特定资源的内容和元数据。
  • 订阅资源 (subscribeToResource): 对于动态资源,客户端应订阅更新并处理 resourceChanged 通知。
  • 执行工具 (executeTool): 构造包含工具名称和正确参数的 executeTool 请求。
  • 使用提示 (executePrompt): (如果适用) 选择提示模板,填充参数,并发送执行请求。

3.3. 处理响应

  • 成功响应: 解析服务器返回的数据。
  • 错误处理: 优雅地处理来自服务器的错误响应。
  • 异步通信: MCP 交互通常是异步的,客户端需能处理并发请求和响应。

4. 客户端开发最佳实践

  • 使用 MCP SDK: 强烈推荐使用官方 MCP SDK (如 modelcontextprotocol/python-sdk for Python)。
  • 状态管理: 维护有关已连接服务器、可用资源和订阅的状态。
  • 用户界面/体验 (UX): 清晰展示可用的能力和操作反馈。
  • 日志记录: 实现详细的日志记录,特别是在通信边界。
  • 可重试性与超时: 实现合理的重试逻辑和超时机制。
  • 遵守服务器限制: 注意并遵守服务器可能存在的速率限制或配额。
  • 客户端项目的整体结构和编码风格也应遵循通用的 项目结构指南Python 编码标准指南(如果适用)。

Read the full file on GitHub · 64 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 · 64 lines · 1,165 tokens per session scan A 0944730a1127

Subscribe to this mod's changes

mcp-client-guidelines is a cursor rule published in the GitHub repository noveldig/mcp-xhs-publisher (1 stars, last pushed 1y ago), licensed MIT. It adds 1,165 tokens to every session, about $0.0058 per session on Opus 5. 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.