Appearance
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:
operatorfor the application (viewercan 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_serverEach 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: 10From 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
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Find MCP servers (discovery.mcp) | Recognises MCP traffic. | true | true, false | endpoint inventory on |
Find AI agents (discovery.agents) | Lists AI agents. | true | true, false | endpoint inventory on |
Flag unknown MCP servers (discovery.flag_unknown) | Logs events for unknown servers and new tools. | log | log, off | all modes (never blocks) |
Flag new AI agents (discovery.flag_agents) | Logs an event for an agent seen the first time. | off | log, off | all modes (never blocks) |
Acknowledged MCP servers (discovery.known_servers) | Servers that are listed but not flagged or enforced. | none | up to 100 paths | all |
Declared server
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
name | Identifies the server. | none (required) | lowercase letters, digits, dashes | all |
paths | Paths of the server. | none (required) | path list; one server per path | all |
tools | Tools agents may call. | none (any tool) | up to 500 names | all |
message_size | Bytes in one request. | the mcp.message_size setting | size | all |
batch | Requests per batch. | the mcp.batch setting | number | all |
Events
All events are log in every mode. Exceptions accept the discovery. prefix.
| Rule | When |
|---|---|
discovery.mcp.unknown_server | The 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_tool | A tool first seen more than 24 hours after its server. Tools a declared server allows are not reported. |
discovery.agent.new | With Flag new AI agents on log, the first request of an AI agent on this node. |
Limits
| Limit | Value |
|---|---|
| Declared servers per application | 32 |
| Tools per declared server | 500 |
| Acknowledged servers | 100 |
| Servers per application and node | 100 |
| Agents per application and node | 200 |
| Client names per server | 16 |
| Names, and paths | cut 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.