Set up a TypeScript MCP server project

Create a Node.js project for an MCP server, pin the TypeScript SDK v2 packages, and compile to a stable entry point.

Create the isolated project

Use Node.js 22 or later with npm. Run these commands in a new meeting-notes-mcp project where you can install packages. The separate v2 server and client packages match the imports used throughout the course. Save the generated lockfile if you share the project.

Code
mkdir meeting-notes-mcp
cd meeting-notes-mcp
npm init -y
npm pkg set type=module "scripts.build=tsc" "scripts.smoke=node dist/smoke.js"
npm install --save-exact @modelcontextprotocol/server@2.4.0 @modelcontextprotocol/client@2.4.0 zod@4
npm install --save-dev --save-exact typescript@5.9 @types/node@22
mkdir src

Configure the TypeScript build

Save this as tsconfig.json in the project root. NodeNext aligns TypeScript’s module resolution with Node’s ES module behavior. Compiling from src to dist gives desktop and editor hosts a predictable JavaScript path to launch.

Code
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "rootDir": "src",
    "outDir": "dist",
    "strict": true,
    "skipLibCheck": true
  },
  "include": [
    "src/**/*.ts"
  ]
}

Check the output path before adding MCP code

Save this as src/server.ts temporarily, then run npm run build followed by node dist/server.js. The command should print setup ok and exit. It verifies your Node and TypeScript setup. Replace the file with the real stdio server in the next exercise, since a diagnostic on stdout would interfere with its protocol.

Code
console.log("setup ok");

Recognize the two common setup errors

If npm cannot find tsc, run npm install from the folder containing package.json and check that TypeScript is in devDependencies. If Node reports that dist/server.js cannot be found, confirm the build succeeded and that you are in the same project folder. Use Node’s full executable path later if a graphical host cannot find it.

MCP TypeScript SDK package guide

Related reading

What Is MCP Server?

How Does MCP Work?

Your First MCP Server