Claude Code integration
Install and wire mog skills, rules, and MCP servers into Claude Code with automatic configuration.
mog has first-class support for Claude Code. The CLI auto-detects Claude Code projects, installs packages to the right paths, and can wire skills into AGENTS.md so Claude picks them up automatically.
How auto-detection works
When you run mog install in a project directory, the CLI looks for a .claude/ directory. If it finds one, it sets the target to claude-code and uses Claude Code-specific install paths. You can always override with --target claude-code.
Installing skills
Skills are SKILL.md packages that teach Claude specific capabilities.
mog install acme/react-testing-skill
This downloads the package, verifies its SHA-256 hash, and extracts it to:
.claude/skills/react-testing-skill/
SKILL.md
README.md
Wiring skills into AGENTS.md
Installing a skill drops files into .claude/skills/, but Claude Code needs to know about them. Add --wire to handle this automatically:
mog install acme/react-testing-skill --wire
This appends a reference to the skill in your project's AGENTS.md file, which Claude Code reads as persistent instructions. If AGENTS.md doesn't exist yet, the CLI creates it.
Without --wire, the CLI prints the exact content you'd need to add to AGENTS.md manually.
Manual wiring
If you prefer to wire skills yourself, add a reference in your AGENTS.md:
## React testing skill
Follow the instructions in .claude/skills/react-testing-skill/SKILL.md when writing or reviewing React tests.
You can scope instructions however you like — Claude Code treats the entire AGENTS.md as context for every conversation in the project.
Subdirectory AGENTS.md
Claude Code also supports AGENTS.md files in subdirectories. These are picked up when Claude is working in that subtree. If you want a skill scoped to a specific part of your codebase:
my-project/
AGENTS.md # Project-wide instructions
packages/api/
AGENTS.md # API-specific skill references
Installing MCP servers
MCP server packages are installed by writing configuration to .mcp.json in the project root — 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 .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 Claude Code after installing an MCP server for it to be discovered.
Project health check
Run mog doctor to verify your Claude Code 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 references in
AGENTS.md) - MCP server config validity
Listing installed packages
mog ls
2 installed packages
acme/react-testing-skill@1.2.0 claude-code
.claude/skills/react-testing-skill/
Installed: 1/15/2026
acme/github-mcp-server@1.0.0 claude-code (mcp)
.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 .claude/skills/ and the lockfile entry. If --wire was used during install, the corresponding reference in AGENTS.md is also removed.
For MCP servers, this removes the mcpServers entry from .mcp.json.
File layout summary
After installing a mix of skills and MCP servers, your Claude Code project looks like this:
my-project/
.claude/
skills/
react-testing-skill/
SKILL.md
README.md
another-skill/
SKILL.md
.mcp.json # MCP server configs (auto-managed)
AGENTS.md # Skill references wired here (--wire)
mog.lock.json # Lockfile (commit to version control)
Tips
- Commit
mog.lock.jsonto version control so teammates get the same package versions. - Commit
AGENTS.md— it's the equivalent of Cursor rules and should be shared with the team. - Don't commit secrets in
.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.