Skip to content

Commit a959a4d

Browse files
feat(chore): access-control interceptor support for MCP endpoint
access-control interceptor support for MCP endpoint GH-1
1 parent 9f21f07 commit a959a4d

File tree

13 files changed

+435
-408
lines changed

13 files changed

+435
-408
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- name: Install Dependencies
21-
run: npm ci
21+
run: npm ci --ignore-scripts
2222
- name: Run Test Cases
2323
run: npm run test
2424

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
4040

4141
- name: Install 📌
42-
run: npm install
42+
run: npm install --ignore-scripts
4343

4444
- name: Test 🔧
4545
run: npm run test

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The schema field allows defining a Zod-based validation schema for tool input pa
5454
To use hooks with MCP tools, follow the provider-based approach:
5555

5656
Step 1: Create a hook provider:
57-
```typescript
57+
```ts
5858
// src/providers/my-hook.provider.ts
5959
export class MyHookProvider implements Provider<McpHookFunction> {
6060
constructor(@inject(LOGGER.LOGGER_INJECT) private logger: ILogger) {}
@@ -66,7 +66,7 @@ The schema field allows defining a Zod-based validation schema for tool input pa
6666
}
6767
```
6868
Step 2: Add binding key to McpHookBindings:
69-
```typescript
69+
```ts
7070
// src/keys.ts
7171
export namespace McpHookBindings {
7272
export const MY_HOOK = BindingKey.create<McpHookFunction>('hooks.mcp.myHook');
@@ -77,10 +77,11 @@ The schema field allows defining a Zod-based validation schema for tool input pa
7777
this.bind(McpHookBindings.MY_HOOK).toProvider(MyHookProvider);
7878
```
7979
Step 4: Use in decorator:
80-
```typescript
80+
```ts
8181
@mcpTool({
8282
name: 'my-tool',
8383
description: 'my-description'
8484
preHookBinding: McpHookBindings.MY_HOOK,
8585
postHookBinding: 'hooks.mcp.myOtherHook' // or string binding key
8686
})
87+
```

0 commit comments

Comments
 (0)