cursorrules

Project rules and notes for a Swift package and command-line tool that helps create MCP servers for Mac. Swift is Apple’s programming language, and MCP lets assistants connect to external tools.

In plain words
What is it for?
Use them when developing the EasyMCP libraries, Mac-specific MCP support, command-line communication, or future networked MCP features.
Why use it?
They explain the planned project structure and require discussing the change plan before editing files.

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/adamwulf/mcp-template/cursorrules
Clone the repo
git clone --depth 1 https://github.com/adamwulf/mcp-template

Made for: Cursor.

Per session 1,881 This file is loaded in full into every session.
When invoked 1,881 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.01881 $0.01881
Opus 5 $0.00941 $0.00941
Sonnet 5 $0.00376 $0.00376
Haiku 4.5 $0.00188 $0.00188

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

Security

Grade A, and why

cursorrules 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 2d 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.

.cursorrules · 126 lines

How it starts

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

Cursor Rules for Swift Package Projects

  • Before making any changes or edits, talk through and mention your plan for the changes.

Project Goals: MCP Template

This project aims to create a simple command line executable and Swift package to make creating MCPs (Model Control Protocol) for Mac very easy. The project will eventually support:

  1. Command line stdio for direct MCP interaction
  2. Command line stdio → standalone Mac app via Bonjour for networked MCP communication
  3. SSE server in a Package → example command line app for SSE-based MCP

Project Structure

  • Package Name: mcp-template
  • Swift Version: 6.0
  • Platforms: macOS 15+, iOS 17+, macCatalyst 17+

Package Targets:

  1. EasyMCP (Library)

    • Purpose: Swift library for easy integration with the MCP protocol
    • Dependencies: mcp-swift-sdk (MCP module)
    • Key Files:
      • Sources/EasyMCP/EasyMCP.swift - Main implementation that handles MCP server lifecycle, tool registration, and method handlers for listing and calling tools
      • Sources/EasyMCP/Logging.swift - Utility functions for structured logging with error, warning, and info levels
  2. EasyMacMCP (Library)

    • Purpose: Mac-specific implementation for MCP with pipe communication supporting multiple concurrent MCP servers
    • Dependencies: EasyMCP
    • Key Files:
      • Sources/EasyMacMCP/EasyMacMCP.swift - Main generic implementation with type-safe Request/Response protocols
      • Sources/EasyMacMCP/HelperRequestPipe.swift - Actor that wraps WritePipe for sending requests from MCP servers to the Mac app
      • Sources/EasyMacMCP/HelperResponsePipe.swift - Actor that wraps ReadPipe for receiving responses from the Mac app
      • Sources/EasyMacMCP/MCPProtocols.swift - Defines protocols for MCP communication with tool metadata and conversion methods
      • Sources/EasyMacMCP/MCPTools.swift - Wraps MCP tools using ResponseManager for waiting for responses
      • Sources/EasyMacMCP/ResponseManager.swift - Actor that coordinates requests and responses, manages timeouts, and resolves async continuations
      • Sources/EasyMacMCP/ReadPipe.swift - Comprehensive implementation for creating, opening, and reading from named pipes with error handling
      • Sources/EasyMacMCP/WritePipe.swift - Counterpart to ReadPipe for creating, opening, and writing to named pipes with error handling
      • Sources/EasyMacMCP/PipeProtocols.swift - Defines protocol interfaces for PipeReadable and PipeWritable to allow mocking for testing
      • Sources/EasyMacMCP/PipeTestHelpers.swift - Utility functions to test pipe writing/reading with synchronous and asynchronous options
      • Sources/EasyMacMCP/FileManager+Pipe.swift - FileManager extension to check if a URL points to a named pipe using stat() system call
      • Sources/EasyMacMCP/Logging.swift - Mac-specific logging utilities with error, warning, and info levels that print to stderr/stdout

Read the full file on GitHub · 126 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. 2d ago First seen · 126 lines · 1,881 tokens per session scan A a8b05d5fd6df

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository adamwulf/mcp-template (17 stars, last pushed 2mo ago), licensed MIT. It adds 1,881 tokens to every session, about $0.0094 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.