packaging-with-uv

packaging-with-uv is a cursor rule for Cursor from noveldig/mcp-xhs-publisher. It costs 1,990 tokens per session, scanned A, original, MIT.

A guide to managing Python dependencies and building packages with uv, a fast tool that installs and resolves Python packages. It focuses especially on projects published to PyPI, the main public index for Python packages.

In plain words
What is it for?
Set up pyproject.toml, manage dependencies with uv.lock, choose version constraints, and prepare a Python project for PyPI release.
Why use it?
It explains how to keep project metadata, dependency versions, lock files, and build settings consistent when packaging Python software.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Set up pyproject.toml, manage dependencies with uv.lock, choose version constraints, and prepare a Python project for PyPI release.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/noveldig/mcp-xhs-publisher/packaging-with-uv"><img src="https://agentmods.dev/badge/rules/noveldig/mcp-xhs-publisher/packaging-with-uv.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,990 This file is loaded in full into every session.
When invoked 1,990 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.01990 $0.01990
Opus 5 $0.00995 $0.00995
Sonnet 5 $0.00398 $0.00398
Haiku 4.5 $0.00199 $0.00199

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

Security

Grade A, and why

packaging-with-uv 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 12d 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/packaging-with-uv.mdc · 85 lines

How it starts

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

使用 uv 打包与依赖管理指南 (Packaging and Dependency Management with uv Guide)

本指南为使用 uv 进行 Python 项目的依赖管理和打包(特别关注旨在发布到 PyPI 的项目,并以 coze-mcp-server 作为一个应用了许多这些原则的示例项目)提供规范和最佳实践。 uv 是一个非常快速的 Python 包安装器和解析器,旨在替代 pippip-tools 的部分功能。

参考:

  • coze-mcp-server 项目中的 [pyproject.toml](mdc:pyproject.toml)[uv.lock](mdc:uv.lock) (作为实际项目配置的示例)。
  • coze-mcp-server [README.md](mdc:README.md) 中的安装说明 (展示了 uv 在实际使用中的一个场景)。

1. pyproject.toml 核心配置

[pyproject.toml](mdc:pyproject.toml) 是项目的核心配置文件,用于声明元数据、依赖项和构建系统。其在项目中的位置和基本作用可参考 项目结构指南 中关于配置文件的说明。

1.1. [project]

  • name: 项目的规范名称,即在 PyPI 上发布的名称 (e.g., coze-mcp-server)。
  • version: 项目版本号,遵循 PEP 440 (e.g., "0.0.4")。动态版本控制也是一种选择,但需谨慎。
  • description: 项目的简短描述。
  • readme: 指定 README 文件 (e.g., "README.md")。
  • requires-python: 指定项目兼容的 Python 版本 (e.g., ">=3.8")。
  • license: 指定许可证,例如 {text = "MIT License"}{file = "LICENSE"}
  • authors / maintainers: 列出作者和维护者信息。
  • dependencies: 列出项目运行所必需的核心依赖项,带有版本说明符 (e.g., fastapi >= 0.100.0, < 0.101.0)。
    • 尽量使用兼容版本 (~=), 范围版本 (>=, <) 或精确版本 (==) 来平衡灵活性和稳定性。
  • [project.optional-dependencies]: 定义可选的依赖组,例如 dev, test
    • coze-mcp-serverpyproject.toml 中定义了 dev 依赖。
    • 安装可选依赖:uv pip install .[dev]
    • 针对特定功能(如 CLI 工具)的可选依赖: 许多包(例如 mcp Python SDK)会通过可选依赖项提供额外功能。例如,如果一个包提供了命令行工具,它可能会通过一个名为 cli 的 "extra" 来提供。安装时可以使用 uv pip install package_name[cli]
      • 参考 modelcontextprotocol/python-sdk 的 README ([mdc:https:/github.com/modelcontextprotocol/python-sdk/blob/main/README.md]),其中提到了 "standalone MCP development tools" (例如 mcp run, mcp dev)。这类工具通常就是通过类似 mcp[cli] 的方式安装的。开发者应查阅对应包的 pyproject.toml 或文档来确定可用的 "extras"。
  • [project.urls]: 提供项目的相关链接,如 Homepage, Repository, Bug Tracker
  • [project.scripts]: (如果适用) 定义通过命令行可执行的脚本。对于 coze-mcp-server 这种通过 python -m 运行的包,可能不直接在这里定义,而是通过包的 __main__.py
    • coze-mcp-serverREADME.md 中配置 Claude.app/Zed 时,使用了 python -m coze_mcp_serveruvx coze-mcp-server
  • classifiers: 提供 PyPI 分类器,帮助用户发现项目。

Read the full file on GitHub · 85 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. 12d ago First seen · 85 lines · 1,990 tokens per session scan A c60a370b0ccd

Subscribe to this mod's changes

packaging-with-uv is a cursor rule published in the GitHub repository noveldig/mcp-xhs-publisher (1 stars, last pushed 1y ago), licensed MIT. It adds 1,990 tokens to every session, about $0.0100 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.