agent-discover 1.3.9 → 1.4.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/CHANGELOG.md +36 -0
- package/README.md +31 -7
- package/agent-desk-plugin.json +10 -3
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +15 -0
- package/dist/context.js.map +1 -1
- package/dist/domain/log.d.ts +7 -3
- package/dist/domain/log.d.ts.map +1 -1
- package/dist/domain/log.js +15 -5
- package/dist/domain/log.js.map +1 -1
- package/dist/domain/presets.d.ts +30 -0
- package/dist/domain/presets.d.ts.map +1 -0
- package/dist/domain/presets.js +76 -0
- package/dist/domain/presets.js.map +1 -0
- package/dist/domain/proxy.d.ts +153 -0
- package/dist/domain/proxy.d.ts.map +1 -1
- package/dist/domain/proxy.js +396 -3
- package/dist/domain/proxy.js.map +1 -1
- package/dist/domain/sampling.d.ts +9 -0
- package/dist/domain/sampling.d.ts.map +1 -0
- package/dist/domain/sampling.js +68 -0
- package/dist/domain/sampling.js.map +1 -0
- package/dist/storage/database.js +21 -0
- package/dist/storage/database.js.map +1 -1
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/transport/rest.js +349 -0
- package/dist/transport/rest.js.map +1 -1
- package/dist/transport/ws.d.ts.map +1 -1
- package/dist/transport/ws.js +32 -0
- package/dist/transport/ws.js.map +1 -1
- package/dist/ui/app.js +16 -0
- package/dist/ui/index.html +3 -0
- package/dist/ui/markdown.js +102 -0
- package/dist/ui/schema-form.js +393 -0
- package/dist/ui/styles.css +724 -0
- package/dist/ui/tester-window.html +116 -0
- package/dist/ui/tester-window.js +153 -0
- package/dist/ui/tester.js +1412 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.4.0] - 2026-04-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **MCP Inspector-grade Test panel in the dashboard.** Every active server grows a new **Test** section on its card with seven subtabs — Tools, Info, Resources, Prompts, Events, Export, Diagnostics — covering the same debugging surface the upstream `@modelcontextprotocol/inspector` exposes, without launching a second process or second port.
|
|
13
|
+
- **Tools**: schema-driven form renderer (string/number/integer/boolean/enum/array/object + `oneOf`/`anyOf` raw-JSON fallback, format-aware inputs for `date`/`date-time`/`email`/`uri`), three result modes (Pretty / Raw JSON / cURL), latency pill, success/fail badge, "save as preset" + preset dropdown backed by `localStorage`.
|
|
14
|
+
- **Info**: server name, version, instructions (rendered as markdown), advertised capabilities dump.
|
|
15
|
+
- **Resources**: paginated list (Load more cursor), Read / Subscribe / Unsubscribe buttons, live refresh via WS `resources/updated` notifications.
|
|
16
|
+
- **Prompts**: paginated list, argument form, rendered message chain (user/assistant roles, markdown body).
|
|
17
|
+
- **Events**: live stream of server-sent `notifications/*` and `notifications/progress` scoped to the selected server.
|
|
18
|
+
- **Export**: segmented toggle between `mcp.json` (generic MCP client shape — Claude Desktop, Claude Code, Cursor, Windsurf all consume this) and `agent-discover` (declarative setup-file format). Auto-rendered JSON + one-click Copy.
|
|
19
|
+
- **Diagnostics**: `ping` round-trip, `logging/setLevel`.
|
|
20
|
+
- **Pop-out drawer → dedicated browser window.** Each Test drawer has a pop-out button that calls `window.open('/tester/:id', ...)`, spawning a real OS window (resizable, movable, second-monitor-capable) with its own WS connection. Matches Chrome DevTools undock / upstream Inspector UX — no in-page modals. New route `GET /tester/:id` (and `/tester/transient/:handle`) serves a minimal HTML shell that mounts only the tester UI.
|
|
21
|
+
- **Transient (ad-hoc) servers.** New `Test ad-hoc` button in the Servers header spins up a throwaway MCP server by pasted command/args/env (or URL). The child is never written to the registry, gets a 15-minute TTL, auto-disconnects on release, and its tools are invisible to the host MCP catalog — matching Inspector's "test without installing" flow.
|
|
22
|
+
- **14 new REST endpoints** under `/api/servers/:id/*` and `/api/transient/:handle/*`: `info`, `tools` (live), `resources`, `resource-templates`, `resource/read`, `resource/subscribe`, `resource/unsubscribe`, `prompts`, `prompt/get`, `ping`, `logging-level`, `export`, plus `POST /api/transient`, `DELETE /api/transient/:handle`, `GET /api/roots`, `GET /api/logs/notifications`, `GET /api/logs/progress`.
|
|
23
|
+
- **New WebSocket message types.** `notification` and `progress` are broadcast alongside the existing `log_entry` stream so the tester can render events in real time.
|
|
24
|
+
- **Roots capability.** agent-discover now advertises `roots/listChanged` toward every child server; the list is configurable via `AGENT_DISCOVER_ROOTS=file:///path1,file:///path2`.
|
|
25
|
+
- **Elicitation capability.** agent-discover advertises the `elicitation` client capability at activation time so servers that need user-confirmation round-trips are no longer blocked (UI plumbing is v1.5 scope).
|
|
26
|
+
- **`LogKind` taxonomy.** `LogService` entries are now tagged as `call | ping | resource-read | prompt-get | notification | progress | elicitation | sampling` and can be listed / counted per-kind.
|
|
27
|
+
- **Elicitation UI (`elicitation/create`)** — when a transient (ad-hoc) MCP server issues an elicitation request from inside a tool call, agent-discover surfaces it as a modal in the dashboard with a schema-driven form (`requestedSchema` rendered via the existing `schema-form.js`). User picks **Accept** / **Decline** / **Cancel**; the tool call resumes with the response. 2-minute server-side timeout auto-cancels stale requests. New REST endpoints: `GET /api/elicitations`, `POST /api/elicitations/:id/respond`. New WS message type: `elicitation_request`.
|
|
28
|
+
- **Sampling (`sampling/createMessage`) — OpenAI-backed.** Transient servers that call back into an LLM via MCP sampling are routed to OpenAI Chat Completions using `AGENT_DISCOVER_OPENAI_API_KEY` (falls back to `OPENAI_API_KEY`). Model controlled by `AGENT_DISCOVER_SAMPLING_MODEL` (default `gpt-5-mini`), base URL overridable via `AGENT_DISCOVER_OPENAI_BASE_URL`. Every sampling round-trip logged with `kind: "sampling"`. Without a key, the handler declines cleanly so the server can surface the error. `sampling: {}` capability is advertised only on interactive (transient) connections.
|
|
29
|
+
- **Interactive-vs-proxy boundary** — `activate()` threads an `interactive` flag through `ActiveServer`. Elicitation + sampling handlers are registered **only** on `interactive` connections (today: transient only). Registered-active servers stay non-interactive to avoid hijacking the host agent's conversation (documented tradeoff).
|
|
30
|
+
- **SQLite-backed presets (schema V6).** New table `test_presets` persists Test-panel tool/prompt presets cross-browser. REST: `GET /api/presets`, `POST /api/presets`, `DELETE /api/presets/:id`. `tester.js` reads/writes via REST. One-shot migration of legacy `localStorage` presets happens on first load after upgrade.
|
|
31
|
+
|
|
32
|
+
### Security
|
|
33
|
+
|
|
34
|
+
- **Tester API is localhost-only by default.** The 14 new tester endpoints reject non-loopback request origins with 403. Override with `AGENT_DISCOVER_ALLOW_REMOTE_TEST=1` plus a visible warning.
|
|
35
|
+
- **DNS-rebinding protection.** Origin header is validated on all POST/PUT/DELETE tester requests.
|
|
36
|
+
- **Transient command allowlist.** The `command` field passed to `/api/transient` is rejected if it contains unsafe characters. `env` values with CR/LF are stripped to prevent header injection.
|
|
37
|
+
|
|
38
|
+
### Internal
|
|
39
|
+
|
|
40
|
+
- `McpProxy` grows methods for `getServerInfo`, `listToolsLive`, `listResources`, `listResourceTemplates`, `readResource`, `subscribeResource`, `unsubscribeResource`, `listPrompts`, `getPrompt`, `ping`, `setLoggingLevel`, `exportConfig`, plus `activateTransient` / `releaseTransient` / `resolveTransient` and a pluggable `setRootsProvider`.
|
|
41
|
+
- 20 new tests across `tests/proxy-tester.test.ts`, `tests/rest-tester.test.ts`, `tests/log-kinds.test.ts`.
|
|
42
|
+
- New UI modules: `src/ui/schema-form.js`, `src/ui/markdown.js`, `src/ui/tester.js`. Zero new npm dependencies.
|
|
43
|
+
|
|
8
44
|
## [1.3.9] - 2026-04-15
|
|
9
45
|
|
|
10
46
|
### Changed
|
package/README.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
[](https://nodejs.org/)
|
|
5
|
-
[]()
|
|
6
6
|
[]()
|
|
7
7
|
[]()
|
|
8
|
-
[]()
|
|
9
9
|
|
|
10
10
|
**MCP server registry and marketplace.** Discover, install, activate, and manage MCP tools on demand. Acts as a dynamic proxy -- activated servers have their tools merged into the registry's own tool list, so agents can use them without restarting.
|
|
11
11
|
|
|
@@ -60,6 +60,7 @@ Static MCP configs mean every server is always running, even when unused. Adding
|
|
|
60
60
|
- **Full-text search** -- FTS5 search across server names, descriptions, and tags + cross-server tool index for `find_tool`
|
|
61
61
|
- **Pre-download** -- fire-and-forget `npm cache add` (npx servers) or `uv tool install` (uvx servers) on registration, plus a dedicated `/preinstall` endpoint
|
|
62
62
|
- **Real-time dashboard** -- web UI at http://localhost:3424 with Servers and Browse tabs, dark/light theme, WebSocket updates
|
|
63
|
+
- **MCP Inspector-grade Test panel** -- every active server card grows a Test drawer with seven subtabs (Tools / Info / Resources / Prompts / Events / Export / Diagnostics). Schema-driven form renderer, Pretty/Raw JSON/cURL result modes, live notification + progress streaming, localStorage presets, pop-out floating panel for side-by-side debugging, and a `Test ad-hoc` button that spins up a throwaway (never-registered) server with a 15-minute TTL. Covers the same surface as upstream `@modelcontextprotocol/inspector` without a second process or second port.
|
|
63
64
|
- **3 transport layers** -- MCP (stdio), REST API (HTTP), WebSocket (real-time events)
|
|
64
65
|
- **Declarative setup file** -- set `AGENT_DISCOVER_SETUP_FILE` to a JSON file listing servers to ensure-registered on startup. Idempotent (skips existing). Supports `auto_activate`, env var secret refs (`$VAR`), and tags. Automatically also reads a `.local.json` variant (e.g. `discover-setup.local.json`) for machine-specific servers with secrets. New `registry({ action: "sync" })` MCP action and `POST /api/sync` REST endpoint for on-demand re-read.
|
|
65
66
|
- **Bench harness** -- under `bench/`, comparing eager tool loading vs deferred discovery against real OpenCode + gpt-5-mini. Reproducible structural result: discover's first-turn input tokens are flat in N (~20.8k across N ∈ {10, 100, 1000, 3000}); eager's grow linearly (20.9k → 32.4k → 160.9k → context overflow at N=3000). End-to-end accuracy and multi-turn cost numbers are noisier and model-dependent — see [`bench/README.md`](bench/README.md) for what reproduces and what doesn't.
|
|
@@ -138,7 +139,7 @@ When `find_tool` is called with `auto_activate: false` (recommended for catalogs
|
|
|
138
139
|
|
|
139
140
|
---
|
|
140
141
|
|
|
141
|
-
## REST API (
|
|
142
|
+
## REST API (33 endpoints)
|
|
142
143
|
|
|
143
144
|
All endpoints return JSON. CORS enabled.
|
|
144
145
|
|
|
@@ -162,6 +163,27 @@ GET /api/metrics Metrics overview across all servers
|
|
|
162
163
|
GET /api/browse Federated search: official registry + npm + PyPI (?query=, ?limit=, ?cursor=)
|
|
163
164
|
GET /api/npm-check Check if an npm package exists (?package=)
|
|
164
165
|
GET /api/status Active servers summary (names, tool counts, tool lists)
|
|
166
|
+
|
|
167
|
+
Tester surface (MCP Inspector parity — localhost-only unless AGENT_DISCOVER_ALLOW_REMOTE_TEST=1):
|
|
168
|
+
GET /api/servers/:id/info Server name, version, capabilities, instructions
|
|
169
|
+
GET /api/servers/:id/tools Live tools (bypasses activation cache)
|
|
170
|
+
POST /api/servers/:id/call Call a tool
|
|
171
|
+
GET /api/servers/:id/resources List resources (?cursor=...)
|
|
172
|
+
GET /api/servers/:id/resource-templates List resource templates
|
|
173
|
+
POST /api/servers/:id/resource/read Read a resource
|
|
174
|
+
POST /api/servers/:id/resource/subscribe Subscribe to resource updates
|
|
175
|
+
POST /api/servers/:id/resource/unsubscribe Unsubscribe
|
|
176
|
+
GET /api/servers/:id/prompts List prompts (?cursor=...)
|
|
177
|
+
POST /api/servers/:id/prompt/get Get a prompt with args
|
|
178
|
+
POST /api/servers/:id/ping Ping — returns { ok, rtt_ms }
|
|
179
|
+
POST /api/servers/:id/logging-level Set server logging level
|
|
180
|
+
GET /api/servers/:id/export Export config (?format=mcp-json|claude-code|cursor|agent-discover)
|
|
181
|
+
POST /api/transient Activate an ad-hoc server (returns { handle, ... })
|
|
182
|
+
DELETE /api/transient/:handle Release transient server
|
|
183
|
+
GET /api/transient/:handle/* Same tester surface, keyed by handle
|
|
184
|
+
GET /api/roots Configured client roots (AGENT_DISCOVER_ROOTS)
|
|
185
|
+
GET /api/logs/notifications Notification log entries
|
|
186
|
+
GET /api/logs/progress Progress log entries
|
|
165
187
|
```
|
|
166
188
|
|
|
167
189
|
---
|
|
@@ -194,10 +216,12 @@ npm run test:e2e:ui # Playwright dashboard smoke tests
|
|
|
194
216
|
|
|
195
217
|
### Core
|
|
196
218
|
|
|
197
|
-
| Variable
|
|
198
|
-
|
|
|
199
|
-
| `AGENT_DISCOVER_PORT`
|
|
200
|
-
| `AGENT_DISCOVER_DB`
|
|
219
|
+
| Variable | Default | Description |
|
|
220
|
+
| ---------------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
221
|
+
| `AGENT_DISCOVER_PORT` | `3424` | Dashboard HTTP port |
|
|
222
|
+
| `AGENT_DISCOVER_DB` | `~/.claude/agent-discover.db` | SQLite database path |
|
|
223
|
+
| `AGENT_DISCOVER_ROOTS` | — | Comma-separated root URIs advertised to child servers (e.g. `file:///Users/me/repo,file:///Users/me/data`) |
|
|
224
|
+
| `AGENT_DISCOVER_ALLOW_REMOTE_TEST` | `0` | Set to `1` to allow the Test panel endpoints from non-loopback origins. **Not recommended** — see Security. |
|
|
201
225
|
|
|
202
226
|
### Embeddings (semantic search for `find_tool`)
|
|
203
227
|
|
package/agent-desk-plugin.json
CHANGED
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
"id": "agent-discover",
|
|
3
3
|
"name": "Discover",
|
|
4
4
|
"icon": "explore",
|
|
5
|
-
"version": "1.
|
|
6
|
-
"description": "MCP server registry — browse, install, configure, monitor",
|
|
5
|
+
"version": "1.4.0",
|
|
6
|
+
"description": "MCP server registry — browse, install, configure, monitor, test",
|
|
7
7
|
"ui": "./dist/ui/app.js",
|
|
8
8
|
"css": "./dist/ui/styles.css",
|
|
9
|
-
"uiFiles": [
|
|
9
|
+
"uiFiles": [
|
|
10
|
+
"morphdom.min.js",
|
|
11
|
+
"template.js",
|
|
12
|
+
"markdown.js",
|
|
13
|
+
"schema-form.js",
|
|
14
|
+
"tester.js",
|
|
15
|
+
"app.js"
|
|
16
|
+
],
|
|
10
17
|
"position": 4
|
|
11
18
|
}
|
package/dist/context.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { SecretsService } from './domain/secrets.js';
|
|
|
8
8
|
import { HealthService } from './domain/health.js';
|
|
9
9
|
import { MetricsService } from './domain/metrics.js';
|
|
10
10
|
import { LogService } from './domain/log.js';
|
|
11
|
+
import { PresetsService } from './domain/presets.js';
|
|
11
12
|
import { type SyncResult } from './domain/setup.js';
|
|
12
13
|
export interface AppContext {
|
|
13
14
|
readonly db: Db;
|
|
@@ -20,6 +21,7 @@ export interface AppContext {
|
|
|
20
21
|
readonly health: HealthService;
|
|
21
22
|
readonly metrics: MetricsService;
|
|
22
23
|
readonly logs: LogService;
|
|
24
|
+
readonly presets: PresetsService;
|
|
23
25
|
syncSetup(filePath?: string): Promise<SyncResult>;
|
|
24
26
|
close(): void;
|
|
25
27
|
}
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAOA,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE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B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAwD/D;AAkBD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBzE"}
|
package/dist/context.js
CHANGED
|
@@ -14,6 +14,8 @@ import { SecretsService } from './domain/secrets.js';
|
|
|
14
14
|
import { HealthService } from './domain/health.js';
|
|
15
15
|
import { MetricsService } from './domain/metrics.js';
|
|
16
16
|
import { LogService } from './domain/log.js';
|
|
17
|
+
import { PresetsService } from './domain/presets.js';
|
|
18
|
+
import { maybeCreateDefaultSamplingProvider } from './domain/sampling.js';
|
|
17
19
|
import { syncSetupFile } from './domain/setup.js';
|
|
18
20
|
export function createContext(dbOptions) {
|
|
19
21
|
const db = createDb(dbOptions);
|
|
@@ -27,6 +29,7 @@ export function createContext(dbOptions) {
|
|
|
27
29
|
const metrics = new MetricsService(db);
|
|
28
30
|
const health = new HealthService(db, proxy);
|
|
29
31
|
const logs = new LogService();
|
|
32
|
+
const presets = new PresetsService(db);
|
|
30
33
|
proxy.setSecretsService(secrets);
|
|
31
34
|
proxy.setMetricsService(metrics);
|
|
32
35
|
proxy.setLogService(logs);
|
|
@@ -34,6 +37,17 @@ export function createContext(dbOptions) {
|
|
|
34
37
|
const server = registry.getByName(name);
|
|
35
38
|
return server ? server.id : null;
|
|
36
39
|
});
|
|
40
|
+
proxy.setRootsProvider(() => {
|
|
41
|
+
const raw = process.env.AGENT_DISCOVER_ROOTS ?? '';
|
|
42
|
+
return raw
|
|
43
|
+
.split(',')
|
|
44
|
+
.map((s) => s.trim())
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
.map((uri) => ({ uri, name: uri }));
|
|
47
|
+
});
|
|
48
|
+
const samplingProvider = maybeCreateDefaultSamplingProvider();
|
|
49
|
+
if (samplingProvider)
|
|
50
|
+
proxy.setSamplingProvider(samplingProvider);
|
|
37
51
|
return {
|
|
38
52
|
db,
|
|
39
53
|
events,
|
|
@@ -45,6 +59,7 @@ export function createContext(dbOptions) {
|
|
|
45
59
|
health,
|
|
46
60
|
metrics,
|
|
47
61
|
logs,
|
|
62
|
+
presets,
|
|
48
63
|
syncSetup(filePath) {
|
|
49
64
|
return syncSetupFile(registry, secrets, proxy, filePath);
|
|
50
65
|
},
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uCAA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ompt-get' | 'notification' | 'progress' | 'elicitation' | 'sampling';
|
|
1
2
|
export interface LogEntry {
|
|
2
3
|
id: number;
|
|
3
4
|
timestamp: string;
|
|
@@ -7,6 +8,7 @@ export interface LogEntry {
|
|
|
7
8
|
response: string;
|
|
8
9
|
latency_ms: number;
|
|
9
10
|
success: boolean;
|
|
11
|
+
kind: LogKind;
|
|
10
12
|
}
|
|
11
13
|
export declare class LogService {
|
|
12
14
|
private readonly buffer;
|
|
@@ -15,10 +17,12 @@ export declare class LogService {
|
|
|
15
17
|
private seq;
|
|
16
18
|
onEntry?: (entry: LogEntry) => void;
|
|
17
19
|
constructor(max?: number, retentionDays?: number);
|
|
18
|
-
push(server: string, tool: string, args: Record<string, unknown>, response: string, latencyMs: number, success: boolean): LogEntry;
|
|
20
|
+
push(server: string, tool: string, args: Record<string, unknown>, response: string, latencyMs: number, success: boolean, kind?: LogKind): LogEntry;
|
|
21
|
+
pushNotification(server: string, method: string, payload: Record<string, unknown>): LogEntry;
|
|
22
|
+
pushProgress(server: string, token: string | number, progress: number, total: number | undefined, message: string | undefined): LogEntry;
|
|
19
23
|
private pruneExpired;
|
|
20
|
-
list(limit?: number, offset?: number): LogEntry[];
|
|
21
|
-
count(): number;
|
|
24
|
+
list(limit?: number, offset?: number, kind?: LogKind): LogEntry[];
|
|
25
|
+
count(kind?: LogKind): number;
|
|
22
26
|
clear(): void;
|
|
23
27
|
}
|
|
24
28
|
//# sourceMappingURL=log.d.ts.map
|
package/dist/domain/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/domain/log.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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AAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ;IAI5F,YAAY,CACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,QAAQ;IAYX,OAAO,CAAC,YAAY;IAOpB,IAAI,CAAC,KAAK,SAAM,EAAE,MAAM,SAAI,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE;IAMzD,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM;IAK7B,KAAK,IAAI,IAAI;CAGd"}
|
package/dist/domain/log.js
CHANGED
|
@@ -15,7 +15,7 @@ export class LogService {
|
|
|
15
15
|
parseInt(process.env.AGENT_DISCOVER_LOG_RETENTION_DAYS ?? String(DEFAULT_RETENTION_DAYS), 10);
|
|
16
16
|
this.retentionMs = (days > 0 ? days : DEFAULT_RETENTION_DAYS) * 86_400_000;
|
|
17
17
|
}
|
|
18
|
-
push(server, tool, args, response, latencyMs, success) {
|
|
18
|
+
push(server, tool, args, response, latencyMs, success, kind = 'call') {
|
|
19
19
|
this.pruneExpired();
|
|
20
20
|
const entry = {
|
|
21
21
|
id: ++this.seq,
|
|
@@ -26,6 +26,7 @@ export class LogService {
|
|
|
26
26
|
response,
|
|
27
27
|
latency_ms: latencyMs,
|
|
28
28
|
success,
|
|
29
|
+
kind,
|
|
29
30
|
};
|
|
30
31
|
this.buffer.push(entry);
|
|
31
32
|
if (this.buffer.length > this.max)
|
|
@@ -34,18 +35,27 @@ export class LogService {
|
|
|
34
35
|
this.onEntry(entry);
|
|
35
36
|
return entry;
|
|
36
37
|
}
|
|
38
|
+
pushNotification(server, method, payload) {
|
|
39
|
+
return this.push(server, method, payload, JSON.stringify(payload), 0, true, 'notification');
|
|
40
|
+
}
|
|
41
|
+
pushProgress(server, token, progress, total, message) {
|
|
42
|
+
return this.push(server, 'progress', { token, progress, total, message }, message ?? '', 0, true, 'progress');
|
|
43
|
+
}
|
|
37
44
|
pruneExpired() {
|
|
38
45
|
const cutoff = Date.now() - this.retentionMs;
|
|
39
46
|
while (this.buffer.length > 0 && new Date(this.buffer[0].timestamp).getTime() < cutoff) {
|
|
40
47
|
this.buffer.shift();
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
|
-
list(limit = 100, offset = 0) {
|
|
44
|
-
const
|
|
50
|
+
list(limit = 100, offset = 0, kind) {
|
|
51
|
+
const filtered = kind ? this.buffer.filter((e) => e.kind === kind) : this.buffer;
|
|
52
|
+
const reversed = [...filtered].reverse();
|
|
45
53
|
return reversed.slice(offset, offset + limit);
|
|
46
54
|
}
|
|
47
|
-
count() {
|
|
48
|
-
|
|
55
|
+
count(kind) {
|
|
56
|
+
if (!kind)
|
|
57
|
+
return this.buffer.length;
|
|
58
|
+
return this.buffer.reduce((n, e) => n + (e.kind === kind ? 1 : 0), 0);
|
|
49
59
|
}
|
|
50
60
|
clear() {
|
|
51
61
|
this.buffer.length = 0;
|
package/dist/domain/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/domain/log.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oCAAoC;AACpC,gFAAgF;AAEhF,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,sBAAsB,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/domain/log.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oCAAoC;AACpC,gFAAgF;AAEhF,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAwBlC,MAAM,OAAO,UAAU;IACJ,MAAM,GAAe,EAAE,CAAC;IACxB,GAAG,CAAS;IACZ,WAAW,CAAS;IAC7B,GAAG,GAAG,CAAC,CAAC;IAChB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AE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Db } from '../storage/database.js';
|
|
2
|
+
export type PresetKind = 'tool' | 'prompt';
|
|
3
|
+
export interface PresetEntry {
|
|
4
|
+
id: number;
|
|
5
|
+
server_name: string;
|
|
6
|
+
kind: PresetKind;
|
|
7
|
+
target_name: string;
|
|
8
|
+
preset_name: string;
|
|
9
|
+
payload: unknown;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class PresetsService {
|
|
14
|
+
private readonly db;
|
|
15
|
+
constructor(db: Db);
|
|
16
|
+
list(filter?: {
|
|
17
|
+
server?: string;
|
|
18
|
+
kind?: PresetKind;
|
|
19
|
+
target?: string;
|
|
20
|
+
}): PresetEntry[];
|
|
21
|
+
upsert(input: {
|
|
22
|
+
server: string;
|
|
23
|
+
kind: PresetKind;
|
|
24
|
+
target: string;
|
|
25
|
+
preset: string;
|
|
26
|
+
payload: unknown;
|
|
27
|
+
}): PresetEntry;
|
|
28
|
+
delete(id: number): boolean;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/domain/presets.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAgCD,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAEnC,IAAI,CAAC,MAAM,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,WAAW,EAAE;IAoBzF,MAAM,CAAC,KAAK,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,UAAU,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;KAClB,GAAG,WAAW;IA2Bf,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAI5B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// agent-discover — Preset storage for the Test panel
|
|
3
|
+
// =============================================================================
|
|
4
|
+
function hydrate(row) {
|
|
5
|
+
let payload;
|
|
6
|
+
try {
|
|
7
|
+
payload = JSON.parse(row.payload);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
payload = {};
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
id: row.id,
|
|
14
|
+
server_name: row.server_name,
|
|
15
|
+
kind: row.kind,
|
|
16
|
+
target_name: row.target_name,
|
|
17
|
+
preset_name: row.preset_name,
|
|
18
|
+
payload,
|
|
19
|
+
created_at: row.created_at,
|
|
20
|
+
updated_at: row.updated_at,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export class PresetsService {
|
|
24
|
+
db;
|
|
25
|
+
constructor(db) {
|
|
26
|
+
this.db = db;
|
|
27
|
+
}
|
|
28
|
+
list(filter = {}) {
|
|
29
|
+
const clauses = [];
|
|
30
|
+
const params = [];
|
|
31
|
+
if (filter.server) {
|
|
32
|
+
clauses.push('server_name = ?');
|
|
33
|
+
params.push(filter.server);
|
|
34
|
+
}
|
|
35
|
+
if (filter.kind) {
|
|
36
|
+
clauses.push('kind = ?');
|
|
37
|
+
params.push(filter.kind);
|
|
38
|
+
}
|
|
39
|
+
if (filter.target) {
|
|
40
|
+
clauses.push('target_name = ?');
|
|
41
|
+
params.push(filter.target);
|
|
42
|
+
}
|
|
43
|
+
const sql = `SELECT * FROM test_presets${clauses.length ? ' WHERE ' + clauses.join(' AND ') : ''} ORDER BY server_name, target_name, preset_name`;
|
|
44
|
+
const rows = this.db.queryAll(sql, params);
|
|
45
|
+
return rows.map(hydrate);
|
|
46
|
+
}
|
|
47
|
+
upsert(input) {
|
|
48
|
+
if (!input.server)
|
|
49
|
+
throw new Error('server is required');
|
|
50
|
+
if (!input.target)
|
|
51
|
+
throw new Error('target is required');
|
|
52
|
+
if (!input.preset)
|
|
53
|
+
throw new Error('preset is required');
|
|
54
|
+
if (input.kind !== 'tool' && input.kind !== 'prompt') {
|
|
55
|
+
throw new Error(`kind must be "tool" or "prompt", got "${input.kind}"`);
|
|
56
|
+
}
|
|
57
|
+
const payloadJson = JSON.stringify(input.payload ?? {});
|
|
58
|
+
this.db.run(`
|
|
59
|
+
INSERT INTO test_presets (server_name, kind, target_name, preset_name, payload)
|
|
60
|
+
VALUES (?, ?, ?, ?, ?)
|
|
61
|
+
ON CONFLICT(server_name, kind, target_name, preset_name) DO UPDATE SET
|
|
62
|
+
payload = excluded.payload,
|
|
63
|
+
updated_at = datetime('now')
|
|
64
|
+
`, [input.server, input.kind, input.target, input.preset, payloadJson]);
|
|
65
|
+
const row = this.db.queryOne(`SELECT * FROM test_presets
|
|
66
|
+
WHERE server_name = ? AND kind = ? AND target_name = ? AND preset_name = ?`, [input.server, input.kind, input.target, input.preset]);
|
|
67
|
+
if (!row)
|
|
68
|
+
throw new Error('Failed to persist preset');
|
|
69
|
+
return hydrate(row);
|
|
70
|
+
}
|
|
71
|
+
delete(id) {
|
|
72
|
+
const result = this.db.run('DELETE FROM test_presets WHERE id = ?', [id]);
|
|
73
|
+
return result.changes > 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/domain/presets.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,qDAAqD;AACrD,gFAAgF;AA4BhF,SAAS,OAAO,CAAC,GAAc;IAC7B,IAAI,OAAgB,CAAC;IACrB,IAAI,CAAC;QACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,EAAE,CAAC;IACf,CAAC;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,IAAI,EAAE,GAAG,CAAC,IAAkB;QAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,OAAO;QACP,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,UAAU,EAAE,GAAG,CAAC,UAAU;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,EAAM;QAAN,OAAE,GAAF,EAAE,CAAI;IAAG,CAAC;IAEvC,IAAI,CAAC,SAAkE,EAAE;QACvE,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAc,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,iBAAiB,CA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KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,EAAE,CAAC,GAAG,CACT;;;;;;KAMD,EACC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CACpE,CAAC;QACF,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,QAAQ,CAC1B;mFAC6E,EAC7E,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CACvD,CAAC;QACF,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QACtD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,MAAM,CAAC,EAAU;QACf,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,uCAAuC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1E,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/domain/proxy.d.ts
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
3
|
+
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
4
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
1
5
|
import type { SecretsService } from './secrets.js';
|
|
2
6
|
import type { MetricsService } from './metrics.js';
|
|
3
7
|
import type { LogService } from './log.js';
|
|
8
|
+
type AnyTransport = StdioClientTransport | SSEClientTransport | StreamableHTTPClientTransport;
|
|
9
|
+
export type ResourceEntry = {
|
|
10
|
+
uri: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
mimeType?: string;
|
|
14
|
+
size?: number;
|
|
15
|
+
};
|
|
16
|
+
export type ResourceTemplateEntry = {
|
|
17
|
+
uriTemplate: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
mimeType?: string;
|
|
21
|
+
};
|
|
22
|
+
export type PromptEntry = {
|
|
23
|
+
name: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
arguments?: Array<{
|
|
26
|
+
name: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
export type ServerInfo = {
|
|
32
|
+
name: string;
|
|
33
|
+
version: string;
|
|
34
|
+
instructions?: string;
|
|
35
|
+
capabilities: Record<string, unknown>;
|
|
36
|
+
};
|
|
37
|
+
interface ActiveServer {
|
|
38
|
+
client: Client;
|
|
39
|
+
transport: AnyTransport;
|
|
40
|
+
tools: Array<{
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
inputSchema?: Record<string, unknown>;
|
|
44
|
+
}>;
|
|
45
|
+
config: ServerConfig;
|
|
46
|
+
capabilities?: Record<string, unknown>;
|
|
47
|
+
serverVersion?: {
|
|
48
|
+
name: string;
|
|
49
|
+
version: string;
|
|
50
|
+
};
|
|
51
|
+
instructions?: string;
|
|
52
|
+
transient: boolean;
|
|
53
|
+
interactive: boolean;
|
|
54
|
+
lastPingMs?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface PendingElicitation {
|
|
57
|
+
id: string;
|
|
58
|
+
serverName: string;
|
|
59
|
+
message: string;
|
|
60
|
+
requestedSchema: Record<string, unknown>;
|
|
61
|
+
createdAt: number;
|
|
62
|
+
}
|
|
63
|
+
export type ElicitationAction = 'accept' | 'decline' | 'cancel';
|
|
64
|
+
export interface SamplingProvider {
|
|
65
|
+
createMessage(request: {
|
|
66
|
+
serverName: string;
|
|
67
|
+
messages: Array<{
|
|
68
|
+
role: string;
|
|
69
|
+
content: {
|
|
70
|
+
type: string;
|
|
71
|
+
text?: string;
|
|
72
|
+
};
|
|
73
|
+
}>;
|
|
74
|
+
maxTokens?: number;
|
|
75
|
+
temperature?: number;
|
|
76
|
+
systemPrompt?: string;
|
|
77
|
+
modelPreferences?: Record<string, unknown>;
|
|
78
|
+
}): Promise<{
|
|
79
|
+
role: 'assistant';
|
|
80
|
+
content: {
|
|
81
|
+
type: 'text';
|
|
82
|
+
text: string;
|
|
83
|
+
};
|
|
84
|
+
model: string;
|
|
85
|
+
stopReason?: string;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
4
88
|
export interface ServerConfig {
|
|
5
89
|
name: string;
|
|
6
90
|
command?: string;
|
|
@@ -19,13 +103,31 @@ export interface ParsedToolName {
|
|
|
19
103
|
serverName: string;
|
|
20
104
|
toolName: string;
|
|
21
105
|
}
|
|
106
|
+
export interface TransientHandle {
|
|
107
|
+
handle: string;
|
|
108
|
+
serverName: string;
|
|
109
|
+
tools: ActiveServer['tools'];
|
|
110
|
+
capabilities: Record<string, unknown>;
|
|
111
|
+
serverVersion?: {
|
|
112
|
+
name: string;
|
|
113
|
+
version: string;
|
|
114
|
+
};
|
|
115
|
+
expiresAt: number;
|
|
116
|
+
}
|
|
22
117
|
export declare class McpProxy {
|
|
23
118
|
private readonly activeServers;
|
|
24
119
|
private readonly activating;
|
|
120
|
+
private readonly transient;
|
|
121
|
+
private transientSeq;
|
|
25
122
|
private secretsService?;
|
|
26
123
|
private metricsService?;
|
|
27
124
|
private logService?;
|
|
28
125
|
private serverIdResolver?;
|
|
126
|
+
private rootsProvider;
|
|
127
|
+
private samplingProvider?;
|
|
128
|
+
private readonly elicitations;
|
|
129
|
+
private elicitationListener?;
|
|
130
|
+
private elicitationSeq;
|
|
29
131
|
setSecretsService(secrets: SecretsService): void;
|
|
30
132
|
setMetricsService(metrics: MetricsService): void;
|
|
31
133
|
setLogService(logs: LogService): void;
|
|
@@ -35,6 +137,7 @@ export declare class McpProxy {
|
|
|
35
137
|
description?: string;
|
|
36
138
|
inputSchema?: Record<string, unknown>;
|
|
37
139
|
}>>;
|
|
140
|
+
private activateInternal;
|
|
38
141
|
deactivate(name: string): Promise<void>;
|
|
39
142
|
callTool(serverName: string, toolName: string, args?: Record<string, unknown>): Promise<{
|
|
40
143
|
content: Array<{
|
|
@@ -53,7 +156,57 @@ export declare class McpProxy {
|
|
|
53
156
|
description?: string;
|
|
54
157
|
}>;
|
|
55
158
|
isActive(name: string): boolean;
|
|
159
|
+
getServerInfo(name: string): ServerInfo | null;
|
|
160
|
+
listToolsLive(name: string): Promise<ActiveServer['tools']>;
|
|
161
|
+
listResources(name: string, cursor?: string): Promise<{
|
|
162
|
+
resources: ResourceEntry[];
|
|
163
|
+
nextCursor?: string;
|
|
164
|
+
}>;
|
|
165
|
+
listResourceTemplates(name: string, cursor?: string): Promise<{
|
|
166
|
+
resourceTemplates: ResourceTemplateEntry[];
|
|
167
|
+
nextCursor?: string;
|
|
168
|
+
}>;
|
|
169
|
+
readResource(name: string, uri: string): Promise<{
|
|
170
|
+
contents: Array<Record<string, unknown>>;
|
|
171
|
+
}>;
|
|
172
|
+
subscribeResource(name: string, uri: string): Promise<void>;
|
|
173
|
+
unsubscribeResource(name: string, uri: string): Promise<void>;
|
|
174
|
+
listPrompts(name: string, cursor?: string): Promise<{
|
|
175
|
+
prompts: PromptEntry[];
|
|
176
|
+
nextCursor?: string;
|
|
177
|
+
}>;
|
|
178
|
+
getPrompt(name: string, promptName: string, args?: Record<string, string>): Promise<{
|
|
179
|
+
messages: Array<Record<string, unknown>>;
|
|
180
|
+
description?: string;
|
|
181
|
+
}>;
|
|
182
|
+
ping(name: string): Promise<{
|
|
183
|
+
ok: boolean;
|
|
184
|
+
rtt_ms: number;
|
|
185
|
+
}>;
|
|
186
|
+
setLoggingLevel(name: string, level: 'debug' | 'info' | 'notice' | 'warning' | 'error' | 'critical' | 'alert' | 'emergency'): Promise<void>;
|
|
187
|
+
exportConfig(name: string, format: 'mcp-json' | 'agent-discover'): Record<string, unknown>;
|
|
188
|
+
activateTransient(config: ServerConfig, ttlMs?: number): Promise<TransientHandle>;
|
|
189
|
+
releaseTransient(handle: string): Promise<void>;
|
|
190
|
+
resolveTransient(handle: string): string | null;
|
|
191
|
+
private pruneTransient;
|
|
192
|
+
setRootsProvider(provider: () => Array<{
|
|
193
|
+
uri: string;
|
|
194
|
+
name?: string;
|
|
195
|
+
}>): void;
|
|
196
|
+
private wireRootsHandler;
|
|
197
|
+
private wireNotificationHandler;
|
|
198
|
+
private requireActive;
|
|
199
|
+
setElicitationListener(listener: (pending: PendingElicitation) => void): void;
|
|
200
|
+
listPendingElicitations(): PendingElicitation[];
|
|
201
|
+
respondElicitation(id: string, response: {
|
|
202
|
+
action: ElicitationAction;
|
|
203
|
+
content?: Record<string, unknown>;
|
|
204
|
+
}): boolean;
|
|
205
|
+
private wireElicitationHandler;
|
|
206
|
+
setSamplingProvider(provider: SamplingProvider): void;
|
|
207
|
+
private wireSamplingHandler;
|
|
56
208
|
private createTransport;
|
|
57
209
|
deactivateAll(): Promise<void>;
|
|
58
210
|
}
|
|
211
|
+
export {};
|
|
59
212
|
//# sourceMappingURL=proxy.d.ts.map
|