mcp-layer 0.1.0 → 0.2.0

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 CHANGED
@@ -2,10 +2,22 @@
2
2
 
3
3
  `mcp-layer` helps engineers bolt extra behaviors on top of existing MCP servers without reimplementing transport or schema parsing. It is a small, focused toolbox for discovering MCP configs, connecting to servers, and extracting a unified schema that can drive CLIs, REST APIs, UI renderers, or additional MCP layers.
4
4
 
5
+ ## Table of Contents
6
+
7
+ - [What you can build with this repo](#what-you-can-build-with-this-repo)
8
+ - [Packages](#packages)
9
+ - [CLI quick try](#cli-quick-try)
10
+ - [Quick start (end-to-end)](#quick-start-end-to-end)
11
+ - [Design principles](#design-principles)
12
+ - [Development](#development)
13
+ - [Releasing](#releasing)
14
+ - [Repository guidelines](#repository-guidelines)
15
+
5
16
  ## What you can build with this repo
6
17
 
7
18
  - **CLI layers** that expose MCP tools as commands with validated input.
8
19
  - **REST gateways** that generate endpoints and schemas from MCP tool definitions.
20
+ - **GraphQL gateways** that expose generated and generic operations on top of MCP catalogs.
9
21
  - **UI renderers** that surface MCP Apps resources using `_meta.ui` metadata.
10
22
  - **New MCP layers** that programmatically reason about tool/resource catalogs.
11
23
 
@@ -33,6 +45,7 @@ await link.close();
33
45
  | [`@mcp-layer/connect`](packages/connect/README.md) | Connect to MCP servers over stdio and return a closeable Session. |
34
46
  | [`@mcp-layer/attach`](packages/attach/README.md) | Attach to in-process MCP SDK servers or Platformatic Fastify MCP plugins and return a Session. |
35
47
  | [`@mcp-layer/schema`](packages/schema/README.md) | Extract tools/resources/prompts/templates into a unified Zod-backed schema (including MCP Apps metadata). |
48
+ | [`@mcp-layer/gateway`](packages/gateway/README.md) | Shared adapter runtime primitives for catalog bootstrap, validation, resilience, telemetry, and deterministic mapping. |
36
49
  | [`@mcp-layer/test-server`](packages/test-server/README.md) | Feature-complete MCP server for integration tests and local exploration. |
37
50
  | [`@mcp-layer/openapi`](packages/openapi/README.md) | Generate OpenAPI 3.1 specs from MCP catalogs. |
38
51
  | [`@mcp-layer/rest`](packages/rest/README.md) | Fastify plugin that exposes MCP servers over REST. |
@@ -44,6 +57,7 @@ await link.close();
44
57
  | [`@mcp-layer/cli`](packages/cli/README.md) | CLI framework for turning MCP schemas into commands. |
45
58
  | [`@mcp-layer/openapi`](packages/openapi/README.md) | OpenAPI 3.1 generation for REST surfaces. |
46
59
  | [`@mcp-layer/rest`](packages/rest/README.md) | Fastify plugin for HTTP REST exposure. |
60
+ | [`@mcp-layer/graphql`](packages/graphql/README.md) | Fastify plugin and schema builder for GraphQL exposure on MCP catalogs. |
47
61
 
48
62
  ## CLI quick try
49
63
 
@@ -74,6 +88,7 @@ await session.close();
74
88
  ## Design principles
75
89
 
76
90
  - **Single source of truth**: normalized schemas flow from the MCP server, not from tool-specific parsing.
91
+ - **Layered adapters**: `schema -> gateway -> rest/graphql` keeps protocol logic centralized while adapters stay thin.
77
92
  - **Minimal surface area**: each package does one job and composes cleanly with the others.
78
93
  - **Real integration tests**: no mocks; the test server is used as a real MCP target.
79
94
 
@@ -98,6 +113,8 @@ The root package runs `prepack` to regenerate `src/index.js` and sync root `pack
98
113
 
99
114
  See `.github/workflows/release.yml` for the pipeline details.
100
115
 
116
+ The publish guard at `.github/workflows/publish-guard.yml` runs after the `Release` workflow completes and locates the open `Version Packages` PR (`changeset-release/main`). It checks npm for workspace package existence and upserts a single PR comment when packages still need first-time bootstrap publishing.
117
+
101
118
  ## Repository guidelines
102
119
 
103
120
  See `AGENTS.md` for coding style, testing requirements, and documentation expectations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-layer",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Layers of functionality that can be add to any MCP server. ",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,15 +29,19 @@
29
29
  "@changesets/cli": "^2.29.2"
30
30
  },
31
31
  "dependencies": {
32
- "@mcp-layer/attach": "1.1.0",
33
- "@mcp-layer/cli": "1.1.0",
34
- "@mcp-layer/config": "1.0.0",
35
- "@mcp-layer/connect": "1.0.0",
36
- "@mcp-layer/openapi": "1.1.0",
37
- "@mcp-layer/rest": "1.1.0",
38
- "@mcp-layer/schema": "1.0.1",
32
+ "@mcp-layer/attach": "1.1.1",
33
+ "@mcp-layer/cli": "1.1.1",
34
+ "@mcp-layer/config": "1.0.1",
35
+ "@mcp-layer/connect": "1.0.1",
36
+ "@mcp-layer/error": "0.2.0",
37
+ "@mcp-layer/gateway": "0.2.0",
38
+ "@mcp-layer/graphql": "0.2.0",
39
+ "@mcp-layer/manager": "0.2.0",
40
+ "@mcp-layer/openapi": "1.1.1",
41
+ "@mcp-layer/rest": "1.2.1",
42
+ "@mcp-layer/schema": "1.0.2",
39
43
  "@mcp-layer/session": "1.0.0",
40
- "@mcp-layer/test-server": "1.0.0"
44
+ "@mcp-layer/test-server": "1.0.1"
41
45
  },
42
46
  "main": "./src/index.js",
43
47
  "files": [
package/src/generate.js CHANGED
@@ -24,16 +24,12 @@ export async function collectPackages(rootDir) {
24
24
  const packages = [];
25
25
 
26
26
  for (const entry of entries) {
27
- if (!entry.isDirectory()) {
28
- continue;
29
- }
27
+ if (!entry.isDirectory()) continue;
30
28
 
31
29
  const pkgPath = path.join(packagesDir, entry.name, 'package.json');
32
30
  const exists = await hasPackageJson(pkgPath);
33
31
 
34
- if (exists) {
35
- packages.push(entry.name);
36
- }
32
+ if (exists) packages.push(entry.name);
37
33
  }
38
34
 
39
35
  packages.sort();
@@ -121,9 +117,7 @@ export async function syncDependencies(rootDir) {
121
117
  }
122
118
 
123
119
  for (const key of Object.keys(deps)) {
124
- if (key.startsWith('@mcp-layer/') && !names.has(key)) {
125
- delete deps[key];
126
- }
120
+ if (key.startsWith('@mcp-layer/') && !names.has(key)) delete deps[key];
127
121
  }
128
122
 
129
123
  data.dependencies = sortObject(deps);
@@ -140,9 +134,7 @@ export async function writeIndex(rootDir, outFile) {
140
134
  const next = await buildIndex(rootDir);
141
135
  const current = await readMaybe(outFile);
142
136
 
143
- if (current === next) {
144
- return;
145
- }
137
+ if (current === next) return;
146
138
 
147
139
  await writeFile(outFile, next, 'utf8');
148
140
  }
@@ -180,9 +172,7 @@ export async function writeJson(filePath, data) {
180
172
  const next = `${JSON.stringify(data, null, 2)}\n`;
181
173
  const current = await readMaybe(filePath);
182
174
 
183
- if (current === next) {
184
- return;
185
- }
175
+ if (current === next) return;
186
176
 
187
177
  await writeFile(filePath, next, 'utf8');
188
178
  }
@@ -216,6 +206,4 @@ export async function run() {
216
206
  }
217
207
 
218
208
  const entry = fileURLToPath(import.meta.url);
219
- if (process.argv[1] === entry) {
220
- run();
221
- }
209
+ if (process.argv[1] === entry) run();
package/src/index.js CHANGED
@@ -28,6 +28,30 @@ export * as config from '@mcp-layer/config';
28
28
  */
29
29
  export * as connect from '@mcp-layer/connect';
30
30
 
31
+ /**
32
+ * Package namespace from `@mcp-layer/error`.
33
+ * @type {typeof import('@mcp-layer/error')}
34
+ */
35
+ export * as error from '@mcp-layer/error';
36
+
37
+ /**
38
+ * Package namespace from `@mcp-layer/gateway`.
39
+ * @type {typeof import('@mcp-layer/gateway')}
40
+ */
41
+ export * as gateway from '@mcp-layer/gateway';
42
+
43
+ /**
44
+ * Package namespace from `@mcp-layer/graphql`.
45
+ * @type {typeof import('@mcp-layer/graphql')}
46
+ */
47
+ export * as graphql from '@mcp-layer/graphql';
48
+
49
+ /**
50
+ * Package namespace from `@mcp-layer/manager`.
51
+ * @type {typeof import('@mcp-layer/manager')}
52
+ */
53
+ export * as manager from '@mcp-layer/manager';
54
+
31
55
  /**
32
56
  * Package namespace from `@mcp-layer/openapi`.
33
57
  * @type {typeof import('@mcp-layer/openapi')}