Skip to content

refactor(mcp): migrate mcp_service/index.js to TypeScript - #23

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1784130513-mcp-index-ts
Open

devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1784130513-mcp-index-ts

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 15, 2026

Copy link
Copy Markdown

SUMMARY

Migrates the Node.js entry point superset/mcp_service/index.js to TypeScript, per the ongoing "NO JavaScript files" frontend modernization.

  • Replaces index.js with index.ts: the SupersetMCPServer class is now fully typed. Constructor options are captured in a SupersetMCPServer.Options interface (with a Transport = 'http' | 'stdio' union), and the internal subprocess handle is typed as ChildProcess | null (via child_process). Unused requires (spawn, path) from the original file were dropped.
  • Preserves the existing CommonJS consumption contract. The module is authored with export = SupersetMCPServer, so tsc emits module.exports = SupersetMCPServerrequire('@superset/mcp-server') still returns the class directly, unchanged from before.
  • Adds a scoped tsconfig.json (strict, CommonJS target, declaration: true, outDir: dist) that compiles only index.ts.
  • Updates package.json:
    • maindist/index.js, adds typesdist/index.d.ts
    • adds build (tsc -p tsconfig.json) and prepublishOnly scripts
    • adds files: [dist, bin]
    • adds typescript and @types/node devDependencies (+ package-lock.json)

dist/ is already covered by the repo root .gitignore, so build artifacts are produced on npm run build / publish rather than committed. The bin/superset-mcp.js runner is unchanged (out of scope).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

cd superset/mcp_service
npm install
npm run build            # tsc compiles index.ts -> dist/index.{js,d.ts}
node -e "const S=require('./dist/index.js'); const s=new S({port:6000}); console.log(typeof S, typeof s.start, typeof s.stop)"
# -> function function function

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Link to Devin session: https://app.devin.ai/sessions/e148ac05a34d410aa25f94e955c07f48
Requested by: @shayanshafii


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

Co-Authored-By: shayan <shayan@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants