Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ on:

jobs:
test:
name: Run Unit Tests
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20.x, 22.x, 24.x]

steps:
- name: Checkout code
Expand All @@ -18,14 +22,16 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24.x
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: mcp-server/package-lock.json

- name: Install dependencies
working-directory: ./mcp-server
run: npm ci

- name: Run tests
# Includes package-environments.integration.test.ts (ESM static import,
# CJS require of build/cjs, CJS dynamic import of ESM build).
- name: Build and run tests
working-directory: ./mcp-server
run: npm run test:run
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
# syntax=docker/dockerfile:1

# Build stage
FROM node:lts-alpine AS build
FROM node:20-alpine AS build
WORKDIR /app

# Install dependencies
COPY mcp-server/package.json mcp-server/package-lock.json ./
RUN npm ci --production=false

# Copy source code
COPY mcp-server/tsconfig.json ./tsconfig.json
COPY mcp-server/tsconfig.json mcp-server/tsconfig.cjs.json ./
COPY mcp-server/scripts ./scripts
COPY mcp-server/src ./src

# Build the project
RUN npm run build

# Runtime stage
FROM node:lts-alpine AS runtime
FROM node:20-alpine AS runtime
WORKDIR /app

# Copy build artifacts and dependencies
Expand Down
43 changes: 34 additions & 9 deletions mcp-server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,26 @@
"bin": "./build/index.js",
"version": "2.2.15",
"description": "Currents MCP server",
"main": "index.js",
"main": "./build/cjs/api.js",
"module": "./build/api.js",
"types": "./build/api.d.ts",
"exports": {
".": {
"types": "./build/api.d.ts",
"import": "./build/api.js",
"require": "./build/cjs/api.js"
}
},
"scripts": {
"build": "tsc && chmod 755 build/index.js",
"build": "tsc && tsc -p tsconfig.cjs.json && node ./scripts/write-cjs-package-json.mjs && chmod 755 build/index.js",
"publish:mcp": "npm run publish:npm",
"publish:npm": "npm run rm && npm run build && ./publish.cjs",
"start": "node build/index.js",
"rm": "rimraf dist",
"test": "vitest",
"test:ui": "vitest --ui",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"test:run": "npm run build && vitest run",
"test:coverage": "npm run build && vitest run --coverage",
"release": "release-it",
"release:dry": "release-it --dry-run"
},
Expand All @@ -36,14 +45,18 @@
"url": "https://github.com/currents-dev/currents-mcp.git"
},
"license": "Apache-2.0",
"engines": {
"node": ">=20"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.25.2",
"@modelcontextprotocol/sdk": "^1.28.0",
"commander": "^12.1.0",
"pino": "^9.9.5",
"pino-pretty": "^13.1.1",
"zod": "^4.3.5"
},
"devDependencies": {
"@types/node": "^20.19.0",
"@release-it/conventional-changelog": "^10.0.0",
"release-it": "^19.0.3",
"rimraf": "^6.0.1",
Expand Down
8 changes: 8 additions & 0 deletions mcp-server/scripts/write-cjs-package-json.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { mkdirSync, writeFileSync } from "node:fs";
import { join, dirname } from "node:path";
import { fileURLToPath } from "node:url";

const root = join(dirname(fileURLToPath(import.meta.url)), "..");
const cjsDir = join(root, "build", "cjs");
mkdirSync(cjsDir, { recursive: true });
writeFileSync(join(cjsDir, "package.json"), `${JSON.stringify({ type: "commonjs" })}\n`);
1 change: 1 addition & 0 deletions mcp-server/src/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { startMcpServer } from "./server.js";
Loading