From 398f9e9245d718d67655d1f09e2b208e1874c65c Mon Sep 17 00:00:00 2001 From: benjdlambert Date: Tue, 17 Jun 2025 09:22:16 +0200 Subject: [PATCH] chore: update api reports and fix some code review comments Signed-off-by: benjdlambert --- plugins/mcp-backend/report.api.md | 13 +++++++++++++ plugins/mcp-backend/src/index.ts | 2 +- plugins/mcp-backend/src/routers/createSseRouter.ts | 7 ++++--- .../src/routers/createStreamableRouter.ts | 3 ++- 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 plugins/mcp-backend/report.api.md diff --git a/plugins/mcp-backend/report.api.md b/plugins/mcp-backend/report.api.md new file mode 100644 index 0000000000..5df9a077c6 --- /dev/null +++ b/plugins/mcp-backend/report.api.md @@ -0,0 +1,13 @@ +## API Report File for "@backstage/plugin-mcp-backend" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; + +// @public +const mcpPlugin: BackendFeature; +export default mcpPlugin; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/mcp-backend/src/index.ts b/plugins/mcp-backend/src/index.ts index 9216a19c0c..75fa097c85 100644 --- a/plugins/mcp-backend/src/index.ts +++ b/plugins/mcp-backend/src/index.ts @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { mcpPlugin } from './plugin'; +export { mcpPlugin as default } from './plugin'; diff --git a/plugins/mcp-backend/src/routers/createSseRouter.ts b/plugins/mcp-backend/src/routers/createSseRouter.ts index 05339b3844..64aa363416 100644 --- a/plugins/mcp-backend/src/routers/createSseRouter.ts +++ b/plugins/mcp-backend/src/routers/createSseRouter.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Router from 'express-promise-router'; +import PromiseRouter from 'express-promise-router'; +import { Router } from 'express'; import { McpService } from '../services/McpService'; import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'; import { HttpAuthService } from '@backstage/backend-plugin-api'; @@ -27,8 +28,8 @@ export const createSseRouter = ({ }: { mcpService: McpService; httpAuth: HttpAuthService; -}) => { - const router = Router(); +}): Router => { + const router = PromiseRouter(); const transportsToSessionId = new Map(); router.get('/', async (req, res) => { diff --git a/plugins/mcp-backend/src/routers/createStreamableRouter.ts b/plugins/mcp-backend/src/routers/createStreamableRouter.ts index f373106ce2..9d6fd1840b 100644 --- a/plugins/mcp-backend/src/routers/createStreamableRouter.ts +++ b/plugins/mcp-backend/src/routers/createStreamableRouter.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import PromiseRouter from 'express-promise-router'; import { Router } from 'express'; import { McpService } from '../services/McpService'; import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; @@ -28,7 +29,7 @@ export const createStreamableRouter = ({ logger: LoggerService; httpAuth: HttpAuthService; }): Router => { - const router = Router(); + const router = PromiseRouter(); router.post('/', async (req, res) => { try {