infra: Set up project scaffolding, CDLI client, and ping tool

Closes #1

Description

Sets up the foundational layer of the MCP server. By the end of this, the server builds, lints, and has one working tool (ping) invocable over STDIO.

  • project scaffolding - package.json, tsconfig, ESLint v9 + typescript-eslint v8, Prettier, .gitignore
  • feat: add error utilities - src/util/errors.ts: error codes, McpError class, toErrorResponse() — the uniform error shape all tools will use
  • feat: add CDLI API client - src/cdliAPI/client.ts: cdliFetch (fetch + 8s AbortController timeout), normalizeArtifactId (handles P000001 / P12345 / 12345 → bare integer). src/cdliAPI/types.ts: shared API types
  • feat: add ping tool with stdio transport - src/tools/ping.ts, src/server.ts, src/transports/stdio.ts, src/index.ts

How to test

  • npm install

  • npm run build

  • npx @modelcontextprotocol/inspector node dist/index.js

    A browser tab with the mcp inspector opens up -> Type 'node' in command fiels -> 'dist/index.js' in arguments -> Connect -> list tools -> run ping -> returns pong

Merge request reports

Loading