@backstage/plugin-mcp-actions-backend 0.1.3-next.0 → 0.1.3-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @backstage/plugin-mcp-actions-backend
2
2
 
3
+ ## 0.1.3-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 1d47bf3: Proxy `/.well-known/oauth-authorization-server` to `/.well-known/openid-configuration` on `auth-backend` when `auth.experimentalDynamicClientRegistration.enabled` is enabled.
8
+ - Updated dependencies
9
+ - @backstage/backend-defaults@0.12.1-next.1
10
+ - @backstage/catalog-client@1.12.0-next.0
11
+ - @backstage/plugin-catalog-node@1.19.0-next.1
12
+
3
13
  ## 0.1.3-next.0
4
14
 
5
15
  ### Patch Changes
@@ -2,11 +2,16 @@
2
2
 
3
3
  var backendPluginApi = require('@backstage/backend-plugin-api');
4
4
  var express = require('express');
5
+ var PromiseRouter = require('express-promise-router');
5
6
  var McpService = require('./services/McpService.cjs.js');
6
7
  var createStreamableRouter = require('./routers/createStreamableRouter.cjs.js');
7
8
  var createSseRouter = require('./routers/createSseRouter.cjs.js');
8
9
  var alpha = require('@backstage/backend-plugin-api/alpha');
9
10
 
