Skip to content

reVISit MCP scaffold - #1316

Open
dyr429 wants to merge 3 commits into
devfrom
yding/ai-mcp-scaffold
Open

dyr429 wants to merge 3 commits into
devfrom
yding/ai-mcp-scaffold

Conversation

@dyr429

@dyr429 dyr429 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Does this PR close any open issues?

First PR of #1298
Closes #1299

Give a longer description of what this PR addresses and why it's needed

Add a TypeScript MCP server scaffold for reVISit (revisit-mcp-ts/) so AI clients (Cursor, Claude Code, etc.) can leverage the provided tools to build studies.

Includes 4 basic MCP tools:
getversion — schema version pinned by public/global.json (falls back to root package.json, then 'main')
getcitation — BibTeX for ReVISit 2 and ReVISit 1
getconfigschema — full contents of src/parser/StudyConfigSchema.json
gettypes — full contents of src/parser/types.ts

dyr429 and others added 3 commits July 15, 2026 23:48
Introduce the MCP package entrypoint, TypeScript build, and getversion/getcitation/getconfigschema/gettypes tools, plus repo wiring so MCP sources are excluded from root lint and Vitest noise.

Co-authored-by: Cursor <cursoragent@cursor.com>
Trim unused deps, auto-install MCP on postinstall, lint the package, return schema/types contents, group info tools, and include the ReVISit 2 citation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match study-config authorship to The reVISit Team and declare Node >=18 for the MCP SDK.

Co-authored-by: Cursor <cursoragent@cursor.com>

@JackWilb JackWilb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes. The scaffold is a good start, but I found a few issues to fix before merging:

  • The version tool can report a different release from the schema and types it returns.
  • A clean checkout cannot run the advertised MCP start command because dist/index.js is not built.
  • The root install hook installs MCP dependencies for every app install and duplicates the CI install.
  • The nested lockfile currently fails a high-severity dependency audit.

Please also rebase onto current dev, preserve the existing Mantine postinstall step, move the test into the repository's normal tests location, and normalize the CRLF tsconfig. The exact-head build, lint, typecheck, and MCP tests pass locally, but GitHub currently has no checks and the PR is merge-conflicted.

try {
const globalRaw = await fs.readFile(path.resolve(STUDY_ROOT, 'public', 'global.json'), 'utf-8');
const schemaUrl = JSON.parse(globalRaw)?.$schema;
const schemaTag = typeof schemaUrl === 'string' ? schemaUrl.match(/\/(v\d+\.\d+\.\d+)\/src\/parser\//)?.[1] : undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This version comes from global.json, but getconfigschema and gettypes read the current checkout. At this head those files differ from the v2.4.3 tag, so an agent can be told one version and receive definitions from another. Please report the checkout version separately, or read all three values from the same release.

"main": "dist/index.js",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A clean checkout has no dist/index.js, so this start command fails immediately after install. Please document and enforce the install/build/start flow, and add a compiled stdio smoke check so the command clients are expected to run is tested.

Comment thread package.json
"find-revisit-users": "bash scripts/find-revisit-users.sh",
"preinstall": "node -e \"if(!/yarn\\.js$/.test(process.env.npm_execpath))throw new Error('Use yarn')\"",
"postinstall": "husky"
"postinstall": "husky && yarn --cwd revisit-mcp-ts install --frozen-lockfile"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This makes every root install fetch the MCP dependency tree, and CI installs it again in vitest.yml. That adds an unrelated failure and supply-chain path to normal app installs without building the server. Please keep MCP installation in an MCP-specific setup/test command, and preserve the current dev postinstall work when rebasing.

Comment thread revisit-mcp-ts/yarn.lock
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==

fast-uri@^3.0.1:
version "3.1.3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The current dependency audit reports fast-uri 3.1.3 as vulnerable; ip-address 10.2.0 is also flagged. Please refresh the SDK lock graph to patched versions and rerun the production dependency audit before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Scaffold

2 participants