main-rule

Development instructions for an MCP server that fetches, scans, and extracts information from web pages. MCP is a standard way for an agent to call external tools.

In plain words
What is it for?
Use it when developing the web-scanning server, including its TypeScript services, tools, configuration, error handling, and project documentation.
Why use it?
It gives the project a defined structure and coding rules for building and maintaining the server.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/bsmi021/mcp-server-webscan/main-rule
Clone the repo
git clone --depth 1 https://github.com/bsmi021/mcp-server-webscan

Made for: Cursor.

Per session 3,154 This file is loaded in full into every session.
When invoked 3,154 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.03154 $0.03154
Opus 5 $0.01577 $0.01577
Sonnet 5 $0.00631 $0.00631
Haiku 4.5 $0.00315 $0.00315

Measured 3d ago against content hash f2053a32083b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

main-rule 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 3d 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/main-rule.mdc · 469 lines

How it starts

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

MCP Server Development Guidelines

project name: mcp-server-webscan

memory_bank ProjectID: de83ede7-85de-4746-86c7-c2dafefc3fb7

Description:

A Model Context Protocol (MCP) server for web content scanning and analysis. This server provides tools for fetching, analyzing, and extracting information from web pages.

IMPERATIVE

- All projects must contain a PRD, Features spec, and RFCs
    - All projects must have a memory - bank

Project Structure

- Follow the standard MCP server directory structure:
  src/
  ├── config/
  │   └── ConfigurationManager.ts
  ├── services/
  │   ├── YourService.ts
  │   └── index.ts
  ├── tools/
  │   ├── yourTool.ts
  │   ├── yourToolParams.ts
  │   └── index.ts
  ├── types/
  │   ├── yourServiceTypes.ts
  │   └── index.ts
  ├── utils/
  │   ├── logger.ts
  │   ├── errors.ts
  │   └── index.ts
  ├── initialize.ts
  └── server.ts

TypeScript Standards

- Use ES Modules format with `.js` extensions in imports:
  // Correct:
  import { YourService } from '../services/YourService.js';
  
  // Incorrect:
  import { YourService } from '../services/YourService';
- Enforce strict TypeScript typing(see tsconfig.json)
    - Prefer interfaces over types for object definitions:
        ```typescript

// Preferred: interface UserData { id: string; name: string; }

// Avoid for object shapes: type UserData = { id: string; name: string; };

             *****IMPORTANT DON'T FORGET**** - Use functional programming patterns over class-based patterns where possible
                  - Avoid enums; use string literal unions or constant maps:
```typescript
// Preferred:
type Status = 'pending' | 'processing' | 'complete' | 'error';

// Or:
const STATUS = {
  PENDING: 'pending',
  PROCESSING: 'processing',
  COMPLETE: 'complete',
  ERROR: 'error'
} as const;
type Status = typeof STATUS[keyof typeof STATUS];

// Avoid:
enum Status {
  PENDING = 'pending',
  PROCESSING = 'processing',
  COMPLETE = 'complete',
  ERROR = 'error'
}

Read the full file on GitHub · 469 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. 3d ago First seen · 469 lines · 3,154 tokens per session scan A f2053a32083b

Subscribe to this mod's changes

main-rule is a cursor rule published in the GitHub repository bsmi021/mcp-server-webscan (13 stars, last pushed 1y ago), licensed MIT. It adds 3,154 tokens to every session, about $0.0158 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-30.