mcp-server-guidelines

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

A reference guide for building MCP servers, which are programs that let AI clients safely access data and run operations. It covers the Model Context Protocol, a standard way for these programs to communicate.

In plain words
What is it for?
Use it when implementing MCP connections, data resources, tools, prompts, sessions, security, authentication, authorization, and configuration in a server application.
Why use it?
It helps developers follow the protocol and define server capabilities consistently, reducing mistakes in how clients discover and use data or tools.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when implementing MCP connections, data resources, tools, prompts, sessions, security, authentication, authorization, and configuration in a server application.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/mcp-server-guidelines"><img src="https://agentmods.dev/badge/rules/noveldig/mcp-xhs-publisher/mcp-server-guidelines.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,997 This file is loaded in full into every session.
When invoked 1,997 The same file — it is already loaded in full.
Security scan A 1 finding. 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.01997 $0.01997
Opus 5 $0.00999 $0.00999
Sonnet 5 $0.00399 $0.00399
Haiku 4.5 $0.00200 $0.00200

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

Security

Grade A, and why

mcp-server-guidelines scanned grade A with 1 finding 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.

Asks the agent to reveal its instructionslowSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

"""Create an echo prompt"""

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.cursor/rules/mcp-server-guidelines.mdc · 140 lines

How it starts

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

MCP 服务器指南 (MCP Server Guidelines)

本指南为开发 MCP (Model Context Protocol) 服务器应用程序(如 coze-mcp-server)提供详细的规范和最佳实践。MCP 服务器的核心职责是向 MCP 客户端(以及通过客户端操作的 LLM)安全有效地暴露数据(资源)和功能(工具)。

参考:

1. 服务器核心职责

根据 MCP 核心架构指南 的定义,MCP 服务器的关键职责包括:

  • 实现 MCP 协议: 严格遵守 MCP 规范,处理来自客户端的请求并发送正确的响应和通知。
  • 暴露能力: 主要通过以下方式:
    • 资源: 定义、管理并通过 MCP 协议方法(如 listResources, retrieveResource, subscribeToResource)暴露数据和内容。详细定义和实现指南参见 MCP 资源指南
    • 工具: 定义、实现并通过 MCP 协议方法(如 listTools, executeTool)暴露具体操作。详细定义和实现指南参见 MCP 工具指南
    • 提示 (Prompts): (如果适用) 定义并暴露可重用的提示模板。参见 MCP 高级概念指南
  • 连接管理: 监听来自客户端的连接请求,并管理活动的客户端会话。
  • 安全性: 确保对数据和功能的访问是安全的,实施必要的认证和授权机制。
  • 配置: 提供清晰的配置选项。特定项目的 [README.md](mdc:README.md) (例如 coze-mcp-server 的 README) 可以作为如何记录这些配置的良好示例。

2. 实现资源和工具的最佳实践

服务器在实现其核心功能(即提供资源和工具)时,应遵循各自的详细指南:

确保这些实现与 MCP 协议规范完全兼容,并且易于客户端发现和使用。

3. 服务器端开发最佳实践

  • 使用 MCP SDK: 强烈推荐使用官方的 MCP Python SDK (通常作为 mcp 包通过 pip 安装,其源码和详细文档/示例见 modelcontextprotocol/python-sdk)。该 SDK 极大地简化了服务器开发:
    • 它能处理大部分底层 MCP 协议的复杂性。
    • 提供了如 FastMCP 这样的高级抽象来快速搭建服务器,并通过装饰器(例如 @mcp.resource, @mcp.tool, @mcp.prompt)等便捷方式来定义资源、工具和提示,如其 README 中的示例所示。
    • 对于需要更细致控制的场景,SDK 也支持使用低层级服务器接口。
    • 可以参考 coze-mcp-server 项目,它是一个基于 Python SDK 实现 MCP 服务器的良好示例,展示了这些 SDK 特性的应用。

Read the full file on GitHub · 140 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 · 140 lines · 1,997 tokens per session scan A c5393fd17afc

Subscribe to this mod's changes

mcp-server-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,997 tokens to every session, about $0.0100 per session on Opus 5. A static security scan graded it A with 1 finding (asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.