mcp-squared 0.3.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  MCP² (Mercury Control Plane) is a local-first meta-server and proxy for the Model Context Protocol (MCP). It addresses tool context bloat by enabling dynamic, progressive disclosure of tools to LLMs. Instead of flooding the model context with every available tool schema, MCP² exposes a stable, minimal surface area for tool discovery and execution.
4
4
 
5
5
  ## Status
6
- **Alpha (v0.1.x)** - Core functionality is implemented and tested; CLI and config details may evolve.
6
+ **Alpha (v0.6.x)** - Core functionality is implemented and tested; CLI and config details may evolve.
7
7
 
8
8
  ## Install & Run
9
9
 
@@ -72,6 +72,9 @@ bun run build
72
72
  # Run tests
73
73
  bun test
74
74
 
75
+ # Evaluate tool-routing behavior (discovery-first quality check)
76
+ bun run eval:routing
77
+
75
78
  # Dependency audit
76
79
  bun run audit
77
80
  ```
@@ -103,6 +106,7 @@ mcp-squared config # Launch configuration TUI
103
106
  mcp-squared test [upstream] # Test upstream server connections
104
107
  mcp-squared auth <upstream> # OAuth auth for SSE/HTTP upstreams
105
108
  mcp-squared import # Import MCP configs from other tools
109
+ mcp-squared migrate # Apply one-time config migrations
106
110
  mcp-squared install # Install MCP² into other MCP clients
107
111
  mcp-squared monitor # Launch server monitor TUI
108
112
  mcp-squared --help # Full command reference
@@ -157,20 +161,76 @@ url = "https://example.com/mcp"
157
161
  auth = true
158
162
  ```
159
163
 
160
- Security policies (allow/block/confirm) live under `security.tools`. Confirmation flows return a short-lived token that must be provided to `execute` to proceed. OAuth tokens for SSE upstreams are stored under `~/.config/mcp-squared/tokens/<upstream>.json`.
164
+ Security policies (allow/block/confirm) live under `security.tools` and are matched against `capability:action` patterns. Confirmation flows return a short-lived token that must be provided to the same capability/action call to proceed. OAuth tokens for SSE upstreams are stored under `~/.config/mcp-squared/tokens/<upstream>.json`.
165
+
166
+ `mcp-squared init` seeds code-search routing preferences so internal retrieval/routing heuristics prioritize common code indexers by default:
167
+
168
+ ```toml
169
+ [operations.findTools.preferredNamespacesByIntent]
170
+ codeSearch = ["auggie", "ctxdb"]
171
+ ```
172
+
173
+ Tune this list (or set it to `[]`) if your environment uses different namespaces.
174
+
175
+ Capability-first connect-time tool surfacing is configurable via inference/override settings:
176
+
177
+ ```toml
178
+ [operations.dynamicToolSurface]
179
+ inference = "heuristic_with_overrides"
180
+ refresh = "on_connect"
181
+
182
+ [operations.dynamicToolSurface.capabilityOverrides]
183
+ # Optional explicit namespace -> capability pinning.
184
+ # auggie = "code_search"
185
+ ```
186
+
187
+ For existing configs created before this default, run:
188
+
189
+ ```bash
190
+ mcp-squared migrate
191
+ ```
192
+
193
+ Use `mcp-squared migrate --dry-run` to preview without writing.
194
+
195
+ Migration note: capability-router mode is now the only public surface. `mcp-squared migrate` cleans legacy config keys and rewrites security patterns to capability/action form.
196
+
197
+ Legacy keys `operations.dynamicToolSurface.mode` and `operations.dynamicToolSurface.naming` are accepted for compatibility, ignored at runtime, and warned on load. `mcp-squared migrate` removes them.
198
+
199
+ ## Tool API (Capability Routers)
200
+
201
+ MCP² exposes one public tool per non-empty capability at connect time:
202
+ - `code_search`
203
+ - `docs`
204
+ - `browser_automation`
205
+ - `issue_tracking`
206
+ - `cms_content`
207
+ - `design`
208
+ - `hosting_deploy`
209
+ - `time_util`
210
+ - `research`
211
+ - `general`
212
+
213
+ Each capability tool uses a thin router contract:
214
+
215
+ ```json
216
+ {
217
+ "action": "string",
218
+ "arguments": {},
219
+ "confirmation_token": "optional string"
220
+ }
221
+ ```
161
222
 
162
- ## Tool API (Meta-Tools)
223
+ Every capability tool supports `action = "__describe_actions"` for introspection. This returns capability-local action IDs, summaries, and input schemas without exposing upstream namespace/tool identifiers.
163
224
 
164
- MCP² exposes these tools to MCP clients:
165
- - `find_tools` - Search tools across upstream servers
166
- - `describe_tools` - Fetch full JSON schemas for selected tools
167
- - `execute` - Call an upstream tool with policy enforcement
168
- - `list_namespaces` - List upstream namespaces (optionally with tool names)
169
- - `clear_selection_cache` - Reset co-occurrence based suggestions
225
+ Recommended workflow for LLM clients:
226
+ 1. Call the relevant capability (for example `code_search`) with `action = "__describe_actions"`.
227
+ 2. Select an action ID and call the same capability with `arguments`.
228
+ 3. If `requires_disambiguation` is returned, retry with one of the returned candidate action IDs.
229
+ 4. If `requires_confirmation` is returned, retry with `confirmation_token`.
170
230
 
171
- ## Search Modes
231
+ ## Internal Retrieval Modes
172
232
 
173
- `find_tools` supports three search modes:
233
+ `operations.findTools.defaultMode` supports three retrieval modes used by MCP² internals and evaluation tooling:
174
234
  - `fast` (default): SQLite FTS5 full-text search
175
235
  - `semantic`: Embedding similarity search (falls back to `fast` if embeddings are missing)
176
236
  - `hybrid`: FTS5 + embedding rerank (falls back to `fast` if embeddings are missing)
@@ -187,11 +247,12 @@ MCP² can import or install MCP server configs for:
187
247
  ## Key Features
188
248
  - Multi-upstream support (stdio + SSE/HTTP)
189
249
  - OAuth 2.0 dynamic client registration for SSE upstreams
190
- - Hybrid search with optional local embeddings (FTS5 + Transformers.js)
191
- - Detail levels (L0/L1/L2) for progressive schema disclosure
250
+ - Capability-first public API (one router tool per capability)
251
+ - Action-level introspection via `__describe_actions`
252
+ - Hybrid retrieval with optional local embeddings (FTS5 + Transformers.js)
192
253
  - Selection caching with co-occurrence suggestions
193
254
  - Background index refresh with change detection
194
- - Security policies (allow/block/confirm) with confirmation tokens
255
+ - Security policies (allow/block/confirm) on `capability:action` patterns
195
256
  - Local-first architecture (SQLite index)
196
257
  - TUI interfaces for configuration and monitoring
197
258