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.
git clone --depth 1 https://github.com/noveldig/mcp-xhs-publisherWrote 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.
[](https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/project-structure)<a href="https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/project-structure"><img src="https://agentmods.dev/badge/rules/noveldig/mcp-xhs-publisher/project-structure/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.
<a href="https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/project-structure"><img src="https://agentmods.dev/badge/rules/noveldig/mcp-xhs-publisher/project-structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01653 | $0.01653 |
| Opus 5 | $0.00826 | $0.00826 |
| Sonnet 5 | $0.00331 | $0.00331 |
| Haiku 4.5 | $0.00165 | $0.00165 |
Grade A, and why
project-structure 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
项目结构指南 (Project Structure Guide)
本文档旨在为基于 MCP (Model Context Protocol) 的 Python 项目提供标准的项目结构和文件组织规范。遵循这些规范有助于保持代码库的清晰、一致和易于维护,特别是对于构建 MCP 服务器的场景。
核心目录与文件 (顶层结构)
一个典型的 MCP 服务器项目应包含以下核心目录和文件:
-
源代码 (
src/):- 所有项目的 Python 源代码都应放置在
src/目录下,并以项目名称(通常是 PyPI 包名)命名子目录。例如,src/my_mcp_server/。 - 包的初始化文件
__init__.py应位于src/my_mcp_server/__init__.py。
- 所有项目的 Python 源代码都应放置在
-
配置文件:
[pyproject.toml](mdc:pyproject.toml): 项目构建配置、依赖项及元数据。详细的配置和使用方法参见 使用 uv 打包与依赖管理指南。[uv.lock](mdc:uv.lock)(或等效的锁定文件): 确保依赖版本一致性。其生成和管理参见 使用 uv 打包与依赖管理指南。[.pre-commit-config.yaml](mdc:.pre-commit-config.yaml): (推荐) pre-commit 钩子配置。[.python-version](mdc:.python-version): (推荐) 指定项目 Python 版本。
-
文档与许可证:
[README.md](mdc:README.md): 项目入口文档。[LICENSE](mdc:LICENSE): 开源许可证文件。[CONTRIBUTING.md](mdc:CONTRIBUTING.md): (推荐) 贡献指南。
-
其他:
[Dockerfile](mdc:Dockerfile): (如果适用) Docker 镜像构建文件。[.gitignore](mdc:.gitignore): Git 忽略配置。
模块化与包架构 (src/<project_package_name>/ 内部)
在项目源代码包(例如 src/my_mcp_server/)内部,应根据功能和 MCP 核心概念将代码组织到不同的子包或模块中,以实现高内聚、低耦合。以下是一个推荐的通用包架构模式,供 MCP 服务器开发者参考:
__init__.py: 包的根初始化文件。可以用于暴露包的公共 API。server_runner.py(或main.py,app.py,__main__.py):config.py:- 职责:加载、管理和提供对服务器配置(如端口、外部服务凭证、功能开关等)的访问。
models/(子包):- 职责:存放数据结构定义,通常使用 Pydantic 或 dataclasses 实现。
models/__init__.pymodels/base_schemas.py: (可选) 定义通用的基础数据模型或共享结构。models/resource_schemas.py: 定义各种 MCP 资源内容的具体数据结构。models/tool_io_schemas.py: 定义 MCP 工具的输入参数和输出结果的数据结构。- (可根据领域进一步细化,例如
models/domain_specific_schemas.py)
resources/(子包):- 职责:实现 MCP 资源指南 中定义的 MCP 资源逻辑。每个主要的资源类型或一组相关的资源可以有自己的模块。
resources/__init__.pyresources/base_provider.py: (可选) 如果多个资源提供者有共享逻辑,可以定义一个基类。resources/resource_type_A_provider.py: 实现特定类型(例如 "documents" 或 "tasks")资源的listResources,retrieveResource,subscribeToResource等逻辑。resources/another_resource_group_provider.py: 实现另一组相关资源的逻辑。
tools/(子包):- 职责:实现 MCP 工具指南 中定义的 MCP 工具的执行逻辑。每个工具或一组功能相近的工具可以组织在一个模块中。
tools/__init__.pytools/base_executor.py: (可选) 如果多个工具有共享的执行前/后逻辑,可以定义一个基类。tools/action_category_X_executor.py: 实现某一类操作(例如 "file_operations" 或 "notification_services")的工具逻辑。tools/data_processing_executor.py: 实现数据处理相关工具的逻辑。
services/(或adapters/或clients/) (子包):- 职责:封装与外部服务或数据源(如第三方 API、数据库、消息队列等)的交互逻辑。
services/__init__.pyservices/external_api_client.py: 与某个特定第三方 HTTP API 通信的客户端。services/database_accessor.py: 提供数据库的增删改查接口。
exceptions.py:- 职责:定义项目中使用的自定义异常类,方便统一错误处理。
util/(或common/或helpers/) (子包):- 职责:存放项目中多处用到的通用辅助函数、类或常量。
util/__init__.pyutil/datetime_helpers.pyutil/string_formatters.py
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.
- 8d ago First seen · 79 lines · 1,653 tokens per session scan A 4132bb85997a
project-structure is a cursor rule published in the GitHub repository noveldig/mcp-xhs-publisher (1 stars, last pushed 1y ago), licensed MIT. It adds 1,653 tokens to every session, about $0.0083 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.
Other cursor rules, from other repositories
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.