@frontmcp/adapters 1.9.6 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -28
- package/esm/package.json +14 -11
- package/package.json +14 -11
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @frontmcp/adapters
|
|
2
2
|
|
|
3
|
-
Adapters
|
|
3
|
+
Adapters for FrontMCP servers. An adapter builds tools from another source when the server starts. This package has `OpenapiAdapter`, which reads an OpenAPI 3 description of a REST API and gives your app one tool per operation, so you can put an API you already have in front of a model without writing a tool for each endpoint.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@frontmcp/adapters) [](https://github.com/agentfront/frontmcp/blob/main/LICENSE)
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -10,54 +10,70 @@ Adapters that extend FrontMCP servers by auto-generating MCP tools from external
|
|
|
10
10
|
npm install @frontmcp/adapters
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Use it in a FrontMCP app: it depends on `@frontmcp/sdk`, so keep the two at the same version. It needs Node.js 24 or later.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Usage
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
List the result of `OpenapiAdapter.init()` in an app's `adapters`:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
20
|
import { OpenapiAdapter } from '@frontmcp/adapters';
|
|
21
21
|
import { App } from '@frontmcp/sdk';
|
|
22
22
|
|
|
23
23
|
@App({
|
|
24
|
-
id: '
|
|
25
|
-
name: '
|
|
24
|
+
id: 'petstore',
|
|
25
|
+
name: 'Pet Store',
|
|
26
26
|
adapters: [
|
|
27
27
|
OpenapiAdapter.init({
|
|
28
|
-
name: '
|
|
29
|
-
url: 'https://
|
|
30
|
-
baseUrl: 'https://
|
|
28
|
+
name: 'petstore',
|
|
29
|
+
url: 'https://petstore3.swagger.io/api/v3/openapi.json',
|
|
30
|
+
baseUrl: 'https://petstore3.swagger.io/api/v3',
|
|
31
31
|
}),
|
|
32
32
|
],
|
|
33
33
|
})
|
|
34
|
-
export
|
|
34
|
+
export class PetStoreApp {}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Required options:
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
| Option | Type | Description |
|
|
40
|
+
| ------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| `name` | `string` | Names the adapter. It must be unique in the process, and prefixes a tool whose name clashes with another tool's. |
|
|
42
|
+
| `baseUrl` | `string` | Where the API is. Each operation's path is appended to it, and it wins over the spec's `servers`. |
|
|
43
|
+
| `spec` **or** `url` | `object` or `string` | The OpenAPI 3.0 or 3.1 document as an object, or an `http:` or `https:` URL to download it from when the server starts. |
|
|
44
|
+
|
|
45
|
+
Each tool checks its arguments against the operation's parameters and body schema before it sends the request. Other options set credentials (`staticAuth`, `authProviderMapper`, `securityResolver`), filter and rename operations (`generateOptions`, `toolTransforms`), fill in inputs on the server (`inputTransforms`), reshape responses (`dataTransforms`), and re-read the spec while the server runs (`polling`). [OpenAPI adapter](https://frontmcp.dev/reference/adapters/openapi) documents every option.
|
|
46
|
+
|
|
47
|
+
Parsing the spec and generating the tools is done by [`mcp-from-openapi`](https://www.npmjs.com/package/mcp-from-openapi).
|
|
48
|
+
|
|
49
|
+
### Entry points
|
|
50
|
+
|
|
51
|
+
| Import | What it has |
|
|
52
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| `@frontmcp/adapters` | `OpenapiAdapter`, `OpenApiSpecPoller`, and the OpenAPI helpers and types. |
|
|
54
|
+
| `@frontmcp/adapters/openapi` | The same OpenAPI exports, with `OpenapiAdapter` as the default export. |
|
|
55
|
+
| `@frontmcp/adapters/skills` | Skill bundle sources and the bundle store used by [`@frontmcp/plugin-skilled-openapi`](https://www.npmjs.com/package/@frontmcp/plugin-skilled-openapi). |
|
|
56
|
+
|
|
57
|
+
The root and `/openapi` entry points are built separately, each with its own copy of `OpenapiAdapter`, so import it from one of them throughout an app.
|
|
40
58
|
|
|
41
59
|
## Docs
|
|
42
60
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
| Step-by-step guide | [Add OpenAPI Adapter][docs-guide] |
|
|
61
|
+
- [OpenAPI adapter](https://frontmcp.dev/reference/adapters/openapi): every option, credentials, transforms and spec polling
|
|
62
|
+
- [Wrapping an OpenAPI service](https://frontmcp.dev/learn/wrapping-an-openapi-service): a step-by-step guide
|
|
63
|
+
- [Pet Store from OpenAPI](https://frontmcp.dev/examples/pet-store-from-openapi): a whole API wrapped and made fit for a model
|
|
64
|
+
- [`@Adapter`](https://frontmcp.dev/reference/sdk/adapter): writing an adapter of your own
|
|
48
65
|
|
|
49
|
-
## Related
|
|
66
|
+
## Related packages
|
|
50
67
|
|
|
51
|
-
- [`@frontmcp/sdk`](
|
|
52
|
-
- [`@frontmcp/
|
|
53
|
-
- [`
|
|
68
|
+
- [`@frontmcp/sdk`](https://www.npmjs.com/package/@frontmcp/sdk): the framework the adapter plugs into.
|
|
69
|
+
- [`@frontmcp/plugin-skilled-openapi`](https://www.npmjs.com/package/@frontmcp/plugin-skilled-openapi): for an API too large to list as tools.
|
|
70
|
+
- [`@frontmcp/testing`](https://www.npmjs.com/package/@frontmcp/testing): end-to-end tests for the tools an adapter generates.
|
|
71
|
+
- [`mcp-from-openapi`](https://www.npmjs.com/package/mcp-from-openapi): the OpenAPI-to-MCP converter underneath.
|
|
54
72
|
|
|
55
|
-
##
|
|
73
|
+
## Contributing
|
|
56
74
|
|
|
57
|
-
|
|
75
|
+
Source: [`libs/adapters`](https://github.com/agentfront/frontmcp/tree/main/libs/adapters). Issues and pull requests are welcome; see [CONTRIBUTING.md](https://github.com/agentfront/frontmcp/blob/main/CONTRIBUTING.md).
|
|
58
76
|
|
|
59
|
-
|
|
77
|
+
## License
|
|
60
78
|
|
|
61
|
-
[
|
|
62
|
-
[docs-openapi]: https://frontmcp.dev/reference/adapters/openapi
|
|
63
|
-
[docs-guide]: https://frontmcp.dev/learn/wrapping-an-openapi-service
|
|
79
|
+
Apache-2.0. See [LICENSE](https://github.com/agentfront/frontmcp/blob/main/LICENSE).
|
package/esm/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/adapters",
|
|
3
|
-
"version": "1.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.9.7",
|
|
4
|
+
"description": "FrontMCP adapters: turn an OpenAPI spec into MCP tools (OpenapiAdapter)",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://frontmcp.dev/reference/adapters/openapi",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"keywords": [
|
|
9
|
+
"frontmcp",
|
|
9
10
|
"mcp",
|
|
11
|
+
"model-context-protocol",
|
|
10
12
|
"adapters",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"openapi",
|
|
14
|
+
"swagger",
|
|
15
|
+
"rest",
|
|
16
|
+
"tools",
|
|
17
|
+
"agentfront"
|
|
15
18
|
],
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
@@ -64,15 +67,15 @@
|
|
|
64
67
|
"node": ">=24.0.0"
|
|
65
68
|
},
|
|
66
69
|
"dependencies": {
|
|
67
|
-
"@frontmcp/auth": "1.9.
|
|
68
|
-
"@frontmcp/di": "1.9.
|
|
69
|
-
"@frontmcp/sdk": "1.9.
|
|
70
|
-
"@frontmcp/utils": "1.9.
|
|
70
|
+
"@frontmcp/auth": "1.9.7",
|
|
71
|
+
"@frontmcp/di": "1.9.7",
|
|
72
|
+
"@frontmcp/sdk": "1.9.7",
|
|
73
|
+
"@frontmcp/utils": "1.9.7",
|
|
71
74
|
"js-yaml": "^4.1.0",
|
|
72
75
|
"mcp-from-openapi": "2.8.0",
|
|
73
76
|
"openapi-types": "^12.1.3"
|
|
74
77
|
},
|
|
75
78
|
"peerDependencies": {
|
|
76
|
-
"@frontmcp/lazy-zod": "1.9.
|
|
79
|
+
"@frontmcp/lazy-zod": "1.9.7"
|
|
77
80
|
}
|
|
78
81
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/adapters",
|
|
3
|
-
"version": "1.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.9.7",
|
|
4
|
+
"description": "FrontMCP adapters: turn an OpenAPI spec into MCP tools (OpenapiAdapter)",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://frontmcp.dev/reference/adapters/openapi",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"keywords": [
|
|
9
|
+
"frontmcp",
|
|
9
10
|
"mcp",
|
|
11
|
+
"model-context-protocol",
|
|
10
12
|
"adapters",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"openapi",
|
|
14
|
+
"swagger",
|
|
15
|
+
"rest",
|
|
16
|
+
"tools",
|
|
17
|
+
"agentfront"
|
|
15
18
|
],
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
@@ -64,15 +67,15 @@
|
|
|
64
67
|
"node": ">=24.0.0"
|
|
65
68
|
},
|
|
66
69
|
"dependencies": {
|
|
67
|
-
"@frontmcp/auth": "1.9.
|
|
68
|
-
"@frontmcp/di": "1.9.
|
|
69
|
-
"@frontmcp/sdk": "1.9.
|
|
70
|
-
"@frontmcp/utils": "1.9.
|
|
70
|
+
"@frontmcp/auth": "1.9.7",
|
|
71
|
+
"@frontmcp/di": "1.9.7",
|
|
72
|
+
"@frontmcp/sdk": "1.9.7",
|
|
73
|
+
"@frontmcp/utils": "1.9.7",
|
|
71
74
|
"js-yaml": "^4.1.0",
|
|
72
75
|
"mcp-from-openapi": "2.8.0",
|
|
73
76
|
"openapi-types": "^12.1.3"
|
|
74
77
|
},
|
|
75
78
|
"peerDependencies": {
|
|
76
|
-
"@frontmcp/lazy-zod": "1.9.
|
|
79
|
+
"@frontmcp/lazy-zod": "1.9.7"
|
|
77
80
|
}
|
|
78
81
|
}
|