diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..c00caa17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - uses: actions/setup-node@v4 + with: + node-version: "20" + + - run: npm install + + - run: npm run build + + - name: Build simple-host example + working-directory: examples/simple-host + run: | + npm install + npm run build + + - name: Build simple-server example + working-directory: examples/simple-server + run: | + npm install + npm run build + + - run: npm run prettier diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..f4743237 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +npm run build +npm run prettier:fix +( cd examples/simple-host && npm run build ) +( cd examples/simple-server && npm run build ) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..e69de29b diff --git a/package.json b/package.json index ef32670f..3d312d19 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "start:example-mcp-server": "cd examples//simple-server && npm --registry=https://registry.npmjs.org/ install && npm start", "start": "NODE_ENV=development npm run build && concurrently 'npm run start:example-host' 'npm run start:example-mcp-server'", "build": "bun build.bun.ts", - "prepare": "npm run build", + "prepare": "npm run build && husky", "prettier:base-cmd": "prettier -u --ignore-path ./.gitignore --ignore-path ./.prettierignore", "prettier": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --check", "prettier:fix": "yarn prettier:base-cmd \"$(pwd)/**/*.{js,jsx,ts,tsx,mjs,json,md,yml,yaml}\" --write --list-different" @@ -40,6 +40,7 @@ "cors": "^2.8.5", "esbuild": "^0.25.12", "express": "^5.1.0", + "husky": "^9.1.7", "prettier": "^3.6.2", "typescript": "^5.9.3" }, diff --git a/src/app-bridge.ts b/src/app-bridge.ts index ea4c5e87..fcc83902 100644 --- a/src/app-bridge.ts +++ b/src/app-bridge.ts @@ -266,10 +266,7 @@ export class AppBridge extends Protocol { ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ); - this.forwardRequest( - ReadResourceRequestSchema, - ReadResourceResultSchema, - ); + this.forwardRequest(ReadResourceRequestSchema, ReadResourceResultSchema); if (serverCapabilities.resources.listChanged) { this.forwardNotification(ResourceListChangedNotificationSchema); }