11
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
+
13
+ var PromiseRouter__default = /*#__PURE__*/_interopDefaultCompat(PromiseRouter);
14
+
10
15
  const mcpPlugin = backendPluginApi.createBackendPlugin({
11
16
  pluginId: "mcp-actions",
12
17
  register(env) {
@@ -17,9 +22,20 @@ const mcpPlugin = backendPluginApi.createBackendPlugin({
17
22
  httpAuth: backendPluginApi.coreServices.httpAuth,
18
23
  httpRouter: backendPluginApi.coreServices.httpRouter,
19
24
  actions: alpha.actionsServiceRef,
20
- registry: alpha.actionsRegistryServiceRef
25
+ registry: alpha.actionsRegistryServiceRef,
26
+ rootRouter: backendPluginApi.coreServices.rootHttpRouter,
27
+ discovery: backendPluginApi.coreServices.discovery,
28
+ config: backendPluginApi.coreServices.rootConfig
21
29
  },
22
- async init({ actions, logger, httpRouter, httpAuth }) {
30
+ async init({
31
+ actions,
32
+ logger,
33
+ httpRouter,
34
+ httpAuth,
35
+ rootRouter,
36
+ discovery,
37
+ config
38
+ }) {
23
39
  const mcpService = await McpService.McpService.create({
24
40
  actions
25
41
  });
@@ -32,11 +48,25 @@ const mcpPlugin = backendPluginApi.createBackendPlugin({
32
48
  httpAuth,
33
49
  logger
34
50
  });
35
- const router = express.Router();
51
+ const router = PromiseRouter__default.default();
36
52
  router.use(express.json());
37
53
  router.use("/v1/sse", sseRouter);
38
54
  router.use("/v1", streamableRouter);
39
55
  httpRouter.use(router);
56
+ if (config.getOptionalBoolean(
57
+ "auth.experimentalDynamicClientRegistration.enabled"
58
+ )) {
59
+ rootRouter.use(
60
+ "/.well-known/oauth-authorization-server",
61
+ async (_, res) => {
62
+ const authBaseUrl = await discovery.getBaseUrl("auth");
63
+ const oidcResponse = await fetch(
64
+ `${authBaseUrl}/.well-known/openid-configuration`
65
+ );
66
+ res.json(await oidcResponse.json());
67
+ }
68
+ );
69
+ }
40
70
  }
41
71
  });
42
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendPlugin,\n} from '@backstage/backend-plugin-api';\nimport { json, Router } from 'express';\nimport { McpService } from './services/McpService';\nimport { createStreamableRouter } from './routers/createStreamableRouter';\nimport { createSseRouter } from './routers/createSseRouter';\nimport {\n actionsRegistryServiceRef,\n actionsServiceRef,\n} from '@backstage/backend-plugin-api/alpha';\n\n/**\n * mcpPlugin backend plugin\n *\n * @public\n */\nexport const mcpPlugin = createBackendPlugin({\n pluginId: 'mcp-actions',\n register(env) {\n env.registerInit({\n deps: {\n logger: coreServices.logger,\n auth: coreServices.auth,\n httpAuth: coreServices.httpAuth,\n httpRouter: coreServices.httpRouter,\n actions: actionsServiceRef,\n registry: actionsRegistryServiceRef,\n },\n async init({ actions, logger, httpRouter, httpAuth }) {\n const mcpService = await McpService.create({\n actions,\n });\n\n const sseRouter = createSseRouter({\n mcpService,\n httpAuth,\n });\n\n const streamableRouter = createStreamableRouter({\n mcpService,\n httpAuth,\n logger,\n });\n\n const router = Router();\n router.use(json());\n\n router.use('/v1/sse', sseRouter);\n router.use('/v1', streamableRouter);\n\n httpRouter.use(router);\n },\n });\n },\n});\n"],"names":["createBackendPlugin","coreServices","actionsServiceRef","actionsRegistryServiceRef","McpService","createSseRouter","createStreamableRouter","Router","json"],"mappings":";;;;;;;;;AAiCO,MAAM,YAAYA,oCAAA,CAAoB;AAAA,EAC3C,QAAA,EAAU,aAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,QAAQC,6BAAA,CAAa,MAAA;AAAA,QACrB,MAAMA,6BAAA,CAAa,IAAA;AAAA,QACnB,UAAUA,6BAAA,CAAa,QAAA;AAAA,QACvB,YAAYA,6BAAA,CAAa,UAAA;AAAA,QACzB,OAAA,EAASC,uBAAA;AAAA,QACT,QAAA,EAAUC;AAAA,OACZ;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,SAAS,MAAA,EAAQ,UAAA,EAAY,UAAS,EAAG;AACpD,QAAA,MAAM,UAAA,GAAa,MAAMC,qBAAA,CAAW,MAAA,CAAO;AAAA,UACzC;AAAA,SACD,CAAA;AAED,QAAA,MAAM,YAAYC,+BAAA,CAAgB;AAAA,UAChC,UAAA;AAAA,UACA;AAAA,SACD,CAAA;AAED,QAAA,MAAM,mBAAmBC,6CAAA,CAAuB;AAAA,UAC9C,UAAA;AAAA,UACA,QAAA;AAAA,UACA;AAAA,SACD,CAAA;AAED,QAAA,MAAM,SAASC,cAAA,EAAO;AACtB,QAAA,MAAA,CAAO,GAAA,CAAIC,cAAM,CAAA;AAEjB,QAAA,MAAA,CAAO,GAAA,CAAI,WAAW,SAAS,CAAA;AAC/B,QAAA,MAAA,CAAO,GAAA,CAAI,OAAO,gBAAgB,CAAA;AAElC,QAAA,UAAA,CAAW,IAAI,MAAM,CAAA;AAAA,MACvB;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendPlugin,\n} from '@backstage/backend-plugin-api';\nimport { json } from 'express';\nimport Router from 'express-promise-router';\nimport { McpService } from './services/McpService';\nimport { createStreamableRouter } from './routers/createStreamableRouter';\nimport { createSseRouter } from './routers/createSseRouter';\nimport {\n actionsRegistryServiceRef,\n actionsServiceRef,\n} from '@backstage/backend-plugin-api/alpha';\n\n/**\n * mcpPlugin backend plugin\n *\n * @public\n */\nexport const mcpPlugin = createBackendPlugin({\n pluginId: 'mcp-actions',\n register(env) {\n env.registerInit({\n deps: {\n logger: coreServices.logger,\n auth: coreServices.auth,\n httpAuth: coreServices.httpAuth,\n httpRouter: coreServices.httpRouter,\n actions: actionsServiceRef,\n registry: actionsRegistryServiceRef,\n rootRouter: coreServices.rootHttpRouter,\n discovery: coreServices.discovery,\n config: coreServices.rootConfig,\n },\n async init({\n actions,\n logger,\n httpRouter,\n httpAuth,\n rootRouter,\n discovery,\n config,\n }) {\n const mcpService = await McpService.create({\n actions,\n });\n\n const sseRouter = createSseRouter({\n mcpService,\n httpAuth,\n });\n\n const streamableRouter = createStreamableRouter({\n mcpService,\n httpAuth,\n logger,\n });\n\n const router = Router();\n router.use(json());\n\n router.use('/v1/sse', sseRouter);\n router.use('/v1', streamableRouter);\n\n httpRouter.use(router);\n\n if (\n config.getOptionalBoolean(\n 'auth.experimentalDynamicClientRegistration.enabled',\n )\n ) {\n // This should be replaced with throwing a WWW-Authenticate header, but that doesn't seem to be supported by\n // many of the MCP client as of yet. So this seems to be the oldest version of the spec thats implemented.\n rootRouter.use(\n '/.well-known/oauth-authorization-server',\n async (_, res) => {\n const authBaseUrl = await discovery.getBaseUrl('auth');\n const oidcResponse = await fetch(\n `${authBaseUrl}/.well-known/openid-configuration`,\n );\n\n res.json(await oidcResponse.json());\n },\n );\n }\n },\n });\n },\n});\n"],"names":["createBackendPlugin","coreServices","actionsServiceRef","actionsRegistryServiceRef","McpService","createSseRouter","createStreamableRouter","Router","json"],"mappings":";;;;;;;;;;;;;;AAkCO,MAAM,YAAYA,oCAAA,CAAoB;AAAA,EAC3C,QAAA,EAAU,aAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,QAAQC,6BAAA,CAAa,MAAA;AAAA,QACrB,MAAMA,6BAAA,CAAa,IAAA;AAAA,QACnB,UAAUA,6BAAA,CAAa,QAAA;AAAA,QACvB,YAAYA,6BAAA,CAAa,UAAA;AAAA,QACzB,OAAA,EAASC,uBAAA;AAAA,QACT,QAAA,EAAUC,+BAAA;AAAA,QACV,YAAYF,6BAAA,CAAa,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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-mcp-actions-backend",
3
- "version": "0.1.3-next.0",
3
+ "version": "0.1.3-next.1",
4
4
  "backstage": {
5
5
  "role": "backend-plugin",
6
6
  "pluginId": "mcp-actions",
@@ -37,11 +37,11 @@
37
37
  "test": "backstage-cli package test"
38
38
  },
39
39
  "dependencies": {
40
- "@backstage/backend-defaults": "0.12.1-next.0",
40
+ "@backstage/backend-defaults": "0.12.1-next.1",
41
41
  "@backstage/backend-plugin-api": "1.4.3-next.0",
42
- "@backstage/catalog-client": "1.11.0",
42
+ "@backstage/catalog-client": "1.12.0-next.0",
43
43
  "@backstage/errors": "1.2.7",
44
- "@backstage/plugin-catalog-node": "1.18.1-next.0",
44
+ "@backstage/plugin-catalog-node": "1.19.0-next.1",
45
45
  "@backstage/types": "1.2.1",
46
46
  "@modelcontextprotocol/sdk": "^1.12.3",
47
47
  "express": "^4.17.1",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@backstage/backend-test-utils": "1.9.0-next.1",
53
- "@backstage/cli": "0.34.2-next.1",
53
+ "@backstage/cli": "0.34.2-next.2",
54
54
  "@types/express": "^4.17.6"
55
55
  },
56
56
  "typesVersions": {