@cyanmycelium/mcp-broker 1.3.0 → 1.3.1
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/dist/bin.js +1 -1
- package/dist/{chunk-BZUZYXVA.js → chunk-UOJRDF5R.js} +27 -2
- package/dist/chunk-UOJRDF5R.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/broker/aggregate/aggregate.server.ts +10 -0
- package/src/ws/ws.tunnel.ts +18 -1
- package/dist/chunk-BZUZYXVA.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1441,6 +1441,17 @@ declare class WsTunnel implements IBrokerContext {
|
|
|
1441
1441
|
getSecurityInfo(): IBrokerSecurityInfo;
|
|
1442
1442
|
/** Slot the stdio bridge is pinned to, or `null` when there is no bridge. */
|
|
1443
1443
|
getStdioBridgeTarget(): string | null;
|
|
1444
|
+
/**
|
|
1445
|
+
* Membership of the `_all` aggregate, for `broker_diagnose`.
|
|
1446
|
+
*
|
|
1447
|
+
* Before `start()` the aggregate server does not exist yet, so an enabled
|
|
1448
|
+
* aggregate reports no provider rather than `undefined`: "cannot be read"
|
|
1449
|
+
* is for a host that has no aggregate at all, not for one that has not
|
|
1450
|
+
* started. Without this accessor the CLI's own broker skipped the
|
|
1451
|
+
* `aggregate-empty` check and told the operator to call tools/list on
|
|
1452
|
+
* `_all` by hand.
|
|
1453
|
+
*/
|
|
1454
|
+
getAggregateInfo(): IBrokerAggregateInfo;
|
|
1444
1455
|
getProvidersInfo(): IBrokerProviderInfo[];
|
|
1445
1456
|
getProviderInfo(name: string): IBrokerProviderInfo | undefined;
|
|
1446
1457
|
private _buildProviderInfo;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AuthError, BROKER_AGGREGATE_NAME, BROKER_GUIDES, BROKER_GUIDE_MIME_TYPE, BROKER_GUIDE_TOPICS, BROKER_GUIDE_URI_PREFIX, BROKER_GUIDE_URI_TEMPLATE, BROKER_PROVIDER_NAME, BROKER_RESERVED_SLOTS, BrokerDiagnoseAdapter, BrokerDiagnoseBehavior, BrokerGuideAdapter, BrokerGuideBehavior, BrokerInfoBehavior, BrokerProvidersBehavior, ConfigPolicyEngine, ConfiguredCapabilityClassifier, DEFAULT_CONFIG_FILENAME, DefaultSlotResourceResolver, HttpAuthGuard, JwtSubjectMapper, JwtTokenValidator, PACKAGE_NAME, RemoteUpstream, ResourcePath, ResourcePathPattern, SharedSecretProviderAuthenticator, StdioUpstream, SubjectMappingError, VERSION, WsTunnel, WsTunnelBuilder, authorizationWithEngine, brokerGrammarKey, brokerGuide, brokerGuideIndex, brokerGuideTopicFromUri, brokerGuideUri, buildJwtAuth, buildResourceMetadata, compileAuthorizationPolicy, compileProviderAllowedResources, diagnoseBroker, hasAuthorizationPolicies, isReservedBrokerSlot, iterAvailableBrokerGrammars, iterBrokerGrammarsFrom, loadBrokerConfig, loadBrokerGrammar, loadMcpbBundle, normalizeProviderAuthentication, providerMayPublish, providerPublishDecision, resolveOpenTarget, scopesOf, startBrokerServer, unzipMcpb, validateCapability } from './chunk-
|
|
1
|
+
export { AuthError, BROKER_AGGREGATE_NAME, BROKER_GUIDES, BROKER_GUIDE_MIME_TYPE, BROKER_GUIDE_TOPICS, BROKER_GUIDE_URI_PREFIX, BROKER_GUIDE_URI_TEMPLATE, BROKER_PROVIDER_NAME, BROKER_RESERVED_SLOTS, BrokerDiagnoseAdapter, BrokerDiagnoseBehavior, BrokerGuideAdapter, BrokerGuideBehavior, BrokerInfoBehavior, BrokerProvidersBehavior, ConfigPolicyEngine, ConfiguredCapabilityClassifier, DEFAULT_CONFIG_FILENAME, DefaultSlotResourceResolver, HttpAuthGuard, JwtSubjectMapper, JwtTokenValidator, PACKAGE_NAME, RemoteUpstream, ResourcePath, ResourcePathPattern, SharedSecretProviderAuthenticator, StdioUpstream, SubjectMappingError, VERSION, WsTunnel, WsTunnelBuilder, authorizationWithEngine, brokerGrammarKey, brokerGuide, brokerGuideIndex, brokerGuideTopicFromUri, brokerGuideUri, buildJwtAuth, buildResourceMetadata, compileAuthorizationPolicy, compileProviderAllowedResources, diagnoseBroker, hasAuthorizationPolicies, isReservedBrokerSlot, iterAvailableBrokerGrammars, iterBrokerGrammarsFrom, loadBrokerConfig, loadBrokerGrammar, loadMcpbBundle, normalizeProviderAuthentication, providerMayPublish, providerPublishDecision, resolveOpenTarget, scopesOf, startBrokerServer, unzipMcpb, validateCapability } from './chunk-UOJRDF5R.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanmycelium/mcp-broker",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "WebSocket-based Model Context Protocol broker. Aggregates multiple MCP providers behind a single endpoint with stdio, SSE, and Streamable HTTP client transports.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -163,6 +163,16 @@ export class AggregateServer implements IMessageTransport {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Slot names currently contributing to the aggregate, in registration
|
|
168
|
+
* order. A provider whose handshake failed is not in it: `addProvider`
|
|
169
|
+
* removed it. This is what `broker_diagnose` reads through
|
|
170
|
+
* `IBrokerContext.getAggregateInfo()`.
|
|
171
|
+
*/
|
|
172
|
+
get providerNames(): readonly string[] {
|
|
173
|
+
return [...this._sessions.keys()];
|
|
174
|
+
}
|
|
175
|
+
|
|
166
176
|
/** Removes a provider from the aggregate. */
|
|
167
177
|
removeProvider(name: string): void {
|
|
168
178
|
const session = this._sessions.get(name);
|
package/src/ws/ws.tunnel.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { IBrokerContext, IBrokerProviderInfo, BrokerProviderTransport } fro
|
|
|
19
19
|
// Imported from the defining module rather than the barrel: these two are the
|
|
20
20
|
// optional `IBrokerContext` extensions `broker_diagnose` reads, and the barrel
|
|
21
21
|
// does not re-export them yet.
|
|
22
|
-
import type { IBrokerSecurityInfo } from "../broker/broker.context";
|
|
22
|
+
import type { IBrokerAggregateInfo, IBrokerSecurityInfo } from "../broker/broker.context";
|
|
23
23
|
import { AggregateServer } from "../broker/aggregate/aggregate.server";
|
|
24
24
|
import {
|
|
25
25
|
HttpAuthGuard,
|
|
@@ -433,6 +433,23 @@ export class WsTunnel implements IBrokerContext {
|
|
|
433
433
|
return this._options.stdioClient?.providerName ?? null;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Membership of the `_all` aggregate, for `broker_diagnose`.
|
|
438
|
+
*
|
|
439
|
+
* Before `start()` the aggregate server does not exist yet, so an enabled
|
|
440
|
+
* aggregate reports no provider rather than `undefined`: "cannot be read"
|
|
441
|
+
* is for a host that has no aggregate at all, not for one that has not
|
|
442
|
+
* started. Without this accessor the CLI's own broker skipped the
|
|
443
|
+
* `aggregate-empty` check and told the operator to call tools/list on
|
|
444
|
+
* `_all` by hand.
|
|
445
|
+
*/
|
|
446
|
+
public getAggregateInfo(): IBrokerAggregateInfo {
|
|
447
|
+
return {
|
|
448
|
+
enabled: this._options.enableAggregateProvider !== false,
|
|
449
|
+
providers: this._aggregateServer?.providerNames ?? [],
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
|
|
436
453
|
public getProvidersInfo(): IBrokerProviderInfo[] {
|
|
437
454
|
const out: IBrokerProviderInfo[] = [];
|
|
438
455
|
for (const [name, state] of this._providers) {
|