@nebutra/mcp 0.1.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/AGENTS.md ADDED
@@ -0,0 +1,62 @@
1
+ # AGENTS.md — packages/mcp
2
+
3
+ Execution contract for Nebutra's Model Context Protocol package.
4
+
5
+ ## Scope
6
+
7
+ Applies to everything under `packages/ai/mcp/`.
8
+
9
+ This package owns checked-in MCP request and server types, the client runtime,
10
+ middleware composition, in-process server registry, and the internal-server
11
+ catalog exposed through MCP. It is an integration boundary and is still `wip`,
12
+ not a production-complete tool platform.
13
+
14
+ ## Source Of Truth
15
+
16
+ - Public package surface and subpath exports: `package.json`, `src/index.ts`
17
+ - Canonical MCP types, tool definitions, request/response shapes, and server
18
+ config contract: `src/types.ts`
19
+ - Client runtime and shared singleton: `src/client/mcpClient.ts`,
20
+ `src/client/index.ts`
21
+ - Middleware composition, access control, audit, and rate-limit behavior:
22
+ `src/middleware/mcpMiddleware.ts`, `src/middleware/index.ts`
23
+ - Server registry and registration semantics:
24
+ `src/registry/serverRegistry.ts`, `src/registry/index.ts`
25
+ - Checked-in internal server catalog and registration entrypoint:
26
+ `src/server/internalServers.ts`, `src/server/index.ts`
27
+ - Context server runtime entrypoint: `src/server/contextServer.ts`
28
+
29
+ Treat `README.md` as descriptive only. If package behavior and docs disagree,
30
+ update the source files above instead of preserving stale examples.
31
+
32
+ ## Contract Boundaries
33
+
34
+ - Keep `package.json` exports, `src/index.ts`, and the `bin` contract aligned.
35
+ Public changes here affect client, middleware, and server consumers at once.
36
+ - Treat `src/types.ts` as the canonical contract for tool definitions, request
37
+ envelopes, execution results, and server registration. Tightening those
38
+ shapes is a compatibility change.
39
+ - Preserve the split between outbound client runtime, middleware pipeline, and
40
+ registry/server concerns. Client transport logic belongs in `src/client/`,
41
+ middleware semantics in `src/middleware/`, and checked-in server catalogs in
42
+ `src/server/` plus `src/registry/`.
43
+ - Keep internal server declarations centralized in `src/server/internalServers.ts`.
44
+ Do not scatter internal MCP server metadata through apps or docs.
45
+ - Respect the package's current `wip` status. The context server binary and
46
+ plan-based access control are not complete; do not document or code against
47
+ stronger production guarantees than the package actually provides.
48
+
49
+ ## Generated And Derived Files
50
+
51
+ - `dist/` is derived build output from `tsup`.
52
+ - The prepared `dist/server/contextServer.js` binary artifact is generated and
53
+ may be a placeholder stub before a full build.
54
+ - Do not hand-edit emitted build output or generated CLI artifacts. Update the
55
+ source files above and rebuild instead.
56
+
57
+ ## Validation
58
+
59
+ - Type or middleware/registry/client contract changes:
60
+ `pnpm --filter @nebutra/mcp typecheck`
61
+ - Server entrypoint, subpath export, or bin changes:
62
+ `pnpm --filter @nebutra/mcp build`