
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
A Model Context Protocol (MCP) server that provides tools for accessing Cursor rules found in .cursor/rules/*.mdc files within a repository. This allows AI tools like Claude and other LLM assistants to access and use Cursor rules through the MCP protocol.
This package creates an MCP server that dynamically discovers Cursor rule files and exposes them as callable tools. Each rule file becomes a tool that can be invoked to retrieve the rule content, with descriptions automatically extracted from the frontmatter.
Instead of loading all Cursor rules into your AI assistant's context at once, this MCP server allows tools like AmpCode and Claude Code to dynamically load only the rules that are relevant to your current task. This approach offers several benefits:
AGENT.md or CLAUDE.md which are always loaded, Cursor rules include descriptions that tell the LLM exactly when to use themglobs) and always-apply status, helping AI assistants choose the right rules automatically
Example showing AmpCode automatically using the cursor_rule_zod-v4 tool when working with Zod, ensuring proper v4 imports are used.
Start the MCP server:
# Using npx
npx llm-rules@latest --dir /path/to/your/repository
# Using bunx
bunx llm-rules@latest --dir /path/to/your/repository
# Or from the current working directory (--dir is optional)
npx llm-rules@latest
The --dir flag is optional and defaults to the current working directory.
Note: When using the AmpCode extension for VSCode/Cursor/Windsurf, the --dir flag is not needed as the extension automatically sets the working directory to your project root.
The server will:
.cursor/rules/*.mdc filescursor_rule_<filename> for each ruleglobs) and always-apply status in tool descriptions for better contextTo use with MCP clients:
Add this to your Amp settings:
VS Code Configuration (.vscode/settings.json):
{
"amp.mcpServers": {
"rules": {
"command": "npx",
"args": ["llm-rules@latest"]
}
}
}

Project Configuration:
claude mcp add --scope project rules -- npx llm-rules@latest
Add to your claude_desktop_config.json. See Claude Desktop MCP docs for more info.
{
"mcpServers": {
"rules": {
"command": "npx",
"args": ["llm-rules@latest", "--dir", "/path/to/your/repository"]
}
}
}
Here's an example Cursor rule file (.cursor/rules/zod-v4.mdc):
---
description: Zod v4 Coding Guidelines. ALWAYS read this when using Zod
globs:
alwaysApply: false
---
# Zod v4 Coding Guidelines
## Important: Always Use Zod v4
When working with Zod, **ALWAYS** use Zod v4 by importing from `'zod/v4'`. Never use the default `'zod'` import, which is Zod v3.
This creates a tool named cursor_rule_zod-v4 with the description "Read Cursor rule: Zod v4 Coding Guidelines. ALWAYS read this when using Zod". The LLM can see from the description that this rule should be loaded when working with Zod.
See the complete example for the full rule content.
Each generated tool takes no parameters and returns the rule content without frontmatter. Tool descriptions automatically include metadata from frontmatter (file patterns, always-apply status) to help LLMs choose relevant rules without reading their content first.
.cursor/rules/ at the directory specified by --dir (or current working directory). Does not recursively search subdirectories for additional .cursor/rules/ folders.Future enhancements planned:
--dir flag.cursor/rules/ directories from subdirectories and expose them contextually based on the current working locationSee CONTRIBUTING.md for development setup and guidelines.
FAQs
LLM rules and instructions for AI coding assistants
The npm package llm-rules receives a total of 18 weekly downloads. As such, llm-rules popularity was classified as not popular.
We found that llm-rules demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.