mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
chore: Upgrade MCP SDK to v2 for 2026-07-28 protocol support (#14244)
* chore: Upgrade MCP SDK to v2 for 2026-07-28 protocol support * test: Assert JSON replies for 2026-07-28 requests
This commit is contained in:
1 parent
0995a8e36b
commit
d98d8bdb1f
16 files changed
+272
-493
No files matched your search
+1
-1
@@ -84,7 +84,7 @@
|
||||
"@koa/router": "^15.7.0",
|
||||
"@koa/send": "^6.0.0",
|
||||
"@linear/sdk": "^97.0.0",
|
||||
"@modelcontextprotocol/sdk": "^1.32.1",
|
||||
"@modelcontextprotocol/server": "^2.3.1",
|
||||
"@noble/hashes": "^2.4.0",
|
||||
"@node-oauth/oauth2-server": "^5.3.0",
|
||||
"@notionhq/client": "^2.3.0",
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { McpServer } from "@modelcontextprotocol/server";
|
||||
import { iconNames } from "@shared/utils/IconNames";
|
||||
import { attachmentTools } from "./tools/attachments";
|
||||
import { collectionTools } from "./tools/collections";
|
||||
|
||||
+35
-30
@@ -4,8 +4,11 @@ import path from "node:path";
|
||||
import yaml from "js-yaml";
|
||||
import mime from "mime-types";
|
||||
import { z } from "zod";
|
||||
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
|
||||
import {
|
||||
type McpServer,
|
||||
ProtocolError,
|
||||
ProtocolErrorCode,
|
||||
} from "@modelcontextprotocol/server";
|
||||
|
||||
/** The identifier of the MCP skills extension (SEP-2640). */
|
||||
export const skillsExtensionId = "io.modelcontextprotocol/skills";
|
||||
@@ -51,29 +54,37 @@ export function skillResources(server: McpServer) {
|
||||
}
|
||||
}
|
||||
|
||||
server.server.setRequestHandler(ListSkillsRequestSchema, () => ({
|
||||
resultType: "complete",
|
||||
skills: skills.map(presentSkill),
|
||||
ttlMs: cacheTtlMs,
|
||||
cacheScope: "public",
|
||||
}));
|
||||
|
||||
server.server.setRequestHandler(GetSkillRequestSchema, (request) => {
|
||||
const skill = skills.find((s) => s.uri === request.params.uri);
|
||||
if (!skill) {
|
||||
throw new McpError(
|
||||
ErrorCode.InvalidParams,
|
||||
`No skill is served at ${request.params.uri}`
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
server.server.setRequestHandler(
|
||||
"skills/list",
|
||||
{ params: ListSkillsParamsSchema },
|
||||
() => ({
|
||||
resultType: "complete",
|
||||
skill: presentSkill(skill),
|
||||
skills: skills.map(presentSkill),
|
||||
ttlMs: cacheTtlMs,
|
||||
cacheScope: "public",
|
||||
};
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
server.server.setRequestHandler(
|
||||
"skills/get",
|
||||
{ params: GetSkillParamsSchema },
|
||||
({ uri }) => {
|
||||
const skill = skills.find((s) => s.uri === uri);
|
||||
if (!skill) {
|
||||
throw new ProtocolError(
|
||||
ProtocolErrorCode.InvalidParams,
|
||||
`No skill is served at ${uri}`
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
resultType: "complete",
|
||||
skill: presentSkill(skill),
|
||||
ttlMs: cacheTtlMs,
|
||||
cacheScope: "public",
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
interface SkillFile {
|
||||
@@ -102,15 +113,9 @@ const FrontmatterSchema = z.looseObject({
|
||||
|
||||
type SkillFrontmatter = z.infer<typeof FrontmatterSchema>;
|
||||
|
||||
const ListSkillsRequestSchema = z.object({
|
||||
method: z.literal("skills/list"),
|
||||
params: z.object({ cursor: z.string().optional() }).optional(),
|
||||
});
|
||||
const ListSkillsParamsSchema = z.object({ cursor: z.string().optional() });
|
||||
|
||||
const GetSkillRequestSchema = z.object({
|
||||
method: z.literal("skills/get"),
|
||||
params: z.object({ uri: z.string() }),
|
||||
});
|
||||
const GetSkillParamsSchema = z.object({ uri: z.string() });
|
||||
|
||||
let cachedSkills: Skill[] | undefined;
|
||||
|
||||
|
||||
@@ -88,6 +88,6 @@ describe("create_attachment", () => {
|
||||
size: 1000,
|
||||
}
|
||||
);
|
||||
expect(res?.result?.isError).toBe(true);
|
||||
expect(res?.error).toMatchObject({ code: -32602 });
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import { randomUUID } from "crypto";
|
||||
import { z } from "zod";
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import type { McpServer } from "@modelcontextprotocol/server";
|
||||
import env from "@server/env";
|
||||
import { InvalidRequestError, ValidationError } from "@server/errors";
|
||||
import { Attachment, Team } from "@server/models";
|
||||
@@ -38,7 +38,7 @@ export function attachmentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
contentType: z
|
||||
.string()
|
||||
.describe("The MIME type of the file, e.g. image/png, image/jpeg."),
|
||||
@@ -51,7 +51,7 @@ export function attachmentTools(server: McpServer, scopes: string[]) {
|
||||
.nonnegative()
|
||||
.finite()
|
||||
.describe("The file size in bytes."),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"create_attachment",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod";
|
||||
import { Sequelize, Op, type WhereOptions } from "sequelize";
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import type { McpServer } from "@modelcontextprotocol/server";
|
||||
import { Collection, Team } from "@server/models";
|
||||
import { buildWhere } from "@server/models/helpers/Filters";
|
||||
import { sequelize } from "@server/storage/database";
|
||||
@@ -57,7 +57,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: true,
|
||||
readOnlyHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
query: optionalString().describe(
|
||||
"An optional search query to filter collections by name."
|
||||
),
|
||||
@@ -76,7 +76,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"The maximum number of results to return. Defaults to 25, max 100."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"list_collections",
|
||||
@@ -178,7 +178,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
name: z.string().describe("The name of the collection."),
|
||||
description: z
|
||||
.string()
|
||||
@@ -190,7 +190,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
color: optionalString().describe(
|
||||
"The hex color for the collection icon, e.g. #FF0000."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("create_collection", async (input, context) => {
|
||||
try {
|
||||
@@ -239,7 +239,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the collection to update."),
|
||||
@@ -262,7 +262,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"The hex color for the collection icon. Set to null to remove."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("update_collection", async (input, context) => {
|
||||
try {
|
||||
@@ -326,7 +326,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the collection to delete."),
|
||||
@@ -344,7 +344,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"A plain text reason for archiving or deleting the collection. Omit to keep the existing reason, or use null or an empty string to clear it."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"delete_collection",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { v4 as uuidv4 } from "uuid";
|
||||
import { z } from "zod";
|
||||
import { Transaction } from "sequelize";
|
||||
import { sequelize } from "@server/storage/database";
|
||||
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import type { McpServer } from "@modelcontextprotocol/server";
|
||||
import { CommentStatusFilter } from "@shared/types";
|
||||
import { commentParser } from "@server/editor";
|
||||
import { DocumentHelper } from "@server/models/helpers/DocumentHelper";
|
||||
@@ -58,7 +58,7 @@ export function commentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: true,
|
||||
readOnlyHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
documentId: optionalString().describe(
|
||||
"The document ID to list comments for."
|
||||
),
|
||||
@@ -89,7 +89,7 @@ export function commentTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"The maximum number of results to return. Defaults to 25, max 100."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"list_comments",
|
||||
@@ -153,7 +153,7 @@ export function commentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
documentId: z.string().describe("The document ID to comment on."),
|
||||
text: z
|
||||
.string()
|
||||
@@ -170,7 +170,7 @@ export function commentTools(server: McpServer, scopes: string[]) {
|
||||
anchorSuffix: optionalString().describe(
|
||||
"Only provide this if anchorText appears more than once in the document and you need to target a specific occurrence. Plain text that immediately follows anchorText."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"create_comment",
|
||||
@@ -271,7 +271,7 @@ export function commentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the comment to update."),
|
||||
@@ -285,7 +285,7 @@ export function commentTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"Set to 'resolved' to resolve or 'unresolved' to unresolve a top-level comment thread."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("update_comment", async ({ id, text, status }, context) => {
|
||||
try {
|
||||
@@ -355,11 +355,11 @@ export function commentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the comment to delete."),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("delete_comment", async ({ id }, context) => {
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { z } from "zod";
|
||||
import { PersonalCollectionId } from "@shared/constants";
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { type CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
||||
import type { McpServer, CallToolResult } from "@modelcontextprotocol/server";
|
||||
import documentCreator, {
|
||||
authorizeDocumentCreate,
|
||||
authorizeDocumentPublish,
|
||||
@@ -81,7 +80,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: true,
|
||||
readOnlyHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
query: optionalString().describe(
|
||||
"A search query to find documents by content or title. When omitted, returns recent documents."
|
||||
),
|
||||
@@ -109,7 +108,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"The maximum number of results to return. Defaults to 25, max 100."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"list_documents",
|
||||
@@ -330,13 +329,13 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: true,
|
||||
readOnlyHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
collectionId: z
|
||||
.string()
|
||||
.describe(
|
||||
"The ID of the collection whose document tree to return."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"list_collection_documents",
|
||||
@@ -375,7 +374,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
title: optionalString().describe(
|
||||
"The title of the document. Defaults to the template's title when a templateId is provided."
|
||||
),
|
||||
@@ -421,7 +420,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"Whether the document should occupy full width of the screen. Defaults to false. Do not set this to true for HTML input unless the user explicitly asks for a full-width document layout."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("create_document", async (input, context) => {
|
||||
try {
|
||||
@@ -516,7 +515,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the document to move."),
|
||||
@@ -534,7 +533,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"The zero-based position to insert the document among its siblings. Use this to reorder documents within the same collection and parent. Omit to place at the end."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("move_document", async (input, context) => {
|
||||
try {
|
||||
@@ -628,7 +627,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the document to update."),
|
||||
@@ -677,7 +676,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"Whether the document should occupy full width of the screen."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("update_document", async (input, context) => {
|
||||
try {
|
||||
@@ -794,7 +793,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the document to delete."),
|
||||
@@ -812,7 +811,7 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"A plain text reason for archiving or deleting the document. Omit to keep the existing reason, or use null or an empty string to clear it."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"delete_document",
|
||||
@@ -864,14 +863,14 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: false,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
id: z
|
||||
.string()
|
||||
.describe("The unique identifier of the document to restore."),
|
||||
collectionId: optionalString().describe(
|
||||
"The collection to restore the document into. Defaults to its original collection."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("restore_document", async ({ id, collectionId }, context) => {
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { type CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
||||
import type { McpServer, CallToolResult } from "@modelcontextprotocol/server";
|
||||
import {
|
||||
Attachment,
|
||||
Collection,
|
||||
@@ -107,14 +106,14 @@ export function fetchTool(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: true,
|
||||
readOnlyHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
resource: z.enum(allowedTypes).describe("The resource to fetch."),
|
||||
id: z
|
||||
.string()
|
||||
.describe(
|
||||
'The unique identifier or URL. For users, "current_user" returns the authenticated user.'
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing("fetch", async ({ resource, id: rawId }, extra) => {
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import type { McpServer } from "@modelcontextprotocol/server";
|
||||
import { Op } from "sequelize";
|
||||
import type { WhereOptions } from "sequelize";
|
||||
import { Collection, Template } from "@server/models";
|
||||
@@ -57,7 +57,7 @@ export function templateTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: true,
|
||||
readOnlyHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
collectionId: optionalString().describe(
|
||||
"A collection ID to filter templates by. Omit to include workspace-wide templates and templates from all accessible collections."
|
||||
),
|
||||
@@ -76,7 +76,7 @@ export function templateTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"The maximum number of results to return. Defaults to 25, max 100."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"list_templates",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { z } from "zod";
|
||||
import { Op, Sequelize } from "sequelize";
|
||||
import type { WhereOptions } from "sequelize";
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import type { McpServer } from "@modelcontextprotocol/server";
|
||||
import { UserRole } from "@shared/types";
|
||||
import { User, Team } from "@server/models";
|
||||
import { authorize, can } from "@server/policies";
|
||||
@@ -34,7 +34,7 @@ export function userTools(server: McpServer, scopes: string[]) {
|
||||
idempotentHint: true,
|
||||
readOnlyHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
inputSchema: z.object({
|
||||
query: optionalString().describe(
|
||||
"An optional search query to filter users by name or email."
|
||||
),
|
||||
@@ -68,7 +68,7 @@ export function userTools(server: McpServer, scopes: string[]) {
|
||||
.describe(
|
||||
"The maximum number of results to return. Defaults to 25, max 100."
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
withTracing(
|
||||
"list_users",
|
||||
|
||||
+6
-7
@@ -1,5 +1,4 @@
|
||||
import type { AuthInfo } from "@modelcontextprotocol/sdk/server/auth/types.js";
|
||||
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
||||
import type { AuthInfo, CallToolResult } from "@modelcontextprotocol/server";
|
||||
import { z } from "zod";
|
||||
import { errToString } from "@shared/utils/error";
|
||||
import env from "@server/env";
|
||||
@@ -11,7 +10,7 @@ import { type APIContext, AuthenticationType } from "@server/types";
|
||||
import type { NavigationNode } from "@shared/types";
|
||||
|
||||
interface McpContext {
|
||||
authInfo?: AuthInfo;
|
||||
http?: { authInfo?: AuthInfo };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,7 +20,7 @@ interface McpContext {
|
||||
* @returns the authenticated user.
|
||||
*/
|
||||
export function getActorFromContext(context: McpContext) {
|
||||
return context.authInfo?.extra?.user as User;
|
||||
return context.http?.authInfo?.extra?.user as User;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,9 +31,9 @@ export function getActorFromContext(context: McpContext) {
|
||||
* @returns a partial APIContext suitable for command functions.
|
||||
*/
|
||||
export function buildAPIContext(context: McpContext) {
|
||||
const user = context.authInfo?.extra?.user as User;
|
||||
const token = context.authInfo?.token ?? "";
|
||||
const ip = context.authInfo?.extra?.ip as string | undefined;
|
||||
const user = context.http?.authInfo?.extra?.user as User;
|
||||
const token = context.http?.authInfo?.token ?? "";
|
||||
const ip = context.http?.authInfo?.extra?.ip as string | undefined;
|
||||
|
||||
const auth = {
|
||||
user,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { Scope, TeamPreference } from "@shared/types";
|
||||
import { iconNames } from "@shared/utils/IconNames";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { UserFlag } from "@server/models/User";
|
||||
import {
|
||||
buildUser,
|
||||
@@ -104,20 +103,32 @@ describe("POST /mcp/", () => {
|
||||
expect(res.status).toEqual(404);
|
||||
});
|
||||
|
||||
it("should reject an unsupported protocol version without logging", async () => {
|
||||
const { accessToken } = await buildOAuthUser();
|
||||
const warn = vi.spyOn(Logger, "warn");
|
||||
const { body } = mcpRequest("server/discover");
|
||||
it("should call a tool with a 2026-07-28 request", async () => {
|
||||
const { user, accessToken } = await buildOAuthUser();
|
||||
const collection = await buildCollection({
|
||||
teamId: user.teamId,
|
||||
userId: user.id,
|
||||
});
|
||||
const { body } = mcpRequest("tools/call", {
|
||||
name: "list_collections",
|
||||
arguments: {},
|
||||
_meta: modernMeta("2026-07-28"),
|
||||
});
|
||||
const res = await server.post("/mcp/", {
|
||||
headers: {
|
||||
...mcpHeaders(accessToken),
|
||||
"MCP-Protocol-Version": "2026-07-28",
|
||||
"Mcp-Method": "tools/call",
|
||||
"Mcp-Name": "list_collections",
|
||||
},
|
||||
body,
|
||||
});
|
||||
expect(res.status).toEqual(400);
|
||||
expect(warn).not.toHaveBeenCalled();
|
||||
warn.mockRestore();
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers.get("content-type")).toContain("application/json");
|
||||
|
||||
const parsed = await parseMcpResponse(res);
|
||||
const result = parsed?.result as { content?: { text: string }[] };
|
||||
expect(result?.content?.[0]?.text).toContain(collection.id);
|
||||
});
|
||||
|
||||
it("should handle initialize and return capabilities", async () => {
|
||||
@@ -412,7 +423,7 @@ describe("POST /mcp/", () => {
|
||||
const res = await callMcpTool(server, accessToken, "create_document", {
|
||||
title: "Should Fail",
|
||||
});
|
||||
expect(res?.result?.isError).toBe(true);
|
||||
expect(res?.error).toMatchObject({ code: -32602 });
|
||||
});
|
||||
|
||||
it("read-only token does not have update_document tool", async () => {
|
||||
@@ -431,7 +442,7 @@ describe("POST /mcp/", () => {
|
||||
id: document.id,
|
||||
title: "Should Fail",
|
||||
});
|
||||
expect(res?.result?.isError).toBe(true);
|
||||
expect(res?.error).toMatchObject({ code: -32602 });
|
||||
});
|
||||
|
||||
it("read-only token does not have delete_comment tool", async () => {
|
||||
@@ -453,7 +464,7 @@ describe("POST /mcp/", () => {
|
||||
const res = await callMcpTool(server, accessToken, "delete_comment", {
|
||||
id: comment.id,
|
||||
});
|
||||
expect(res?.result?.isError).toBe(true);
|
||||
expect(res?.error).toMatchObject({ code: -32602 });
|
||||
});
|
||||
|
||||
it("create-scoped token can call create_document", async () => {
|
||||
@@ -489,7 +500,7 @@ describe("POST /mcp/", () => {
|
||||
id: document.id,
|
||||
title: "Should Fail",
|
||||
});
|
||||
expect(res?.result?.isError).toBe(true);
|
||||
expect(res?.error).toMatchObject({ code: -32602 });
|
||||
});
|
||||
|
||||
it("write-scoped token can call all operations", async () => {
|
||||
@@ -535,3 +546,20 @@ describe("POST /mcp/", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Builds the per-request `_meta` envelope of a 2026-07-28 request.
|
||||
*
|
||||
* @param protocolVersion - the protocol version to claim.
|
||||
* @returns the envelope.
|
||||
*/
|
||||
function modernMeta(protocolVersion: string) {
|
||||
return {
|
||||
"io.modelcontextprotocol/protocolVersion": protocolVersion,
|
||||
"io.modelcontextprotocol/clientInfo": {
|
||||
name: "test-client",
|
||||
version: "1.0.0",
|
||||
},
|
||||
"io.modelcontextprotocol/clientCapabilities": {},
|
||||
};
|
||||
}
|
||||
+101
-51
@@ -1,9 +1,13 @@
|
||||
import Koa from "koa";
|
||||
import bodyParser from "koa-body";
|
||||
import Router from "@koa/router";
|
||||
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
||||
import type { AuthInfo } from "@modelcontextprotocol/sdk/server/auth/types.js";
|
||||
import { ErrorCode } from "@modelcontextprotocol/sdk/types.js";
|
||||
import { Readable } from "node:stream";
|
||||
import type { Context } from "koa";
|
||||
import {
|
||||
createMcpHandler,
|
||||
type McpServerFactory,
|
||||
ProtocolErrorCode,
|
||||
} from "@modelcontextprotocol/server";
|
||||
import { toError } from "@shared/utils/error";
|
||||
import { TeamPreference } from "@shared/types";
|
||||
import { NotFoundError } from "@server/errors";
|
||||
@@ -12,6 +16,7 @@ import { createMcpServer } from "@server/mcp";
|
||||
import auth from "@server/middlewares/authentication";
|
||||
import { rateLimiter } from "@server/middlewares/rateLimiter";
|
||||
import requestTracer from "@server/middlewares/requestTracer";
|
||||
import type { User } from "@server/models";
|
||||
import { UserFlag } from "@server/models/User";
|
||||
import { AuthenticationType } from "@server/types";
|
||||
import { OAuthHelper } from "@server/utils/oauth/OAuthHelper";
|
||||
@@ -20,6 +25,69 @@ import { RateLimiterStrategy } from "@server/utils/RateLimiter";
|
||||
const app = new Koa();
|
||||
const router = new Router();
|
||||
|
||||
interface McpAuthExtra {
|
||||
user: User;
|
||||
scope: string[];
|
||||
ip: string;
|
||||
origin: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports transport errors. These are client-side 4xx conditions (bad Accept
|
||||
* header, etc) that the SDK already answers, so warn keeps visibility without
|
||||
* reporting client mistakes to Sentry.
|
||||
*
|
||||
* @param error - the error to report.
|
||||
*/
|
||||
function handleTransportError(error: Error) {
|
||||
// Clients probe with their latest version and fall back on this error.
|
||||
if (error.message.includes("Unsupported protocol version")) {
|
||||
return;
|
||||
}
|
||||
Logger.warn("MCP transport error", error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a fresh MCP server for one request, from the auth info set by the route.
|
||||
*
|
||||
* @param context - the request context with the auth info.
|
||||
* @returns a configured MCP server.
|
||||
*/
|
||||
const createServer: McpServerFactory = ({ authInfo }) => {
|
||||
const extra = authInfo?.extra as McpAuthExtra | undefined;
|
||||
if (!extra) {
|
||||
throw new Error("MCP request is missing auth info");
|
||||
}
|
||||
return createMcpServer(
|
||||
extra.origin,
|
||||
extra.scope,
|
||||
extra.user.team.guidanceMCP ?? undefined
|
||||
);
|
||||
};
|
||||
|
||||
// Plain JSON replies, which reverse proxies handle more reliably than SSE.
|
||||
const mcpHandler = createMcpHandler(createServer, {
|
||||
responseMode: "json",
|
||||
onerror: handleTransportError,
|
||||
});
|
||||
|
||||
/**
|
||||
* Converts the Koa request to a web request. The body is not copied, as the
|
||||
* SDK reads the parsed body instead.
|
||||
*
|
||||
* @param ctx - the Koa context.
|
||||
* @returns the web request.
|
||||
*/
|
||||
function toWebRequest(ctx: Context): Request {
|
||||
const headers = new Headers();
|
||||
for (const [key, value] of Object.entries(ctx.req.headers)) {
|
||||
for (const item of Array.isArray(value) ? value : [value ?? ""]) {
|
||||
headers.append(key, item);
|
||||
}
|
||||
}
|
||||
return new Request(ctx.request.URL, { method: ctx.method, headers });
|
||||
}
|
||||
|
||||
// RFC 9728 / MCP auth spec: 401 responses from the /mcp endpoint must include
|
||||
// a WWW-Authenticate header pointing at the OAuth protected resource metadata
|
||||
// document, and the scopes to request, so clients can bootstrap authorization.
|
||||
@@ -70,43 +138,31 @@ router.post(
|
||||
user.setFlag(UserFlag.MCP);
|
||||
await user.save({ hooks: false });
|
||||
|
||||
const server = createMcpServer(
|
||||
OAuthHelper.getIssuer(ctx),
|
||||
scope ?? [],
|
||||
user.team.guidanceMCP ?? undefined
|
||||
);
|
||||
const transport = new StreamableHTTPServerTransport({
|
||||
sessionIdGenerator: undefined,
|
||||
});
|
||||
|
||||
// onerror fires for client-side 4xx conditions (bad Accept header, etc)
|
||||
// which the transport already answers with an HTTP error — warn keeps
|
||||
// visibility without reporting client mistakes to Sentry.
|
||||
transport.onerror = (error) => {
|
||||
// Newer clients probe with their latest version and fall back on this 400.
|
||||
if (error.message.includes("Unsupported protocol version")) {
|
||||
return;
|
||||
}
|
||||
Logger.warn("MCP transport error", error);
|
||||
const extra: McpAuthExtra = {
|
||||
user,
|
||||
scope: scope ?? [],
|
||||
ip: ctx.request.ip,
|
||||
origin: OAuthHelper.getIssuer(ctx),
|
||||
};
|
||||
|
||||
await server.connect(transport);
|
||||
|
||||
// Attach auth info to the raw request so the MCP transport
|
||||
// passes it through as `extra.authInfo` to tool handlers.
|
||||
(ctx.req as typeof ctx.req & { auth: AuthInfo }).auth = {
|
||||
token,
|
||||
clientId: "",
|
||||
scopes: scope ?? [],
|
||||
extra: { user, scope: scope ?? [], ip: ctx.request.ip },
|
||||
const options = {
|
||||
authInfo: {
|
||||
token,
|
||||
clientId: "",
|
||||
scopes: scope ?? [],
|
||||
extra: { ...extra },
|
||||
},
|
||||
parsedBody: ctx.request.body,
|
||||
};
|
||||
const request = toWebRequest(ctx);
|
||||
|
||||
ctx.respond = false;
|
||||
|
||||
// The SDK's handleRequest answers known protocol failures itself (4xx with a
|
||||
// JSON-RPC body) via the transport. Anything that escapes here is unexpected.
|
||||
// The SDK answers known protocol failures itself with a 4xx and a
|
||||
// JSON-RPC body. Anything that escapes here is unexpected.
|
||||
try {
|
||||
await transport.handleRequest(ctx.req, ctx.res, ctx.request.body);
|
||||
const response = await mcpHandler.fetch(request, options);
|
||||
|
||||
ctx.status = response.status;
|
||||
response.headers.forEach((value, key) => ctx.set(key, value));
|
||||
ctx.body = response.body ? Readable.from(response.body) : "";
|
||||
} catch (error) {
|
||||
Logger.error(
|
||||
"MCP request handling failed",
|
||||
@@ -115,21 +171,15 @@ router.post(
|
||||
ctx.req
|
||||
);
|
||||
|
||||
if (!ctx.res.headersSent) {
|
||||
ctx.res.writeHead(500, { "Content-Type": "application/json" });
|
||||
ctx.res.end(
|
||||
JSON.stringify({
|
||||
jsonrpc: "2.0",
|
||||
error: {
|
||||
code: ErrorCode.InternalError,
|
||||
message: "Internal server error",
|
||||
},
|
||||
id: null,
|
||||
})
|
||||
);
|
||||
} else {
|
||||
ctx.res.end();
|
||||
}
|
||||
ctx.status = 500;
|
||||
ctx.body = {
|
||||
jsonrpc: "2.0",
|
||||
error: {
|
||||
code: ProtocolErrorCode.InternalError,
|
||||
message: "Internal server error",
|
||||
},
|
||||
id: null,
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -60,9 +60,8 @@ export function mcpRequest(method: string, params?: Record<string, unknown>) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses an MCP HTTP response. The transport responds with
|
||||
* `text/event-stream` (SSE). This helper extracts the JSON-RPC response
|
||||
* from the SSE data lines.
|
||||
* Parses an MCP HTTP response, either a JSON body or the data lines of a
|
||||
* `text/event-stream` (SSE) body.
|
||||
*
|
||||
* @param res - the node-fetch Response from TestServer.
|
||||
* @returns the parsed JSON-RPC result object.
|
||||
|
||||
@@ -2285,15 +2285,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@hono/node-server@npm:^1.19.9 || ^2.0.5":
|
||||
version: 2.1.3
|
||||
resolution: "@hono/node-server@npm:2.1.3"
|
||||
peerDependencies:
|
||||
hono: ^4
|
||||
checksum: 10c0/1b9996f41be620c301f73529928ccb056574fadf822a0979e4925c17cce209583e7f27376ae2308b4e87ab6c1c7501d6f282333c364ed79f21b99b45b47f7ffb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@httptoolkit/websocket-stream@npm:^6.0.1":
|
||||
version: 6.0.1
|
||||
resolution: "@httptoolkit/websocket-stream@npm:6.0.1"
|
||||
@@ -2706,36 +2697,22 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@modelcontextprotocol/sdk@npm:^1.32.1":
|
||||
version: 1.32.1
|
||||
resolution: "@modelcontextprotocol/sdk@npm:1.32.1"
|
||||
"@modelcontextprotocol/core@npm:2.3.1":
|
||||
version: 2.3.1
|
||||
resolution: "@modelcontextprotocol/core@npm:2.3.1"
|
||||
dependencies:
|
||||
"@hono/node-server": "npm:^1.19.9 || ^2.0.5"
|
||||
ajv: "npm:^8.17.1"
|
||||
ajv-formats: "npm:^3.0.1"
|
||||
content-type: "npm:^1.0.5"
|
||||
cors: "npm:^2.8.5"
|
||||
cross-spawn: "npm:^7.0.5"
|
||||
eventsource: "npm:^3.0.2"
|
||||
eventsource-parser: "npm:^3.0.0"
|
||||
express: "npm:^5.2.1"
|
||||
express-rate-limit: "npm:^8.2.1"
|
||||
hono: "npm:^4.11.4"
|
||||
jose: "npm:^6.1.3"
|
||||
json-schema-typed: "npm:^8.0.2"
|
||||
pkce-challenge: "npm:^5.0.0"
|
||||
raw-body: "npm:^3.0.0"
|
||||
zod: "npm:^3.25 || ^4.0"
|
||||
zod-to-json-schema: "npm:^3.25.1"
|
||||
peerDependencies:
|
||||
"@cfworker/json-schema": ^4.1.1
|
||||
zod: ^3.25 || ^4.0
|
||||
peerDependenciesMeta:
|
||||
"@cfworker/json-schema":
|
||||
optional: true
|
||||
zod:
|
||||
optional: false
|
||||
checksum: 10c0/8b6c8ff6aa5358aeb316fedfa2094a4241ce12d98a0f818cee42510ec9149fed21fc75244c5f0e8cb453337f243c09fa8a90425cd2533fd481964d8583a1f0c9
|
||||
zod: "npm:^4.2.0"
|
||||
checksum: 10c0/73b5b0b0b58cdb6b1cc59cdc702004ff881d00e065c182473a9e69507ec499ce5705ff494aa08b076e2151ba6bc039ecc514162ccb9d7a20d2fa98f2df7afedc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@modelcontextprotocol/server@npm:^2.3.1":
|
||||
version: 2.3.1
|
||||
resolution: "@modelcontextprotocol/server@npm:2.3.1"
|
||||
dependencies:
|
||||
"@modelcontextprotocol/core": "npm:2.3.1"
|
||||
zod: "npm:^4.2.0"
|
||||
checksum: 10c0/f3e8159af5cb51211109ae4817c0cfcdf349171c090d4a355dafe6117038f9a807052289cb1376d67ad4c005e3772cf1af076dbded498636a022d7c641253f12
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -7243,16 +7220,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"accepts@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "accepts@npm:2.0.0"
|
||||
dependencies:
|
||||
mime-types: "npm:^3.0.0"
|
||||
negotiator: "npm:^1.0.0"
|
||||
checksum: 10c0/98374742097e140891546076215f90c32644feacf652db48412329de4c2a529178a81aa500fbb13dd3e6cbf6e68d829037b123ac037fc9a08bcec4b87b358eef
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"acorn@npm:^8.15.0":
|
||||
version: 8.15.0
|
||||
resolution: "acorn@npm:8.15.0"
|
||||
@@ -7292,21 +7259,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv-formats@npm:^3.0.1":
|
||||
version: 3.0.1
|
||||
resolution: "ajv-formats@npm:3.0.1"
|
||||
dependencies:
|
||||
ajv: "npm:^8.0.0"
|
||||
peerDependencies:
|
||||
ajv: ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
ajv:
|
||||
optional: true
|
||||
checksum: 10c0/168d6bca1ea9f163b41c8147bae537e67bd963357a5488a1eaf3abe8baa8eec806d4e45f15b10767e6020679315c7e1e5e6803088dfb84efa2b4e9353b83dd0a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv@npm:^8.0.0, ajv@npm:^8.17.1, ajv@npm:^8.6.0, ajv@npm:^8.6.3":
|
||||
"ajv@npm:^8.0.0, ajv@npm:^8.6.0, ajv@npm:^8.6.3":
|
||||
version: 8.20.0
|
||||
resolution: "ajv@npm:8.20.0"
|
||||
dependencies:
|
||||
@@ -7757,23 +7710,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"body-parser@npm:^2.2.1":
|
||||
version: 2.3.0
|
||||
resolution: "body-parser@npm:2.3.0"
|
||||
dependencies:
|
||||
bytes: "npm:^3.1.2"
|
||||
content-type: "npm:^2.0.0"
|
||||
debug: "npm:^4.4.3"
|
||||
http-errors: "npm:^2.0.1"
|
||||
iconv-lite: "npm:^0.7.2"
|
||||
on-finished: "npm:^2.4.1"
|
||||
qs: "npm:^6.15.2"
|
||||
raw-body: "npm:^3.0.2"
|
||||
type-is: "npm:^2.1.0"
|
||||
checksum: 10c0/2a8fbbdc471b588338555a3e1a597d1eb0ad0c21cf20fdc3bac5d3f8d9c3a4b19b4163575ab852a43a5dfc0df7770ced5284f979e561f1a24c2f851ce89e695a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"boolbase@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "boolbase@npm:1.0.0"
|
||||
@@ -8579,13 +8515,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"content-disposition@npm:^1.0.0, content-disposition@npm:~1.0.1":
|
||||
version: 1.0.1
|
||||
resolution: "content-disposition@npm:1.0.1"
|
||||
checksum: 10c0/bd7ff1fe8d2542d3a2b9a29428cc3591f6ac27bb5595bba2c69664408a68f9538b14cbd92479796ea835b317a09a527c8c7209c4200381dedb0c34d3b658849e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"content-disposition@npm:^2.0.1":
|
||||
version: 2.0.1
|
||||
resolution: "content-disposition@npm:2.0.1"
|
||||
@@ -8593,6 +8522,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"content-disposition@npm:~1.0.1":
|
||||
version: 1.0.1
|
||||
resolution: "content-disposition@npm:1.0.1"
|
||||
checksum: 10c0/bd7ff1fe8d2542d3a2b9a29428cc3591f6ac27bb5595bba2c69664408a68f9538b14cbd92479796ea835b317a09a527c8c7209c4200381dedb0c34d3b658849e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"content-type@npm:^1.0.5":
|
||||
version: 1.0.5
|
||||
resolution: "content-type@npm:1.0.5"
|
||||
@@ -8628,14 +8564,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cookie-signature@npm:^1.2.1":
|
||||
version: 1.2.2
|
||||
resolution: "cookie-signature@npm:1.2.2"
|
||||
checksum: 10c0/54e05df1a293b3ce81589b27dddc445f462f6fa6812147c033350cd3561a42bc14481674e05ed14c7bd0ce1e8bb3dc0e40851bad75415733711294ddce0b7bc6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cookie@npm:^0.7.1, cookie@npm:^0.7.2, cookie@npm:~0.7.2":
|
||||
"cookie@npm:^0.7.2, cookie@npm:~0.7.2":
|
||||
version: 0.7.2
|
||||
resolution: "cookie@npm:0.7.2"
|
||||
checksum: 10c0/9596e8ccdbf1a3a88ae02cf5ee80c1c50959423e1022e4e60b91dd87c622af1da309253d8abdb258fb5e3eacb4f08e579dc58b4897b8087574eee0fd35dfa5d2
|
||||
@@ -8698,7 +8627,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cors@npm:^2.8.5, cors@npm:~2.8.5":
|
||||
"cors@npm:~2.8.5":
|
||||
version: 2.8.5
|
||||
resolution: "cors@npm:2.8.5"
|
||||
dependencies:
|
||||
@@ -8741,7 +8670,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5, cross-spawn@npm:^7.0.6":
|
||||
"cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6":
|
||||
version: 7.0.6
|
||||
resolution: "cross-spawn@npm:7.0.6"
|
||||
dependencies:
|
||||
@@ -8938,7 +8867,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"debug@npm:4, debug@npm:4.4.3, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:^4.4.0, debug@npm:^4.4.3, debug@npm:~4.4.1":
|
||||
"debug@npm:4, debug@npm:4.4.3, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:^4.4.3, debug@npm:~4.4.1":
|
||||
version: 4.4.3
|
||||
resolution: "debug@npm:4.4.3"
|
||||
dependencies:
|
||||
@@ -9102,13 +9031,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"depd@npm:^2.0.0, depd@npm:~2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "depd@npm:2.0.0"
|
||||
checksum: 10c0/58bd06ec20e19529b06f7ad07ddab60e504d9e0faca4bd23079fac2d279c3594334d736508dc350e06e510aba5e22e4594483b3a6562ce7c17dd797f4cc4ad2c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"depd@npm:~1.1.2":
|
||||
version: 1.1.2
|
||||
resolution: "depd@npm:1.1.2"
|
||||
@@ -9116,6 +9038,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"depd@npm:~2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "depd@npm:2.0.0"
|
||||
checksum: 10c0/58bd06ec20e19529b06f7ad07ddab60e504d9e0faca4bd23079fac2d279c3594334d736508dc350e06e510aba5e22e4594483b3a6562ce7c17dd797f4cc4ad2c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"destroy@npm:^1.2.0":
|
||||
version: 1.2.0
|
||||
resolution: "destroy@npm:1.2.0"
|
||||
@@ -9843,13 +9772,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"etag@npm:^1.8.1":
|
||||
version: 1.8.1
|
||||
resolution: "etag@npm:1.8.1"
|
||||
checksum: 10c0/12be11ef62fb9817314d790089a0a49fae4e1b50594135dcb8076312b7d7e470884b5100d249b28c18581b7fd52f8b485689ffae22a11ed9ec17377a33a08f84
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eventemitter3@npm:^5.0.1":
|
||||
version: 5.0.1
|
||||
resolution: "eventemitter3@npm:5.0.1"
|
||||
@@ -9873,22 +9795,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eventsource-parser@npm:^3.0.0, eventsource-parser@npm:^3.0.1":
|
||||
version: 3.0.6
|
||||
resolution: "eventsource-parser@npm:3.0.6"
|
||||
checksum: 10c0/70b8ccec7dac767ef2eca43f355e0979e70415701691382a042a2df8d6a68da6c2fca35363669821f3da876d29c02abe9b232964637c1b6635c940df05ada78a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eventsource@npm:^3.0.2":
|
||||
version: 3.0.7
|
||||
resolution: "eventsource@npm:3.0.7"
|
||||
dependencies:
|
||||
eventsource-parser: "npm:^3.0.1"
|
||||
checksum: 10c0/c48a73c38f300e33e9f11375d4ee969f25cbb0519608a12378a38068055ae8b55b6e0e8a49c3f91c784068434efe1d9f01eb49b6315b04b0da9157879ce2f67d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"execa@npm:^5.0.0, execa@npm:^5.1.1":
|
||||
version: 5.1.1
|
||||
resolution: "execa@npm:5.1.1"
|
||||
@@ -9957,17 +9863,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"express-rate-limit@npm:^8.2.1":
|
||||
version: 8.3.2
|
||||
resolution: "express-rate-limit@npm:8.3.2"
|
||||
dependencies:
|
||||
ip-address: "npm:10.1.0"
|
||||
peerDependencies:
|
||||
express: ">= 4.11"
|
||||
checksum: 10c0/5b64d0691071086cdb8cfc6bcd5e761f5687cf4fabdebfe2a043ea5b4d31443637181e7be71e7ffabce76aee816daee62c1ca83250045847957da408a129f650
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"express-useragent@npm:^1.0.15":
|
||||
version: 1.0.15
|
||||
resolution: "express-useragent@npm:1.0.15"
|
||||
@@ -9975,42 +9870,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"express@npm:^5.2.1":
|
||||
version: 5.2.1
|
||||
resolution: "express@npm:5.2.1"
|
||||
dependencies:
|
||||
accepts: "npm:^2.0.0"
|
||||
body-parser: "npm:^2.2.1"
|
||||
content-disposition: "npm:^1.0.0"
|
||||
content-type: "npm:^1.0.5"
|
||||
cookie: "npm:^0.7.1"
|
||||
cookie-signature: "npm:^1.2.1"
|
||||
debug: "npm:^4.4.0"
|
||||
depd: "npm:^2.0.0"
|
||||
encodeurl: "npm:^2.0.0"
|
||||
escape-html: "npm:^1.0.3"
|
||||
etag: "npm:^1.8.1"
|
||||
finalhandler: "npm:^2.1.0"
|
||||
fresh: "npm:^2.0.0"
|
||||
http-errors: "npm:^2.0.0"
|
||||
merge-descriptors: "npm:^2.0.0"
|
||||
mime-types: "npm:^3.0.0"
|
||||
on-finished: "npm:^2.4.1"
|
||||
once: "npm:^1.4.0"
|
||||
parseurl: "npm:^1.3.3"
|
||||
proxy-addr: "npm:^2.0.7"
|
||||
qs: "npm:^6.14.0"
|
||||
range-parser: "npm:^1.2.1"
|
||||
router: "npm:^2.2.0"
|
||||
send: "npm:^1.1.0"
|
||||
serve-static: "npm:^2.2.0"
|
||||
statuses: "npm:^2.0.1"
|
||||
type-is: "npm:^2.0.1"
|
||||
vary: "npm:^1.1.2"
|
||||
checksum: 10c0/45e8c841ad188a41402ddcd1294901e861ee0819f632fb494f2ed344ef9c43315d294d443fb48d594e6586a3b779785120f43321417adaef8567316a55072949
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ext-list@npm:^2.0.0":
|
||||
version: 2.2.2
|
||||
resolution: "ext-list@npm:2.2.2"
|
||||
@@ -10244,20 +10103,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"finalhandler@npm:^2.1.0":
|
||||
version: 2.1.1
|
||||
resolution: "finalhandler@npm:2.1.1"
|
||||
dependencies:
|
||||
debug: "npm:^4.4.0"
|
||||
encodeurl: "npm:^2.0.0"
|
||||
escape-html: "npm:^1.0.3"
|
||||
on-finished: "npm:^2.4.1"
|
||||
parseurl: "npm:^1.3.3"
|
||||
statuses: "npm:^2.0.1"
|
||||
checksum: 10c0/6bd664e21b7b2e79efcaace7d1a427169f61cce048fae68eb56290e6934e676b78e55d89f5998c5508871345bc59a61f47002dc505dc7288be68cceac1b701e2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"find-up@npm:^3.0.0":
|
||||
version: 3.0.0
|
||||
resolution: "find-up@npm:3.0.0"
|
||||
@@ -10360,13 +10205,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"forwarded@npm:0.2.0":
|
||||
version: 0.2.0
|
||||
resolution: "forwarded@npm:0.2.0"
|
||||
checksum: 10c0/9b67c3fac86acdbc9ae47ba1ddd5f2f81526fa4c8226863ede5600a3f7c7416ef451f6f1e240a3cc32d0fd79fcfe6beb08fd0da454f360032bde70bf80afbb33
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fractional-index@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "fractional-index@npm:1.0.0"
|
||||
@@ -10402,13 +10240,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fresh@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "fresh@npm:2.0.0"
|
||||
checksum: 10c0/0557548194cb9a809a435bf92bcfbc20c89e8b5eb38861b73ced36750437251e39a111fc3a18b98531be9dd91fe1411e4969f229dc579ec0251ce6c5d4900bbc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fresh@npm:~0.5.2":
|
||||
version: 0.5.2
|
||||
resolution: "fresh@npm:0.5.2"
|
||||
@@ -11061,13 +10892,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"hono@npm:^4.11.4":
|
||||
version: 4.13.13
|
||||
resolution: "hono@npm:4.13.13"
|
||||
checksum: 10c0/c8524e685a59b4f23a9bea15385eeac5622218949db251cb871b20fd9ef673b751b44ccdee6c22b3df56e5ed4c1b1cebad17b518bdc1823039da39b53ef9c1cf
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"hot-shots@npm:^12.1.0":
|
||||
version: 12.1.0
|
||||
resolution: "hot-shots@npm:12.1.0"
|
||||
@@ -11334,7 +11158,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"iconv-lite@npm:0.7.3, iconv-lite@npm:^0.7.2, iconv-lite@npm:~0.7.0":
|
||||
"iconv-lite@npm:0.7.3":
|
||||
version: 0.7.3
|
||||
resolution: "iconv-lite@npm:0.7.3"
|
||||
dependencies:
|
||||
@@ -11539,20 +11363,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ip-address@npm:^10.0.1, ip-address@npm:^10.2.0":
|
||||
"ip-address@npm:^10.0.1":
|
||||
version: 10.7.2
|
||||
resolution: "ip-address@npm:10.7.2"
|
||||
checksum: 10c0/290b9c63289b2a89a442dac19eff88d919e65cd41d1a720fa963be736e126f3b0cf4f88f6056b06abbf4a95300dc9ce5362a773e012ef30e0400074d175b9d31
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ipaddr.js@npm:1.9.1":
|
||||
version: 1.9.1
|
||||
resolution: "ipaddr.js@npm:1.9.1"
|
||||
checksum: 10c0/0486e775047971d3fdb5fb4f063829bac45af299ae0b82dcf3afa2145338e08290563a2a70f34b732d795ecc8311902e541a8530eeb30d75860a78ff4e94ce2a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ipaddr.js@npm:^2.4.0":
|
||||
version: 2.4.0
|
||||
resolution: "ipaddr.js@npm:2.4.0"
|
||||
@@ -11849,13 +11666,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"is-promise@npm:^4.0.0":
|
||||
version: 4.0.0
|
||||
resolution: "is-promise@npm:4.0.0"
|
||||
checksum: 10c0/ebd5c672d73db781ab33ccb155fb9969d6028e37414d609b115cc534654c91ccd061821d5b987eefaa97cf4c62f0b909bb2f04db88306de26e91bfe8ddc01503
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"is-regex@npm:^1.2.1":
|
||||
version: 1.2.1
|
||||
resolution: "is-regex@npm:1.2.1"
|
||||
@@ -12112,13 +11922,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"jose@npm:^6.1.3":
|
||||
version: 6.1.3
|
||||
resolution: "jose@npm:6.1.3"
|
||||
checksum: 10c0/b9577b4a7a5e84131011c23823db9f5951eae3ba796771a6a2401ae5dd50daf71104febc8ded9c38146aa5ebe94a92ac09c725e699e613ef26949b9f5a8bc30f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"js-beautify@npm:1.15.4, js-beautify@npm:^1.6.12":
|
||||
version: 1.15.4
|
||||
resolution: "js-beautify@npm:1.15.4"
|
||||
@@ -12244,13 +12047,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"json-schema-typed@npm:^8.0.2":
|
||||
version: 8.0.2
|
||||
resolution: "json-schema-typed@npm:8.0.2"
|
||||
checksum: 10c0/89f5e2fb1495483b705c027203c07277ee6bf2665165ad25a9cb55de5af7f72570326d13d32565180781e4083ad5c9688102f222baed7b353c2f39c1e02b0428
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"json-schema@npm:^0.4.0":
|
||||
version: 0.4.0
|
||||
resolution: "json-schema@npm:0.4.0"
|
||||
@@ -13244,13 +13040,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"merge-descriptors@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "merge-descriptors@npm:2.0.0"
|
||||
checksum: 10c0/95389b7ced3f9b36fbdcf32eb946dc3dd1774c2fdf164609e55b18d03aa499b12bd3aae3a76c1c7185b96279e9803525550d3eb292b5224866060a288f335cb3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"merge-stream@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "merge-stream@npm:2.0.0"
|
||||
@@ -14180,7 +13969,7 @@ __metadata:
|
||||
"@koa/router": "npm:^15.7.0"
|
||||
"@koa/send": "npm:^6.0.0"
|
||||
"@linear/sdk": "npm:^97.0.0"
|
||||
"@modelcontextprotocol/sdk": "npm:^1.32.1"
|
||||
"@modelcontextprotocol/server": "npm:^2.3.1"
|
||||
"@noble/hashes": "npm:^2.4.0"
|
||||
"@node-oauth/oauth2-server": "npm:^5.3.0"
|
||||
"@notionhq/client": "npm:^2.3.0"
|
||||
@@ -15079,7 +14868,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"path-to-regexp@npm:^8.0.0, path-to-regexp@npm:^8.4.2":
|
||||
"path-to-regexp@npm:^8.4.2":
|
||||
version: 8.4.2
|
||||
resolution: "path-to-regexp@npm:8.4.2"
|
||||
checksum: 10c0/05b115c49b47ad252ce05faa32930f643f23769c68b8bcfe78ad833545140c48bbffb3266986d6c8d5db13a64cf12e07e0d72d9882cab830efeefa553533ebaf
|
||||
@@ -15256,13 +15045,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pkce-challenge@npm:^5.0.0":
|
||||
version: 5.0.1
|
||||
resolution: "pkce-challenge@npm:5.0.1"
|
||||
checksum: 10c0/207f4cb976682f27e8324eb49cf71937c98fbb8341a0b8f6142bc6f664825b30e049a54a21b5c034e823ee3c3d412f10d74bd21de78e17452a6a496c2991f57c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pkg-up@npm:^3.1.0":
|
||||
version: 3.1.0
|
||||
resolution: "pkg-up@npm:3.1.0"
|
||||
@@ -15637,16 +15419,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"proxy-addr@npm:^2.0.7":
|
||||
version: 2.0.8
|
||||
resolution: "proxy-addr@npm:2.0.8"
|
||||
dependencies:
|
||||
forwarded: "npm:0.2.0"
|
||||
ipaddr.js: "npm:1.9.1"
|
||||
checksum: 10c0/58398f36e5b1f72b1011ca21844c0c41a9a3b6f2f0d101bcdb19abb3f3dd9626b27a96e53da777ded901eb67faed0304a4bc1d435b235e436f66f8e5e1fe1f5e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"proxy-from-env@npm:^1.1.0":
|
||||
version: 1.1.0
|
||||
resolution: "proxy-from-env@npm:1.1.0"
|
||||
@@ -15710,7 +15482,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"qs@npm:^6.14.0, qs@npm:^6.15.2, qs@npm:^6.5.2":
|
||||
"qs@npm:^6.14.0, qs@npm:^6.5.2":
|
||||
version: 6.16.0
|
||||
resolution: "qs@npm:6.16.0"
|
||||
dependencies:
|
||||
@@ -15756,13 +15528,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"range-parser@npm:^1.2.1":
|
||||
version: 1.2.1
|
||||
resolution: "range-parser@npm:1.2.1"
|
||||
checksum: 10c0/96c032ac2475c8027b7a4e9fe22dc0dfe0f6d90b85e496e0f016fbdb99d6d066de0112e680805075bd989905e2123b3b3d002765149294dce0c1f7f01fcc2ea0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"rate-limiter-flexible@npm:^11.2.1":
|
||||
version: 11.2.1
|
||||
resolution: "rate-limiter-flexible@npm:11.2.1"
|
||||
@@ -15789,18 +15554,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"raw-body@npm:^3.0.0, raw-body@npm:^3.0.2":
|
||||
version: 3.0.2
|
||||
resolution: "raw-body@npm:3.0.2"
|
||||
dependencies:
|
||||
bytes: "npm:~3.1.2"
|
||||
http-errors: "npm:~2.0.1"
|
||||
iconv-lite: "npm:~0.7.0"
|
||||
unpipe: "npm:~1.0.0"
|
||||
checksum: 10c0/d266678d08e1e7abea62c0ce5864344e980fa81c64f6b481e9842c5beaed2cdcf975f658a3ccd67ad35fc919c1f6664ccc106067801850286a6cbe101de89f29
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"react-avatar-editor@npm:^15.1.0":
|
||||
version: 15.1.0
|
||||
resolution: "react-avatar-editor@npm:15.1.0"
|
||||
@@ -16619,19 +16372,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"router@npm:^2.2.0":
|
||||
version: 2.2.0
|
||||
resolution: "router@npm:2.2.0"
|
||||
dependencies:
|
||||
debug: "npm:^4.4.0"
|
||||
depd: "npm:^2.0.0"
|
||||
is-promise: "npm:^4.0.0"
|
||||
parseurl: "npm:^1.3.3"
|
||||
path-to-regexp: "npm:^8.0.0"
|
||||
checksum: 10c0/3279de7450c8eae2f6e095e9edacbdeec0abb5cb7249c6e719faa0db2dba43574b4fff5892d9220631c9abaff52dd3cad648cfea2aaace845e1a071915ac8867
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"rrweb-cssom@npm:^0.6.0":
|
||||
version: 0.6.0
|
||||
resolution: "rrweb-cssom@npm:0.6.0"
|
||||
@@ -16831,25 +16571,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"send@npm:^1.1.0, send@npm:^1.2.0":
|
||||
version: 1.2.1
|
||||
resolution: "send@npm:1.2.1"
|
||||
dependencies:
|
||||
debug: "npm:^4.4.3"
|
||||
encodeurl: "npm:^2.0.0"
|
||||
escape-html: "npm:^1.0.3"
|
||||
etag: "npm:^1.8.1"
|
||||
fresh: "npm:^2.0.0"
|
||||
http-errors: "npm:^2.0.1"
|
||||
mime-types: "npm:^3.0.2"
|
||||
ms: "npm:^2.1.3"
|
||||
on-finished: "npm:^2.4.1"
|
||||
range-parser: "npm:^1.2.1"
|
||||
statuses: "npm:^2.0.2"
|
||||
checksum: 10c0/fbbbbdc902a913d65605274be23f3d604065cfc3ee3d78bf9fc8af1dc9fc82667c50d3d657f5e601ac657bac9b396b50ee97bd29cd55436320cf1cddebdcec72
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"sequelize-cli@npm:^6.6.5":
|
||||
version: 6.6.5
|
||||
resolution: "sequelize-cli@npm:6.6.5"
|
||||
@@ -16948,18 +16669,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"serve-static@npm:^2.2.0":
|
||||
version: 2.2.1
|
||||
resolution: "serve-static@npm:2.2.1"
|
||||
dependencies:
|
||||
encodeurl: "npm:^2.0.0"
|
||||
escape-html: "npm:^1.0.3"
|
||||
parseurl: "npm:^1.3.3"
|
||||
send: "npm:^1.2.0"
|
||||
checksum: 10c0/37986096e8572e2dfaad35a3925fa8da0c0969f8814fd7788e84d4d388bc068cf0c06d1658509788e55bed942a6b6d040a8a267fa92bb9ffb1179f8bacde5fd7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"set-cookie-parser@npm:^3.0.1":
|
||||
version: 3.1.0
|
||||
resolution: "set-cookie-parser@npm:3.1.0"
|
||||
@@ -18285,7 +17994,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"type-is@npm:^2.0.1, type-is@npm:^2.1.0":
|
||||
"type-is@npm:^2.0.1":
|
||||
version: 2.1.0
|
||||
resolution: "type-is@npm:2.1.0"
|
||||
dependencies:
|
||||
@@ -19923,15 +19632,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"zod-to-json-schema@npm:^3.25.1":
|
||||
version: 3.25.1
|
||||
resolution: "zod-to-json-schema@npm:3.25.1"
|
||||
peerDependencies:
|
||||
zod: ^3.25 || ^4
|
||||
checksum: 10c0/711b30e34d1f1211f1afe64bf457f0d799234199dc005cca720b236ea808804c03164039c232f5df33c46f462023874015a8a0b3aab1585eca14124c324db7e2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"zod@npm:^4.5.4":
|
||||
version: 4.5.4
|
||||
resolution: "zod@npm:4.5.4"
|
||||
|
||||
Reference in new issue
Block a user