-
Notifications
You must be signed in to change notification settings - Fork 221
Description
Summary
There is currently no way for an agent (or user in WSL) to list which MCP servers are active vs removed in the current gateway session. An mcp-list primordial tool would close this gap.
Context
The dynamic-tools feature provides mcp-find, mcp-add, mcp-remove, mcp-exec, mcp-config-set, and code-mode. These allow session-level management of servers. However, after using mcp-remove to drop servers (e.g., to reduce tool schema overhead / save context window tokens), there's no way to check what's currently active.
Current state
| Method | Shows session state? | Notes |
|---|---|---|
mcp-find (broad query) |
No | Shows Desktop-enabled servers, not session state |
docker mcp server ls |
No (from WSL) | Requires Docker Desktop socket; also shows Desktop inventory, not session state |
/mcp in Claude Code |
No | Shows 1 server (the gateway), not individual backends |
code-mode |
No | No introspection API available |
Proposed solution
Add an mcp-list primordial tool (alongside the existing mcp-find, mcp-add, etc.) that returns:
{
"servers": [
{"name": "playwright", "status": "active", "tools": 22},
{"name": "github-official", "status": "removed", "tools": 0},
{"name": "database-server", "status": "active", "tools": 7, "config": {"database_url": "postgresql+asyncpg://..."}},
{"name": "time", "status": "active", "tools": 2}
]
}Fields:
name— server namestatus—activeorremoved(removed viamcp-removebut still enabled in Desktop)tools— count of tools currently exposed (0 if removed)config(optional) — current config set viamcp-config-set
Use case
Context window management. MCP tool schemas consume significant tokens in every API call (each tool is ~200-500 tokens). With 9 servers / ~84 tools, that's 25-40k tokens of overhead per request. Users mcp-remove unused servers to save context, then mcp-add them back when needed. Without mcp-list, there's no way to know what's currently loaded without trial and error.
Additional observations from testing (v0.39.1)
During testing we also noticed:
mcp-findonly searches locally enabled servers, not the full catalog (317 servers). The docs describe searching the full MCP Catalog, but in practice results are scoped todocker mcp server enable'd servers only.mcp-addfails for already-active servers with "Server not found in catalog". It only works for servers that were firstmcp-remove'd from the session.mcp-removehides tools but doesn't stop the server — tools are de-listed from the gateway's advertised set, but remain callable viamcp-execby name. This is fine (good for context savings) but should be documented.
Environment
- Docker Desktop 4.61.0
- MCP Gateway v0.39.1
dynamic-toolsfeature: enabled- Client: Claude Code via WSL2
- OS: Windows 11 / WSL2 (Ubuntu)