Skip to content

How to Audit MCP Tool Calls and Agent Security Logs

3 min read

In this guide, you will learn practical steps to track, monitor, and audit the tools your coding agents invoke through the Model Context Protocol. By establishing clear audit habits, you can verify agent behavior, protect sensitive directories, and maintain visibility into file reads and writes across your projects.

Understanding the Scope of MCP Tool Calls

When you connect Model Context Protocol servers to your coding environment, you give external processes permission to interact with your system. An agent might query a database, read local files, or execute specific shell commands via an exposed server. Because these actions happen autonomously, knowing what an agent touches requires intentional oversight.

Start by reviewing which servers are currently active in your configuration files. Check your setup to see if a server has access to broad system paths or sensitive keys. Restricting each server to the narrowest possible directory is the first line of defense for audit security. If an MCP server only needs access to a specific documentation directory, configure its path parameters accordingly rather than pointing it at your root directory.

Monitoring File Reads and Writes in Practice

To properly audit tool calls, you need reliable ways to inspect what an agent actually did during a session. Different CLI agents and helper tools offer varying levels of verbosity.

  1. Enable verbose or debug flags when starting your agent sessions to print every tool invocation to the standard output stream. Check your specific tool's documentation for exact flags, as syntax can change between versions.
  2. Review the generated logs regularly to spot unexpected file reads or external requests. Look specifically for tool calls that access configuration files, environment variables, or private source directories.
  3. Keep an eye on status indicators while work is running. When running multiple streams of work inside native environments like Tidepane, you can glance across projects to see live agent status in the sidebar, helping you spot when an agent is spending an unusual amount of time querying external tools.

Keeping Local Activity Histories

Relying solely on transient terminal output makes auditing difficult once a session closes. Maintaining a persistent history helps you retrace steps when something unexpected happens.

For instance, when working with Claude Code, Tidepane keeps a log of what was done and what is still pending. It tracks your prompts, the agent summaries, the files it touched, and its tasks, grouped by day with dates and times. You can open this log from the header or with Shift-Command-H to inspect touched files, add your own tasks, and mark work as verified. This record is on by default, records only while it is on, never reads anything from before, and stays entirely local on your Mac.

Establishing Routine Review Habits

Security logging is only effective if you review the data. Build simple habits into your daily development workflow to keep agent access in check.

  • Periodically remove MCP servers that you no longer use for active projects.
  • Before merging code written by an agent, cross-reference the git diff with your activity logs to ensure no unintended files were modified or read.
  • Verify that sensitive credentials and environment files remain excluded via your ignore files so that file-reading tools cannot inadvertently ingest them.

Take five minutes right now to inspect your active MCP configuration files and verify that every connected server points only to the specific directories it actually needs.

Tidepane brings terminals, a browser and your coding agents into one window. See what it does.