You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/025-mcp-direct-endpoint/spec.md
+26-3Lines changed: 26 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ As an MCP client user, I want to connect to a single endpoint that exposes all a
28
28
29
29
1.**Given** the direct endpoint is enabled and upstream servers are connected, **When** a client requests the tools list from `/mcp/direct`, **Then** the response includes all tools from connected upstream servers with `server:tool` naming format.
30
30
31
-
2.**Given** the direct endpoint is enabled, **When** a client requests the tools list, **Then** the response includes all internal MCPProxy tools (retrieve_tools, call_tool_*, upstream_servers, etc.) without a server prefix.
31
+
2.**Given** the direct endpoint is enabled, **When** a client requests the tools list, **Then** the response includes management MCPProxy tools (upstream_servers, quarantine_security, code_execution, list_registries, search_servers, read_cache) without a server prefix. Note: Search-workflow tools (retrieve_tools, call_tool_read, call_tool_write, call_tool_destructive) are excluded as they are redundant in direct mode.
32
32
33
33
3.**Given** the direct endpoint is enabled and a tool exists as `github:create_issue`, **When** a client calls this tool directly, **Then** the call is routed to the github upstream server and executed successfully.
34
34
@@ -104,6 +104,26 @@ As an MCP client developer, I want upstream tool annotations (readOnlyHint, dest
104
104
105
105
---
106
106
107
+
### User Story 6 - Admin Server Management (Priority: P2)
108
+
109
+
As an administrator, I want connected clients to be notified when I disable, enable, quarantine, or unquarantine an upstream server, so their tool lists stay synchronized with the current server state.
110
+
111
+
**Why this priority**: Essential for operational consistency - admin actions must propagate to all connected clients.
112
+
113
+
**Independent Test**: Can be tested by disabling/enabling a server while a client is connected and verifying the client receives a tool list update notification.
114
+
115
+
**Acceptance Scenarios**:
116
+
117
+
1.**Given** a client is connected to `/mcp/direct` and server "github" is enabled, **When** an administrator disables "github" via CLI/WebUI/API, **Then** the system sends `notifications/tools/list_changed` to the client, and the client's subsequent `tools/list` call excludes github:* tools.
118
+
119
+
2.**Given** a client is connected to `/mcp/direct` and server "github" is disabled, **When** an administrator enables "github" via CLI/WebUI/API, **Then** the system sends `notifications/tools/list_changed` to the client, and the client's subsequent `tools/list` call includes github:* tools.
120
+
121
+
3.**Given** a client is connected to `/mcp/direct` and server "github" is not quarantined, **When** an administrator quarantines "github", **Then** the system sends `notifications/tools/list_changed` to the client, and the client's subsequent `tools/list` call excludes github:* tools.
122
+
123
+
4.**Given** a client is connected to `/mcp/direct` and server "github" is quarantined, **When** an administrator unquarantines (approves) "github", **Then** the system sends `notifications/tools/list_changed` to the client, and the client's subsequent `tools/list` call includes github:* tools (once connected).
124
+
125
+
---
126
+
107
127
### Edge Cases
108
128
109
129
- What happens when all upstream servers are disabled or quarantined? → Only internal tools are listed
@@ -117,7 +137,7 @@ As an MCP client developer, I want upstream tool annotations (readOnlyHint, dest
117
137
118
138
-**FR-001**: System MUST provide a new MCP endpoint at `/mcp/direct` when the feature is enabled
119
139
-**FR-002**: System MUST expose all tools from connected, enabled, non-quarantined upstream servers on the direct endpoint
120
-
-**FR-003**: System MUST expose all internal MCPProxy tools (retrieve_tools, call_tool_read, call_tool_write, call_tool_destructive, upstream_servers, quarantine_security, read_cache, code_execution, list_registries, search_servers) on the direct endpoint
140
+
-**FR-003**: System MUST expose management MCPProxy tools (upstream_servers, quarantine_security, read_cache, code_execution, list_registries, search_servers) on the direct endpoint. Search-workflow tools (retrieve_tools, call_tool_read, call_tool_write, call_tool_destructive) MUST be excluded as they are redundant in direct mode
121
141
-**FR-004**: System MUST namespace upstream tools using `server:tool` format to prevent collisions
122
142
-**FR-005**: System MUST NOT namespace internal tools (they appear without prefix)
123
143
-**FR-006**: System MUST exclude tools from quarantined servers
@@ -130,12 +150,13 @@ As an MCP client developer, I want upstream tool annotations (readOnlyHint, dest
130
150
-**FR-013**: System MUST provide a configuration option `enable_direct_endpoint` to enable/disable this feature
131
151
-**FR-014**: System MUST default the `enable_direct_endpoint` configuration to `false` (opt-in)
132
152
-**FR-015**: System MUST return 404 for `/mcp/direct` when the feature is disabled
153
+
-**FR-016**: System MUST send MCP `notifications/tools/list_changed` notification to all connected `/mcp/direct` clients when the tool list changes due to: upstream server connect/disconnect, upstream server enable/disable, upstream server quarantine/unquarantine, or upstream server's own `tools/list_changed` notification
133
154
134
155
### Key Entities
135
156
136
157
-**DirectMCPServer**: A separate MCP server instance that manages the direct endpoint, distinct from the search-based MCPProxyServer
137
158
-**Tool Namespace**: The `server:tool` naming convention that maps upstream tools to their source server
138
-
-**Tool Synchronization**: The mechanism that keeps the direct endpoint's tool list in sync with upstream server state
159
+
-**Tool Synchronization**: The mechanism that keeps the direct endpoint's tool list in sync with upstream server state, using MCP `notifications/tools/list_changed` to notify connected clients of changes
139
160
140
161
## Success Criteria *(mandatory)*
141
162
@@ -146,12 +167,14 @@ As an MCP client developer, I want upstream tool annotations (readOnlyHint, dest
146
167
-**SC-003**: 100% of upstream tool calls through the direct endpoint succeed when the upstream server is healthy
147
168
-**SC-004**: Tool annotations are preserved with 100% fidelity from upstream to direct endpoint
148
169
-**SC-005**: Zero tools from quarantined/disabled/disconnected servers appear in the direct endpoint's tool list
170
+
-**SC-006**: All connected clients receive `notifications/tools/list_changed` within 1 second of an admin action (enable/disable/quarantine/unquarantine)
149
171
150
172
## Assumptions
151
173
152
174
- The existing `EventTypeServersChanged` event provides sufficient notification for tool synchronization
153
175
- The `StateView` contains cached tool information suitable for rebuilding the tool list
154
176
- The `mcp-go` library's `SetTools()` method provides atomic tool list replacement
177
+
- The `mcp-go` library supports sending `notifications/tools/list_changed` to connected clients
155
178
- Internal tool handlers can be shared between the existing MCPProxyServer and the new DirectMCPServer
0 commit comments