Skip to content

Shadow MCP and agent discovery ​

Symptoms of shadow MCP and agent discovery: the inventory of MCP servers and AI agents that call the application.

An MCP server I know about keeps appearing as unknown ​

  • Cause: its path is not under mcp.paths, mcp.servers or discovery.known_servers, or it is listed in a different form. The inventory normalises numbers and IDs, so /mcp/42 is /mcp/{id}, and a list entry /mcp does not cover /mcp/v2.
  • Check: the event's key (the normalised path) and its snippet (the request path); waap api get -app shop for discovery.known_servers.
  • Fix: acknowledge it under known_servers (a trailing * covers a prefix), or enforce it under mcp.servers. Each node flags a server once; the flag stops for the new version at once.

An MCP server is not listed ​

  • Cause: the inventory is off (discovery.enabled or discovery.mcp is false, or API protection is off); the body is bigger than mcp.message_size or over the API JSON limits; "jsonrpc" is not in the first 512 bytes; the client only opened an event stream (a stream alone never makes a server); or the application reached 100 servers on this node.
  • Check: the trace of a request to it (the discovery step); the request body's size and start; how many servers the application already has in the inventory.
  • Fix: turn discovery on, raise mcp.message_size, or clear old servers by declaring them.

Ordinary JSON-RPC traffic shows up as MCP ​

  • Cause: a JSON-RPC 2.0 request used a method of the MCP protocol (initialize, tools/..., resources/..., prompts/..., notifications/...); or the path was already seen as an MCP server; or the client sent Mcp-Session-Id or MCP-Protocol-Version.
  • Check: the method names in the request body.
  • Fix: acknowledge the path under known_servers to stop the flag. It stays listed.

"new tool" event for a tool that has always been there ​

  • Cause: the node first saw the tool more than a day after the server. Rarely called tools, or tools that appear only in tools/list answers outside the response scope before, look new.
  • Fix: if the tool is expected, add it to the server's tools in mcp.servers (allowed tools are not reported), or ignore discovery.mcp.new_tool for the path with an exception.

After adding a server to mcp.servers, agents get 403 ​

  • Cause: in block mode, api_schema refuses calls outside the server's tool list (api.mcp.tool), messages over its message_size (api.mcp.size), batches over its batch limit (api.mcp.batch), and bodies that are not JSON-RPC (api.mcp.syntax). The message names the server.
  • Check: waap events list -app shop -rule api.mcp.tool.
  • Fix: add the missing tools (the inventory lists the observed ones), or run the application or API protection in detect mode while the list settles.

No AI agents are listed ​

  • Cause: agents are recognised from bot mitigation. Bot mitigation is off, the agent's user agent is not in the bot catalog under ai_crawler, or its signature agent is not configured; or discovery.agents is false.
  • Fix: turn on bot mitigation, and add the agent to the catalog or as a signature agent. discovery.agent.new events need discovery.flag_agents: log, which is off by default.

"Put under enforcement" is refused ​

  • Cause: the path is already under mcp.paths or another server; the name is taken or is not lowercase letters, digits and dashes; the server was not seen in this application; or the policy changed since the inventory was read.
  • Check: the server's status on the MCP and agents tab (or waap api mcp -app NAME) says whether it is already declared.
  • Fix: edit the existing entry under "Declared MCP servers", choose another name, or reload and retry.

The MCP inventory answers 503 ​

  • Cause: this node has no inventory store (a control plane started without a database).
  • Fix: run it with the node's data directory. The inventory is stored by the inspection node's flush every few seconds.