You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [**Model Context Protocol (MCP)**](https://modelcontextprotocol.io) is an open protocol that standardizes how applications provide tools and context to LLMs. From the MCP docs:
15
16
@@ -99,24 +100,13 @@ Only enable this if you're confident the tool list won't change. To invalidate t
99
100
100
101
### Tool filtering
101
102
102
-
You can restrict which tools are exposed from each server. Pass either a static filter
103
-
using `createMCPToolStaticFilter` or a custom function:
104
-
105
-
```ts
106
-
const server =newMCPServerStdio({
107
-
fullCommand: 'my-server',
108
-
toolFilter: createMCPToolStaticFilter({
109
-
allowed: ['safe_tool'],
110
-
blocked: ['danger_tool'],
111
-
}),
112
-
});
113
-
114
-
const dynamicServer =newMCPServerStreamableHttp({
115
-
url: 'http://localhost:3000',
116
-
toolFilter: ({ runContext }, tool) =>
117
-
runContext.context.allowAll||tool.name!=='admin',
118
-
});
119
-
```
103
+
You can restrict which tools are exposed from each server by passing either a static filter via `createMCPToolStaticFilter` or a custom function. Here’s a combined example showing both approaches:
0 commit comments