Skip to content

Commit 70a8257

Browse files
cablateclaude
andauthored
chore: upgrade MCP SDK to v1.27.1 (security fix) (#29)
* fix: create per-session McpServer instance in HTTP mode The singleton McpServer was shared across all HTTP sessions, causing "Already connected to a transport" crash on the second connection. Each session now gets its own McpServer instance with tools replayed from stored config. Stdio mode unchanged (1:1 by nature). Closes #27 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: upgrade MCP SDK to v1.27.1 and add smoke tests - Upgrade @modelcontextprotocol/sdk ^1.11.0 → ^1.27.1 - Fixes GHSA-345p-7cg4-v4c7 (cross-client response data leakage) - Protocol.connect() now enforces single-transport-per-instance - Upgrade zod ^3.24.2 → ^3.25.0 (now a peer dep of SDK v1.23+) - Pin @types/express to v4 (compatible with our express v4 dep) - Add smoke test suite (tests/smoke.test.ts): - Session initialization - Tool listing (all 7 tools) - Geocode tool call (when API key provided) - Multi-session concurrency (3 parallel sessions) - Run: npx tsx tests/smoke.test.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: add CI/CD workflows, ESLint, Prettier and npm scripts - Add GitHub Actions CI workflow (build/lint/test on PR) - Add GitHub Actions release workflow (E2E test + auto bump + npm publish on merge to main) - Add ESLint 9 flat config with TypeScript and Prettier integration - Add Prettier config matching existing code style - Add npm scripts: test, test:e2e, lint, format, format:check - Format all source files with Prettier - Fix prefer-const and no-empty lint errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 046b9a8 commit 70a8257

22 files changed

Lines changed: 8090 additions & 1498 deletions

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
ci:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
17+
- run: npm ci
18+
- run: npm run build
19+
- run: npm run lint
20+
- run: npm run format:check
21+
22+
- name: Smoke Test
23+
run: npm test

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
# Skip automated version bump commits
10+
if: "!contains(github.event.head_commit.message, 'chore: release')"
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
registry-url: https://registry.npmjs.org
21+
22+
- run: npm ci
23+
- run: npm run build
24+
- run: npm run lint
25+
26+
- name: E2E Tests
27+
run: npm run test:e2e
28+
env:
29+
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
30+
31+
- name: Bump version
32+
run: npm version patch --no-git-tag-version
33+
34+
- name: Publish to npm
35+
run: npm publish --access public
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
39+
- name: Commit version bump & tag
40+
run: |
41+
VERSION=$(node -p "require('./package.json').version")
42+
git config user.name "github-actions[bot]"
43+
git config user.email "github-actions[bot]@users.noreply.github.com"
44+
git add package.json package-lock.json
45+
git commit -m "chore: release v${VERSION}"
46+
git tag "v${VERSION}"
47+
git push
48+
git push --tags

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 120
7+
}

eslint.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import eslint from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import prettierConfig from "eslint-config-prettier";
4+
5+
export default tseslint.config(
6+
{ ignores: ["dist/", "test-new-api.js"] },
7+
eslint.configs.recommended,
8+
...tseslint.configs.recommended,
9+
prettierConfig,
10+
{
11+
rules: {
12+
"@typescript-eslint/no-explicit-any": "warn",
13+
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
14+
},
15+
}
16+
);

0 commit comments

Comments
 (0)