AI agent with an MCP server project structure

AI agent with an MCP server project structure

Explorer

  • node_modules…, not committed
  • package.json
  • package-lock.json
  • tsconfig.json
  • .gitignore
  • .editorconfig
  • .nvmrc
  • README.md
  • src
  • server.ts
  • stdio.ts
  • config.tsnew
  • http.tsnew
  • testsnew
  • setup.tsnew
  • tools.test.tsnew
  • resources-prompts.test.tsnew
  • vitest.config.tsnew
  • scriptsnew
  • smoke.shnew
  • .envnew, not committed
  • .env.examplenew
  • inspector.config.jsonnew
  • .mcp.jsonnew
  • .vscodenew
  • mcp.jsonnew
  • settings.jsonnew
  • extensions.jsonnew
  • launch.jsonnew
  • eslint.config.jsnew
  • .prettierrcnew
  • lefthook.ymlnew
  • docker-compose.ymlnew
  • .devcontainernew
  • devcontainer.jsonnew
  • AGENTS.mdnew
  • CLAUDE.mdnew
  • .claudenew
  • coverage…new, not committed
  1. # Create the project (the SDK tutorial starts from npm init)

    mkdir tasks-mcp && cd tasks-mcp && npm init -y
  2. # Use ES modules: the SDK ships ESM only

    npm pkg set type=module
  3. # Install the server SDK and Zod

    npm install @modelcontextprotocol/server zod
  4. # Add TypeScript tooling

    npm install -D typescript tsx @types/node vitest
  5. # Try your tools in the MCP Inspector

    npx @modelcontextprotocol/inspector npx tsx src/stdio.ts
  6. # Later, for the remote transport

    npm install @modelcontextprotocol/express @modelcontextprotocol/node express