Safeguard
AI Security•

How do I find which AI coding agents our repos are set up for?

AI coding tools leave config files in repos: CLAUDE.md, AGENTS.md, .mcp.json and .cursor/rules. Search for them to see which agents and servers are in use.

Safeguard Security Team
4 min read

Search every repo for files that AI coding tools read: CLAUDE.md, AGENTS.md, .mcp.json and .cursor/rules. Teams commit these on purpose so everyone gets the same behavior, which makes them a reliable signal of which agents and MCP servers a team uses, and what instructions those agents follow.

Why config files are good discovery signals

Most discovery methods look at traffic or devices. This one looks at the repo, and developers help you by committing the files. The documentation of these tools says so directly.

  • Claude Code's MCP documentation says project-scoped servers are stored in a .mcp.json file at the project root and that you should check it into version control so everyone gets the same tools. Its memory documentation says project instructions live in CLAUDE.md or .claude/CLAUDE.md.
  • AGENTS.md describes itself as a README for agents. It sits at the repository root, and in monorepos subprojects can have their own.
  • Cursor's documentation says project rules live in .cursor/rules as .mdc files and are version controlled.

A committed file is a statement: this team has adopted this tool.

The search

git ls-files | grep -E '(^|/)(CLAUDE\.md|AGENTS\.md|\.mcp\.json)$|(^|/)\.cursor/rules/'
git grep -nE '"(command|url)"' -- '*.mcp.json'

The second line pulls out what each MCP server runs or connects to. Run both across all repos, then build a table:

RepoConfig fileWhat it tells youFollow up
(repo).mcp.jsonMCP servers declared, with command or URLIs each server approved?
(repo)AGENTS.md or CLAUDE.mdInstructions given to agentsDo they contradict policy?
(repo).cursor/rulesRules for a specific editor agentWhich tool is in use?

What to read inside them

For MCP configuration, check each server entry. A local command that runs a package fetched at launch is a dependency, and a remote URL is a third party with access to whatever the agent sends. Claude Code's documentation notes that it prompts for approval in interactive sessions before using project-scoped servers from .mcp.json, which is a useful safeguard but not a substitute for a review of what is declared.

For instruction files, read for anything that tells an agent to bypass checks, disable tests, or fetch things from the internet. Instructions are text, so treat changes to them as code changes and route them through review. See codeowners protect workflow files for the same idea applied to CI.

Feed the results into your approved list

Each server and tool you find needs a decision. See inventory of MCP servers: enterprise program and AI coding assistant allowlist: what to approve. Where a team's file names a tool you have not approved, start with a conversation, not a block.

Limits

User-level settings live on developer machines and in home directories, not in repos, so this search finds team-wide adoption and misses private experiments. It is a floor, not a ceiling.

Quick check

Should we ban committed MCP config?

No. Committed config is easier to review than one that lives on laptops. Require review and an approved list instead.

Do all AI tools leave files in the repo?

No. Many keep settings per user. Combine this search with the dependency and hostname searches in how to find which AI services our code calls.

Safeguard offers an MCP Guardrail, agent identity, asset discovery and a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.