Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
- name: Publish preview packages
run:
pnpm dlx pkg-pr-new publish --packageManager=npm --pnpm './packages/server' './packages/client'
'./packages/middleware/express' './packages/middleware/fastify' './packages/middleware/hono' './packages/middleware/node'
'./packages/codemod' './packages/middleware/express' './packages/middleware/fastify' './packages/middleware/hono' './packages/middleware/node'
5 changes: 5 additions & 0 deletions packages/codemod/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// @ts-check

import baseConfig from '@modelcontextprotocol/eslint-config';

export default [...baseConfig];
68 changes: 68 additions & 0 deletions packages/codemod/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@modelcontextprotocol/codemod",
"version": "2.0.0-alpha.0",
"description": "Codemod to migrate MCP TypeScript SDK code from v1 to v2",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
"homepage": "https://modelcontextprotocol.io",
"bugs": "https://github.com/modelcontextprotocol/typescript-sdk/issues",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/modelcontextprotocol/typescript-sdk.git"
},
"engines": {
"node": ">=20"
},
"keywords": [
"modelcontextprotocol",
"mcp",
"codemod",
"migration"
],
"bin": {
"mcp-codemod": "./dist/cli.mjs"
},
"exports": {
".": {
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs"
}
},
"files": [
"dist"
],
Comment on lines +32 to +34
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 The new @modelcontextprotocol/codemod package is added to the publish workflow but ships with no README.md, while every other published package in the repo (client, server, middleware/*) has one. The PR description's CLI usage, programmatic API, and transform table won't be visible on the npm package page — worth adding a packages/codemod/README.md before this lands (npm auto-includes README regardless of the files array, so no package.json change is needed).

Extended reasoning...

What the gap is

This PR adds @modelcontextprotocol/codemod as a new published package — it has a bin entry (mcp-codemod), a programmatic API export, and is added to .github/workflows/publish.yml:43 so pkg-pr-new is already publishing preview builds. But packages/codemod/ contains no README.md. Every other published package in the repo has one: packages/client/README.md, packages/server/README.md, and all four packages/middleware/*/README.md files exist.

The repo's own review checklist (REVIEW.md) explicitly calls this out: "New feature: verify prose documentation is added (not just JSDoc), and assess whether examples/ needs a new or updated example." A new package with both a CLI and a programmatic API is squarely in scope for that item.

Why it matters

The PR description already contains exactly the documentation users need — the CLI Usage block (mcp-codemod v1-to-v2 ./src, --dry-run, --transforms, --list, --ignore), the Programmatic API snippet (getMigration / run), and the 9-row transform table. None of that will be visible on npm. A user who runs npx @modelcontextprotocol/codemod and gets the commander help text will have nowhere to look for the transform IDs, the design decisions, or the migration scope.

Step-by-step proof

  1. .github/workflows/publish.yml:43 adds './packages/codemod' to the pkg-pr-new publish command, so the package is published on every PR push (and presumably on release).
  2. packages/codemod/package.json:32-34 sets "files": ["dist"] and a bin entry — so the package is intended for end-user consumption via npx.
  3. ls packages/codemod/ shows: eslint.config.mjs, package.json, src/, test/, tsconfig.json, tsdown.config.ts, typedoc.json, vitest.config.js — no README.md.
  4. ls packages/*/README.md packages/middleware/*/README.md shows READMEs for client, server, express, fastify, hono, and node — codemod is the only published package without one.
  5. On npm, the package page renders the README as the primary documentation surface. With no README, the page shows only the package.json description string: "Codemod to migrate MCP TypeScript SDK code from v1 to v2" — no usage, no flags, no transform list.

Note on files array

npm always includes README* (along with package.json, LICENSE*, and the main entry) regardless of the files allowlist, so adding packages/codemod/README.md is sufficient — no need to touch "files": ["dist"].

Fix

Add packages/codemod/README.md containing (at minimum) the CLI Usage block, the Programmatic API snippet, and the transform table from this PR's description. Given the PR is explicitly titled "draft" and the author has an open TODO checklist, this is likely already planned — flagging it here per the REVIEW.md checklist item so it doesn't slip.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBD. Add README.md once the feasibility of the codemod has been confirmed.

"scripts": {
"typecheck": "tsgo -p tsconfig.json --noEmit",
"generate:versions": "tsx scripts/generateVersions.ts",
"prebuild": "pnpm run generate:versions",
"build": "tsdown",
"build:watch": "tsdown --watch",
"prepack": "pnpm run build",
"lint": "eslint src/ && prettier --ignore-path ../../.prettierignore --check .",
"lint:fix": "eslint src/ --fix && prettier --ignore-path ../../.prettierignore --write .",
"check": "pnpm run typecheck && pnpm run lint",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"commander": "^13.0.0",
"ts-morph": "^28.0.0"
},
"devDependencies": {
"@modelcontextprotocol/tsconfig": "workspace:^",
"@modelcontextprotocol/vitest-config": "workspace:^",
"@modelcontextprotocol/eslint-config": "workspace:^",
"@eslint/js": "catalog:devTools",
"@typescript/native-preview": "catalog:devTools",
"eslint": "catalog:devTools",
"eslint-config-prettier": "catalog:devTools",
"eslint-plugin-n": "catalog:devTools",
"prettier": "catalog:devTools",
"tsdown": "catalog:devTools",
"tsx": "catalog:devTools",
"typescript": "catalog:devTools",
"typescript-eslint": "catalog:devTools",
"vitest": "catalog:devTools"
}
}
34 changes: 34 additions & 0 deletions packages/codemod/scripts/generateVersions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { readFileSync, writeFileSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const packagesDir = path.resolve(__dirname, '../..');

const PACKAGE_DIRS: Record<string, string> = {
'@modelcontextprotocol/client': 'client',
'@modelcontextprotocol/server': 'server',
'@modelcontextprotocol/node': 'middleware/node',
'@modelcontextprotocol/express': 'middleware/express'
};

const versions: Record<string, string> = {};

for (const [pkg, dir] of Object.entries(PACKAGE_DIRS)) {
const pkgJsonPath = path.join(packagesDir, dir, 'package.json');
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
versions[pkg] = `^${pkgJson.version}`;
}

const entries = Object.entries(versions);
const lines = entries.map(([pkg, ver], i) => ` '${pkg}': '${ver}'${i < entries.length - 1 ? ',' : ''}`).join('\n');

const output = `// AUTO-GENERATED — do not edit. Run \`pnpm run generate:versions\` to regenerate.
export const V2_PACKAGE_VERSIONS: Record<string, string> = {
${lines}
};
`;

const outPath = path.resolve(__dirname, '../src/generated/versions.ts');
writeFileSync(outPath, output);
console.log(`Wrote ${outPath}`);
149 changes: 149 additions & 0 deletions packages/codemod/src/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#!/usr/bin/env node

import { existsSync, statSync } from 'node:fs';
import { createRequire } from 'node:module';
import path from 'node:path';

import { Command } from 'commander';

import { listMigrations } from './migrations/index.js';
import { run } from './runner.js';
import { DiagnosticLevel } from './types.js';
import { formatDiagnostic } from './utils/diagnostics.js';

const require = createRequire(import.meta.url);
const { version } = require('../package.json') as { version: string };

const program = new Command();

program.name('mcp-codemod').description('Codemod to migrate MCP TypeScript SDK code between versions').version(version);

for (const [name, migration] of listMigrations()) {
program
.command(`${name} [target-dir]`)
.description(migration.description)
.option('-d, --dry-run', 'Preview changes without writing files')
.option('-t, --transforms <ids>', 'Comma-separated transform IDs to run (default: all)')
.option('-v, --verbose', 'Show detailed per-change output')
.option('--ignore <patterns...>', 'Additional glob patterns to ignore')
.option('--list', 'List available transforms for this migration')
.action((targetDir: string | undefined, opts: Record<string, unknown>) => {
try {
if (opts['list']) {
console.log(`\nAvailable transforms for ${name}:\n`);
for (const t of migration.transforms) {
console.log(` ${t.id.padEnd(20)} ${t.name}`);
}
console.log('');
return;
}

if (!targetDir) {
console.error(`\nError: missing required argument <target-dir>.\n`);
process.exitCode = 1;
return;
}

const resolvedDir = path.resolve(targetDir);

if (!existsSync(resolvedDir) || !statSync(resolvedDir).isDirectory()) {
console.error(`\nError: "${resolvedDir}" is not a valid directory.\n`);
process.exitCode = 1;
return;
}

console.log(`\n@modelcontextprotocol/codemod — ${migration.name}\n`);
console.log(`Scanning ${resolvedDir}...`);
if (opts['dryRun']) {
console.log('(dry run — no files will be modified)\n');
} else {
console.log('');
}

const transforms = opts['transforms'] ? (opts['transforms'] as string).split(',').map(s => s.trim()) : undefined;

const result = run(migration, {
targetDir: resolvedDir,
dryRun: opts['dryRun'] as boolean | undefined,
verbose: opts['verbose'] as boolean | undefined,
transforms,
ignore: opts['ignore'] as string[] | undefined
});

if (result.filesChanged === 0 && result.diagnostics.length === 0) {
console.log('No changes needed — code already migrated or no SDK imports found.\n');
return;
}

Check warning on line 76 in packages/codemod/src/cli.ts

View check run for this annotation

Claude / Claude Code Review

CLI 'No changes needed' early return hides package.json modification

The early-return condition checks `filesChanged === 0 && diagnostics.length === 0` but not `result.packageJsonChanges` — yet `updatePackageJson()` runs unconditionally inside `run()` (runner.ts:111) and writes to disk whenever `@modelcontextprotocol/sdk` is in package.json, regardless of whether any source files changed. So if a user points the codemod at already-migrated source (or a subdir with no SDK imports) but `findPackageJson()` walks up to a package.json that still lists the v1 SDK, the
Comment on lines +73 to +76
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 The early-return condition checks filesChanged === 0 && diagnostics.length === 0 but not result.packageJsonChanges — yet updatePackageJson() runs unconditionally inside run() (runner.ts:111) and writes to disk whenever @modelcontextprotocol/sdk is in package.json, regardless of whether any source files changed. So if a user points the codemod at already-migrated source (or a subdir with no SDK imports) but findPackageJson() walks up to a package.json that still lists the v1 SDK, the dependency is silently removed on disk while the CLI prints "No changes needed" and never reaches the package.json updated: block at line 118. Add && !result.packageJsonChanges to the condition.

Extended reasoning...

What the bug is

The CLI's "nothing to do" early-return at cli.ts:73-76 checks only two conditions:

if (result.filesChanged === 0 && result.diagnostics.length === 0) {
    console.log('No changes needed — code already migrated or no SDK imports found.\n');
    return;
}

It does not check result.packageJsonChanges. But updatePackageJson() is called unconditionally inside run() (runner.ts:111) before the runner returns, and it performs writeFileSync() on disk (packageJsonUpdater.ts:62) whenever (a) findPackageJson() locates a package.json and (b) that package.json contains @modelcontextprotocol/sdk in dependencies or devDependencies — independent of whether any source transforms fired. So the CLI can write to disk and then tell the user nothing happened.

Code path that triggers it

updatePackageJson() (packageJsonUpdater.ts:15-69) early-returns undefined only when no package.json is found or the v1 SDK isn't in it. Otherwise it always:

  1. Removes @modelcontextprotocol/sdk from deps/devDeps (line 53-54).
  2. Adds whatever is in usedPackages (which is empty if no source imports were rewritten — allUsedPackages is only populated by transform results).
  3. Calls writeFileSync(pkgJsonPath, output) if !dryRun (line 62).
  4. Returns { removed: ['@modelcontextprotocol/sdk'], added: [], packageJsonPath }.

This is called at runner.ts:111 with no gating other than dryRun. The result is threaded through to result.packageJsonChanges, but the CLI early-return at line 73 doesn't look at it, so control never reaches the if (result.packageJsonChanges) reporting block at lines 118-132.

Why nothing else prevents it

The triggers are realistic:

  • Second run / idempotency check: user runs the codemod twice. On the second run, all source files are already v2 (so filesChanged = 0, diagnostics = []), but if package.json was reverted or partially staged, the v1 SDK is still listed → silently removed, CLI says "No changes needed".
  • Subdirectory target: user runs mcp-codemod v1-to-v2 ./scripts where ./scripts contains no SDK imports. findPackageJson() walks up from the target dir (projectAnalyzer.ts:8-17) and finds the project-root package.json with @modelcontextprotocol/sdk → removes it (adds nothing, since allUsedPackages is empty), CLI says "No changes needed".
  • --transforms filter: user runs with e.g. --transforms context (which doesn't populate usedPackages) on already-migrated context code → same outcome.

The dedicated unit test 'removes v1 SDK even when no v2 packages are detected' (packageJsonUpdater.test.ts:202-217) confirms that updatePackageJson(dir, new Set(), false) writes to disk and returns a non-undefined result with added: [] — exactly the state that the CLI early-return then hides.

Step-by-step proof

Project layout:

my-project/
  package.json   { "dependencies": { "@modelcontextprotocol/sdk": "^1.0.0" } }
  scripts/
    build.ts     // no SDK imports

User runs mcp-codemod v1-to-v2 ./scripts:

  1. cli.ts:65 — run(migration, { targetDir: '/my-project/scripts', ... }).
  2. runner.ts:52 — glob finds scripts/build.ts; it has no SDK imports, so every transform returns { changesCount: 0, diagnostics: [] }. filesChanged = 0, allDiagnostics = [], allUsedPackages = ∅.
  3. runner.ts:111 — updatePackageJson('/my-project/scripts', ∅, false):
    • findPackageJson('/my-project/scripts') walks up to /my-project/package.json.
    • inDeps = true (v1 SDK present), so it does not early-return.
    • packagesToAdd = [] (empty set, nothing in V2_PACKAGE_VERSIONS).
    • delete deps['@modelcontextprotocol/sdk']; removed = ['@modelcontextprotocol/sdk'].
    • !dryRunwriteFileSync('/my-project/package.json', ...) — disk mutated.
    • Returns { added: [], removed: ['@modelcontextprotocol/sdk'], packageJsonPath: '...' }.
  4. run() returns { filesChanged: 0, totalChanges: 0, diagnostics: [], packageJsonChanges: {...} }.
  5. cli.ts:73 — 0 === 0 && 0 === 0true. Prints No changes needed — code already migrated or no SDK imports found. and returns.
  6. The package.json updated: Removed: @modelcontextprotocol/sdk block at lines 118-132 is never reached.

Net effect: package.json was modified on disk; the CLI explicitly told the user nothing was modified.

Impact

Nit severity. The mutation itself is benign (removing a dependency the user is migrating away from), git-visible, and easily reverted. The trigger is narrow (no source-file changes + stale v1 dep in package.json). But it's a clear correctness bug in user-facing output — a CLI that performs a disk write while reporting "No changes needed" is exactly the kind of contradiction that erodes trust in a migration tool, especially given the PR's emphasis on dry-run safety and explicit package.json reporting.

Fix

One-clause addition to the early-return condition:

if (result.filesChanged === 0 && result.diagnostics.length === 0 && !result.packageJsonChanges) {
    console.log('No changes needed — code already migrated or no SDK imports found.\n');
    return;
}

With this, control falls through to the existing if (result.packageJsonChanges) block at line 118, which already handles the added.length > 0 / removed.length > 0 cases correctly (and the "Run your package manager" hint at line 138).


if (result.filesChanged > 0) {
console.log(`Changes: ${result.totalChanges} across ${result.filesChanged} file(s)\n`);
}

if (opts['verbose']) {
console.log('Files modified:');
for (const fr of result.fileResults) {
console.log(` ${fr.filePath} (${fr.changes} change(s))`);
}
console.log('');
}

const errors = result.diagnostics.filter(d => d.level === DiagnosticLevel.Error);
if (errors.length > 0) {
console.log(`Errors (${errors.length}):`);
for (const d of errors) {
console.log(formatDiagnostic(d));
}
console.log('');
process.exitCode = 1;
}

const warnings = result.diagnostics.filter(d => d.level === DiagnosticLevel.Warning);
if (warnings.length > 0) {
console.log(`Warnings (${warnings.length}):`);
for (const d of warnings) {
console.log(formatDiagnostic(d));
}
console.log('');
}

const infos = result.diagnostics.filter(d => d.level === DiagnosticLevel.Info);
if (infos.length > 0) {
console.log(`Info (${infos.length}):`);
for (const d of infos) {
console.log(formatDiagnostic(d));
}
console.log('');
}

if (result.packageJsonChanges) {
const pc = result.packageJsonChanges;
if (opts['dryRun']) {
console.log('package.json changes (dry run — not applied):');
} else {
console.log('package.json updated:');
}
if (pc.removed.length > 0) {
console.log(` Removed: ${pc.removed.join(', ')}`);
}
if (pc.added.length > 0) {
console.log(` Added: ${pc.added.join(', ')}`);
}
console.log('');
}
Comment thread
claude[bot] marked this conversation as resolved.

if (opts['dryRun']) {
console.log('Run without --dry-run to apply changes.\n');
} else {
if (result.packageJsonChanges) {
console.log('Run your package manager to install the new packages.\n');
}
console.log('Migration complete. Review the changes and run your build/tests.\n');
}
} catch (error) {
console.error(`\nError: ${error instanceof Error ? error.message : String(error)}\n`);
process.exitCode = 1;
}
});
}

program.parse();
7 changes: 7 additions & 0 deletions packages/codemod/src/generated/versions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// AUTO-GENERATED — do not edit. Run `pnpm run generate:versions` to regenerate.
export const V2_PACKAGE_VERSIONS: Record<string, string> = {
'@modelcontextprotocol/client': '^2.0.0-alpha.2',
'@modelcontextprotocol/server': '^2.0.0-alpha.2',
'@modelcontextprotocol/node': '^2.0.0-alpha.2',
'@modelcontextprotocol/express': '^2.0.0-alpha.2'
};
13 changes: 13 additions & 0 deletions packages/codemod/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export { getMigration, listMigrations } from './migrations/index.js';
export { run } from './runner.js';
export type {
Diagnostic,
FileResult,
Migration,
RunnerOptions,
RunnerResult,
Transform,
TransformContext,
TransformResult
} from './types.js';

Check warning on line 12 in packages/codemod/src/index.ts

View check run for this annotation

Claude / Claude Code Review

PackageJsonChange type not exported from public API

`RunnerResult` is exported and has a `packageJsonChanges?: PackageJsonChange` field, but `PackageJsonChange` itself is missing from this type re-export list — every other type reachable from `RunnerResult` (`Diagnostic`, `FileResult`) is exported. Consumers can work around it via `NonNullable<RunnerResult['packageJsonChanges']>`, but for consistency add `PackageJsonChange` here.
Comment on lines +3 to +12
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 RunnerResult is exported and has a packageJsonChanges?: PackageJsonChange field, but PackageJsonChange itself is missing from this type re-export list — every other type reachable from RunnerResult (Diagnostic, FileResult) is exported. Consumers can work around it via NonNullable<RunnerResult['packageJsonChanges']>, but for consistency add PackageJsonChange here.

Extended reasoning...

What the gap is

packages/codemod/src/index.ts is the package's sole public entrypoint (per package.json exports: { '.': ... }). It re-exports RunnerResult from ./types.js, and RunnerResult (types.ts:58-64) has a packageJsonChanges?: PackageJsonChange field. But PackageJsonChange is not in the export type { ... } list at index.ts:3-12 — every other type referenced by RunnerResult's fields (Diagnostic, FileResult) is.

Why it's an oversight, not a design choice

The packageJsonChanges feature was added in a later commit on this branch (2e349dd add package.json transform), after the initial index.ts was written. The type list at index.ts:3-12 was clearly intended to expose every type a programmatic-API consumer might need to annotate — it includes Diagnostic, FileResult, TransformResult, TransformContext, etc. — and PackageJsonChange is the one constituent of RunnerResult that was missed when the new field was added.

Why nothing else exposes it

package.json only exports '.'dist/index.mjs, so consumers cannot deep-import @modelcontextprotocol/codemod/types.js to get the type directly. The .d.mts bundler will include the interface structurally (so result.packageJsonChanges.added etc. type-check fine), but there's no named export, so import type { PackageJsonChange } from '@modelcontextprotocol/codemod' fails with TS2305: Module has no exported member 'PackageJsonChange'.

Step-by-step proof

A user following the PR description's Programmatic API example wants to write a helper:

import { run, getMigration, type RunnerResult, type PackageJsonChange } from '@modelcontextprotocol/codemod';

function reportPkgChanges(changes: PackageJsonChange): void {
  console.log(`Removed: ${changes.removed.join(', ')}`);
  console.log(`Added:   ${changes.added.join(', ')}`);
}

const result = run(getMigration('v1-to-v2')!, { targetDir: './src' });
if (result.packageJsonChanges) reportPkgChanges(result.packageJsonChanges);
  1. TypeScript resolves @modelcontextprotocol/codemoddist/index.d.mts.
  2. index.d.mts re-exports RunnerResult, Diagnostic, FileResult, etc., but not PackageJsonChange.
  3. import type { PackageJsonChange }TS2305.
  4. Workaround: type PackageJsonChange = NonNullable<RunnerResult['packageJsonChanges']> — works, but is exactly the boilerplate the explicit export list is meant to avoid.

Impact

Nothing is broken: the type is structurally reachable via indexed access, no runtime behavior is affected, and there are no existing consumers (new package). This is purely an API-surface ergonomics/consistency gap — hence nit.

Fix

One word:

export type {
    Diagnostic,
    FileResult,
    Migration,
    PackageJsonChange,
    RunnerOptions,
    RunnerResult,
    Transform,
    TransformContext,
    TransformResult
} from './types.js';

export { DiagnosticLevel } from './types.js';
12 changes: 12 additions & 0 deletions packages/codemod/src/migrations/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Migration } from '../types.js';
import { v1ToV2Migration } from './v1-to-v2/index.js';

const migrations = new Map<string, Migration>([['v1-to-v2', v1ToV2Migration]]);

export function getMigration(name: string): Migration | undefined {
return migrations.get(name);
}

export function listMigrations(): Map<string, Migration> {
return migrations;
}
8 changes: 8 additions & 0 deletions packages/codemod/src/migrations/v1-to-v2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Migration } from '../../types.js';
import { v1ToV2Transforms } from './transforms/index.js';

