Skip to content

Shadow MCP and agent discovery Since v0.2 ​

AI agents increasingly reach applications through Model Context Protocol (MCP) servers that a team adds without telling anyone. Discovery watches the traffic of every application that has the endpoint inventory on, and lists which paths speak MCP, which tools are listed and called, who calls them and which AI agents visit. It never blocks: it lists and logs. Enforcement is the MCP check, and a discovered server becomes an enforced one when you add it to the declared MCP servers.

Before you begin ​

  • Role: operator for the application (viewer can read).
  • Endpoint inventory is on (it is by default). Discovery needs it. For details, see Endpoint inventory.
  • To list the agents you accept by name, bot mitigation recognises AI crawlers from its catalog.

Review the servers and agents found ​

text
1. Open Applications > All applications > the application > Request checks > API protection.
2. Open the MCP and agents tab.
3. Under MCP servers seen, choose a window of 24 hours to 90 days.
4. Select a row to see the server name, clients, sessions, calls, callers and tools seen.
5. Check Tools and AI agents for the tools and visiting agents.
sh
waap api mcp -app shop -window 7d
waap events list -app shop -rule discovery.mcp.unknown_server

Each server has a status: enforced (under the default MCP paths or the declared servers), acknowledged (in Acknowledged MCP servers) or unknown.

Put a server under enforcement ​

text
1. On the MCP and agents tab, select an unknown server.
2. Select Put under enforcement. Optionally type a name, and select Allow only the
   tools seen to fill its tool list from traffic.
3. Select Preview changes, then Apply.
sh
waap api mcp enforce -app shop -path /billing/mcp -name billing-tools -tools-from-traffic -m "enforce billing MCP"
yaml
# applications[].policy.api.mcp.servers
servers:
  - name: billing-tools
    paths: [/billing/mcp]
    tools: [create_invoice, get_invoice]
    message_size: 1MiB
    batch: 10

From then on, calls on its paths are checked: a tools/call of an unlisted tool is api.mcp.tool, an oversized message api.mcp.size, an oversized batch api.mcp.batch, and a body that is not JSON-RPC api.mcp.syntax. They are refused in block mode.

Acknowledge a server without enforcing it ​

text
1. On the MCP and agents tab, open Settings.
2. Add the path to Acknowledged MCP servers.
3. Select Preview changes, then Apply.
sh
waap api set -app shop -m "acknowledge labs MCP" discovery.known_servers=/labs/*
yaml
# applications[].policy.api.discovery
discovery:
  known_servers: [/labs/*]

An acknowledged server is listed but not flagged and not enforced.

Handle a server you do not recognise ​

Find its owner from the first caller and the client names shown for it, and block its path with an access rule until it is reviewed.

Declare MCP servers ​

The Declared MCP servers form creates, edits and removes entries of the server list (name, paths, allowed tools, message size, batch limit). From the CLI, use waap api list get -app shop -list mcp.servers and waap api list set. A path belongs to one server only, and not also to the default MCP paths. For the default server (mcp.paths, mcp.tools), see GraphQL, gRPC, WebSocket and MCP.

What counts as MCP ​

A POST whose body starts (first 512 bytes) with a JSON-RPC 2.0 request or batch using an MCP method: initialize, tools/..., resources/..., prompts/..., notifications/..., completion/complete or logging/setLevel. Other JSON-RPC methods count only on a path already known as an MCP server, or with the Mcp-Session-Id or MCP-Protocol-Version headers. At most 32 requests of a batch are read; bigger, truncated or malformed bodies are not counted. Event streams are counted on a server already seen, never as a new server. Paths are normalised like the endpoint inventory (/mcp/42 becomes /mcp/{id}).

Recorded per server: the transport (streamable_http, sse or http), server name and version and protocol version, sessions, calls, errors, distinct callers (estimated) and up to 16 client names. Per tool: calls, errors, distinct callers, first and last seen. Agents are requests that bot mitigation matched to a catalog bot of the ai_crawler category, or that carry a valid signature of a configured signature agent; each is recorded as verified or claimed.

Settings reference ​

SettingWhat it doesDefaultAllowed valuesApplies in
Find MCP servers (discovery.mcp)Recognises MCP traffic.truetrue, falseendpoint inventory on
Find AI agents (discovery.agents)Lists AI agents.truetrue, falseendpoint inventory on
Flag unknown MCP servers (discovery.flag_unknown)Logs events for unknown servers and new tools.loglog, offall modes (never blocks)
Flag new AI agents (discovery.flag_agents)Logs an event for an agent seen the first time.offlog, offall modes (never blocks)
Acknowledged MCP servers (discovery.known_servers)Servers that are listed but not flagged or enforced.noneup to 100 pathsall

Declared server ​

SettingWhat it doesDefaultAllowed valuesApplies in
nameIdentifies the server.none (required)lowercase letters, digits, dashesall
pathsPaths of the server.none (required)path list; one server per pathall
toolsTools agents may call.none (any tool)up to 500 namesall
message_sizeBytes in one request.the mcp.message_size settingsizeall
batchRequests per batch.the mcp.batch settingnumberall

Events ​

All events are log in every mode. Exceptions accept the discovery. prefix.

RuleWhen
discovery.mcp.unknown_serverThe first time this node sees an MCP server whose path is not under the default paths, the declared servers or the acknowledged ones. The message names the server, protocol version, transport and first caller.
discovery.mcp.new_toolA tool first seen more than 24 hours after its server. Tools a declared server allows are not reported.
discovery.agent.newWith Flag new AI agents on log, the first request of an AI agent on this node.

Limits ​

LimitValue
Declared servers per application32
Tools per declared server500
Acknowledged servers100
Servers per application and node100
Agents per application and node200
Client names per server16
Names, and pathscut at 128 and 256 bytes

Beyond a bound, calls are not counted and waap_api_mcp_overflow_total{app} rises. Counts are flushed with the endpoint inventory every few seconds and summed over nodes. They are replicated to a standby but not backed up, because they are seen again. A node reads what the cluster stored when it starts, so a restart does not flag known servers again.

Troubleshooting ​

No servers are listed ​

  • Cause: the endpoint inventory is off, Find MCP servers is off, or no MCP traffic arrived in the window.
  • Fix: turn them on or widen the window.

The same server is flagged again ​

  • Cause: its path is not under any declared, default or acknowledged path.
  • Fix: put it under enforcement, or acknowledge it.