Cursor integration
Install and wire mog skills, rules, and MCP servers into Cursor with automatic configuration.
mog has first-class support for Cursor. The CLI auto-detects Cursor projects, installs packages to the right paths, and can wire skills into Cursor's rule system so your AI assistant picks them up automatically.
How auto-detection works
When you run mog install in a project directory, the CLI looks for a .cursor/ directory. If it finds one, it sets the target to cursor and uses Cursor-specific install paths. You can always override with --target cursor.
Installing skills
Skills are SKILL.md packages that teach your AI assistant specific capabilities.
mog install acme/react-testing-skill
This downloads the package, verifies its SHA-256 hash, and extracts it to:
.cursor/skills/react-testing-skill/
SKILL.md
README.md
Wiring skills into Cursor rules
Installing a skill drops the files into .cursor/skills/, but Cursor's agent needs a rule that points to the skill. Add --wire to create this automatically:
mog install acme/react-testing-skill --wire
This creates a .cursor/rules/react-testing-skill.mdc file that references the skill, making it available to Cursor's AI assistant. The generated rule follows Cursor's MDC format and includes the skill's content so the agent can use it immediately.
Without --wire, the CLI prints the rule content you'd need to add manually.
Manual wiring
If you prefer to wire skills yourself, create a .cursor/rules/<name>.mdc file:
---
description: React testing patterns including RTL, Vitest, and MSW
globs:
alwaysApply: false
---
Follow the instructions in .cursor/skills/react-testing-skill/SKILL.md
Set alwaysApply: true if you want the skill active on every prompt, or use globs to scope it to specific file patterns.
Installing MCP servers
MCP server packages are installed by writing configuration to .cursor/mcp.json — no file extraction needed.
mog install acme/github-mcp-server
The CLI prompts for any required environment variables and writes the config:
{
"mcpServers": {
"acme-github-mcp-server": {
"command": "npx",
"args": ["-y", "@acme/github-mcp-server@1.0.0"],
"env": {
"GITHUB_TOKEN": "ghp_your_token"
}
}
}
}
If .cursor/mcp.json already has other servers configured, mog merges the new entry without overwriting existing ones.
Passing env vars non-interactively
For CI or agent-driven installs, pass environment variables with --env:
mog install acme/github-mcp-server --env GITHUB_TOKEN=ghp_xxx
Restart Cursor after installing an MCP server for it to be discovered.
Installing rules
Rule packages install directly to .cursor/rules/:
mog install acme/typescript-standards
.cursor/rules/typescript-standards.mdc
Rule packages with type: rule in their mog.yaml use a different default install path than skills, targeting the rules directory directly.
Project health check
Run mog doctor to verify your Cursor project is set up correctly:
mog doctor
This checks:
- CLI authentication status
- Lockfile integrity (
mog.lock.json) - Installed packages match the lockfile (version and SHA-256)
- Wiring (whether installed skills have corresponding
.cursor/rules/*.mdcentries) - MCP server config validity
Listing installed packages
mog ls
2 installed packages
acme/react-testing-skill@1.2.0 cursor
.cursor/skills/react-testing-skill/
Installed: 1/15/2026
acme/github-mcp-server@1.0.0 cursor (mcp)
.cursor/mcp.json
Installed: 1/16/2026
Updating packages
mog update --dry-run
mog update
Updates respect semver: by default only patch and minor versions are applied. The lockfile is updated and the old files are replaced.
Uninstalling
mog uninstall acme/react-testing-skill
For skills, this removes the extracted files from .cursor/skills/ and the lockfile entry. If --wire was used during install, the corresponding .cursor/rules/*.mdc file is also removed.
For MCP servers, this removes the mcpServers entry from .cursor/mcp.json.
File layout summary
After installing a mix of skills, rules, and MCP servers, your Cursor project looks like this:
my-project/
.cursor/
mcp.json # MCP server configs (auto-managed)
skills/
react-testing-skill/
SKILL.md
README.md
another-skill/
SKILL.md
rules/
react-testing-skill.mdc # Wired skill reference (--wire)
typescript-standards.mdc # Installed rule package
my-custom-rule.mdc # Your own rules (untouched by mog)
mog.lock.json # Lockfile (commit to version control)
Tips
- Commit
mog.lock.jsonto version control so teammates get the same package versions. - Don't commit secrets in
.cursor/mcp.json— add it to.gitignoreif your MCP configs contain API keys. Consider using environment variables referenced from your shell profile instead. - Use
mog explain <vendor>/<package>to preview a package's metadata, install path, and target compatibility before installing. - Use
mog install --preflightto see exactly what would happen without making changes.