export const v1ToV2Migration: Migration = {
name: 'v1-to-v2',
description: 'Migrate from @modelcontextprotocol/sdk (v1) to v2 packages (@modelcontextprotocol/client, /server, etc.)',
transforms: v1ToV2Transforms
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export interface ContextMapping {
from: string;
to: string;
}

export const CONTEXT_PROPERTY_MAP: ContextMapping[] = [
{ from: '.signal', to: '.mcpReq.signal' },
{ from: '.requestId', to: '.mcpReq.id' },
{ from: '._meta', to: '.mcpReq._meta' },
{ from: '.sendRequest', to: '.mcpReq.send' },
{ from: '.sendNotification', to: '.mcpReq.notify' },
{ from: '.authInfo', to: '.http?.authInfo' },
{ from: '.sessionId', to: '.sessionId' },
{ from: '.requestInfo', to: '.http?.req' },
{ from: '.closeSSEStream', to: '.http?.closeSSE' },
{ from: '.closeStandaloneSSEStream', to: '.http?.closeStandaloneSSE' },
{ from: '.taskStore', to: '.task?.store' },
{ from: '.taskId', to: '.task?.id' },
{ from: '.taskRequestedTtl', to: '.task?.requestedTtl' }
];

export const EXTRA_PARAM_NAME = 'extra';
export const CTX_PARAM_NAME = 'ctx';
Loading
Loading