Skip to lesson
Exit
Inspect MCP from the CLI1 / 3

1 min lesson

The job: you can inspect and manage MCP tools before an agent uses them

Use "You can inspect and manage MCP tools before an agent uses them" to describe the practical rule.

Step 1 of 3

The job: you can inspect and manage MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. tools before an agent uses them. Start with this check: The CLI sees the same config you expect from the editor. Keep it small enough to check the result yourself instead of taking the summary on trust.

Learn more

Full explanation

Agent MCP list, list-tools, --approve-mcps

CLI MCP — inspect the inventory before a headless run trusts it
agent mcp list, list-tools, --approve-mcps
SayA teammate added an MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. server to the repo, and I'm about to run this agent in CI. I want to see what the command line actually sees before it runs unattended.
Typeagent mcp list
DoStart in the terminal, not the chat panel. This lists the Model Context Protocol (MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition.) servers the CLI reads and their status; confirm it matches what you see in the editor.
SeeThe configured servers and whether each is enabled, straight from the same mcp.json the editor uses.
Typeagent mcp list-tools <server>
DoInspect the tools before you trust them. This prints the exact tool names a server exposes, so a name like run_sql or delete_issue shows the reach you'd be approving.
SeeThe real tool names, not a vague "database access", so you know what the agent could call.
DoFix the inventory from here. agent mcp login <server> authenticates one that needs OAuth. agent mcp disable <server> takes a server this job doesn't need out of reach, and agent mcp enable <server> turns it back on later.
Typeagent --approve-mcps "..."
DoOnly now go headless. This flag skips every approval prompt, and it is all-or-nothing: it auto-approves every configured server, not just the one you inspected. So disable what this run doesn't need first, then let it run.
SeeThe CI run reaches only the tools you inspected and left enabled. Anything you disabled stays out, even with approvals skipped.
Learn more

Optional practice

You can inspect and manage MCP tools before an agent uses them

QYou've applied it. What actually proves the work is done, not just a plausible answer?