@adhd/apigen-plugin-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/README.md +20 -0
- package/index.d.ts +2 -0
- package/index.js +31527 -0
- package/index.mjs +384894 -0
- package/lib/generate.d.ts +3 -0
- package/lib/plugin.d.ts +4 -0
- package/lib/run.d.ts +3 -0
- package/lib/stream.d.ts +47 -0
- package/lib/templates/server-http.tpl.d.ts +2 -0
- package/lib/templates/server-stdio.tpl.d.ts +2 -0
- package/package.json +15 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @adhd/apigen-plugin-mcp
|
|
2
|
+
|
|
3
|
+
apigen target plugin (`--type mcp`) — exposes a source file's exports as **MCP tools** over
|
|
4
|
+
`stdio`, `sse`, or `streaming-http`. Generates a server to disk *and* runs one live.
|
|
5
|
+
|
|
6
|
+
Part of [apigen](../../README.md). Driven via [`@adhd/apigen-cli`](../../cli).
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
alias apigen='npx tsx packages/apigen/cli/src/index.ts'
|
|
10
|
+
|
|
11
|
+
# live
|
|
12
|
+
apigen run --source ./api.ts --type mcp # stdio (default)
|
|
13
|
+
apigen run --source ./api.ts --type mcp --opt transport=sse --opt port=3000
|
|
14
|
+
# generate
|
|
15
|
+
apigen generate --source ./api.ts --type mcp --out-dir ./out # → out/server.ts
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`--opt` keys: `transport` (`stdio` \| `sse` \| `streaming-http`, default `stdio`),
|
|
19
|
+
`port` (`3000`), `host` (`127.0.0.1`). On `stdio`, **stdout is reserved for JSON-RPC** — all
|
|
20
|
+
logs go to stderr. Each export becomes a tool; call args are passed as `{ data: { … } }`.
|
package/index.d.ts
ADDED