40-deploy

40-deploy is a cursor rule for Cursor from marianfoo/mcp-sap-docs. It costs 713 tokens per session, scanned A, original, Apache-2.0.

Deployment and operations rules for running MCP services with PM2, a process manager that keeps server programs running. They describe the GitHub Actions deployment flow, setup script, environment values, and health checks.

In plain words
What is it for?
Deploying from GitHub, managing proxy and HTTP services, configuring logs and result limits, checking endpoints, and optimising repository downloads.
Why use it?
They make production updates and service checks follow a defined process instead of relying on manual, inconsistent steps.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Deploying from GitHub, managing proxy and HTTP services, configuring logs and result limits, checking endpoints, and optimising repository downloads.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/marianfoo/mcp-sap-docs/40-deploy
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/marianfoo/mcp-sap-docs

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 40-deploy

README.md
[![agentmods](https://agentmods.dev/badge/rules/marianfoo/mcp-sap-docs/40-deploy/github.svg)](https://agentmods.dev/rules/marianfoo/mcp-sap-docs/40-deploy)
Your own site
<a href="https://agentmods.dev/rules/marianfoo/mcp-sap-docs/40-deploy"><img src="https://agentmods.dev/badge/rules/marianfoo/mcp-sap-docs/40-deploy/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 40-deploy

Your own site · 80×15
<a href="https://agentmods.dev/rules/marianfoo/mcp-sap-docs/40-deploy"><img src="https://agentmods.dev/badge/rules/marianfoo/mcp-sap-docs/40-deploy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 713 This file is loaded in full into every session.
When invoked 713 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.00713 $0.00713
Opus 5.5 $0.00285 $0.00285
Sonnet 5.5 $0.00143 $0.00143
Haiku 4.5 $0.00071 $0.00071

Measured 1mo ago against content hash 4e3912b5b004, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

40-deploy 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 1mo 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:

  • 40-deploy — 92% identical, 7 lines differ
.cursor/rules/40-deploy.mdc · 70 lines

How it starts

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

Deploy & Ops (Rule)

For PM2 processes, GitHub Actions, health checks, and production operations.

Deployment Pipeline

  • GitHub Action: "Deploy MCP stack" workflow
  • Trigger: Push to main branch or manual dispatch via workflow_dispatch
  • Process: SSH → git pull → enhanced setup.sh → PM2 restart
  • Health Checks: Automated validation of all endpoints (proxy, http, streamable)

Enhanced Setup Script (setup.sh)

  • Shallow Submodules: Single-branch, depth-1 clones with blob filtering
  • Partial Clone: Uses --filter=blob:none for minimal bandwidth
  • Branch Fallback: Tries specified branch, falls back to master
  • Repository Compaction: Aggressive GC and reflog cleanup
  • Skip Nested: SKIP_NESTED_SUBMODULES=1 for deployment optimization

PM2 Configuration (ecosystem.config.cjs)

  • mcp-sap-proxy: MCP proxy server (127.0.0.1:18080)
  • mcp-sap-http: HTTP status server (127.0.0.1:3001)
  • mcp-sap-streamable: Streamable HTTP MCP (127.0.0.1:3122)

Environment Configuration (BM25-Only)

env: {
  NODE_ENV: "production",
  LOG_LEVEL: "INFO", 
  LOG_FORMAT: "json",
  RETURN_K: "25"  // Centralized result limit
}

Health Endpoints

  • HTTP Server: /status, /healthz, /readyz
  • Streamable Server: /health
  • Proxy Server: /status (via mcp-proxy)

Build Process

  1. TypeScript: npm run build:tsc → dist/src/
  2. Index Build: npm run build:index → dist/data/index.json
  3. FTS Build: npm run build:fts → dist/data/docs.sqlite
  4. Full Build: npm run build → Complete pipeline

Monitoring & Logging

  • Structured Logging: JSON format in production
  • Performance Metrics: Search timing and result counts
  • Error Tracking: Graceful fallbacks with error logging
  • Resource Usage: PM2 process monitoring

Build Process

  1. Index Build: npm run build:index → dist/data/index.json
  2. FTS Build: npm run build:fts → dist/data/docs.sqlite
  3. TypeScript: npm run build:tsc → dist/src/
  4. Full Build: npm run build → Complete pipeline

Read the full file on GitHub · 70 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. 1mo ago First seen · 70 lines · 713 tokens per session scan A 4e3912b5b004

Subscribe to this mod's changes

40-deploy is a cursor rule published in the GitHub repository marianfoo/mcp-sap-docs (243 stars, last pushed today), licensed Apache-2.0. It adds 713 tokens to every session, about $0.0029 per session on Opus 5.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-30.