@lukoweb/apitogo 0.2.57 → 0.2.59

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/docs/mcp/setup.md CHANGED
@@ -1,173 +1,169 @@
1
- ---
2
- title: Configure MCP in your agent
3
- description:
4
- Install and wire the APItoGo MCP server in Cursor, Claude Desktop, Claude Code, Codex, and other
5
- MCP hosts.
6
- sidebar_icon: plug
7
- ---
8
-
9
- Connect **`@lukoweb/apitogo-mcp`** to your AI agent so it can shape and publish API products. The
10
- server is the same everywhere; only the host config file changes.
11
-
12
- ## Prerequisites
13
-
14
- - **Node.js 20+** on the machine that runs the agent (scaffold, build, preview)
15
- - Platform API credentials from [apitogo.com](https://apitogo.com) (API key id + secret)
16
-
17
- ## Shared server definition
18
-
19
- Every host launches the same stdio process:
20
-
21
- | Field | Value |
22
- | ------- | ------------------------------------------ |
23
- | Command | `npx` |
24
- | Args | `-y`, `@lukoweb/apitogo-mcp` |
25
- | Env | `APITOGO_API_KEY_ID`, `APITOGO_API_SECRET` |
26
-
27
- Optional env: `APITOGO_API_URL`, `APITOGO_DOC_TOOL_PATH` (local doc-tool for scaffold).
28
-
29
- Never commit secrets. Prefer host env blocks or `${VAR}` expansion where the client supports it.
30
-
31
- ## Cursor
32
-
33
- Add to `~/.cursor/mcp.json` (user) or `.cursor/mcp.json` (project):
34
-
35
- ```json
36
- {
37
- "mcpServers": {
38
- "apitogo": {
39
- "command": "npx",
40
- "args": ["-y", "@lukoweb/apitogo-mcp"],
41
- "env": {
42
- "APITOGO_API_KEY_ID": "apk_...",
43
- "APITOGO_API_SECRET": "..."
44
- }
45
- }
46
- }
47
- }
48
- ```
49
-
50
- Restart Cursor (or reload MCP). Confirm the **apitogo** server is connected in MCP settings.
51
-
52
- ### Optional: `apitogo-product` skill
53
-
54
- So agents prefer `apply_product_intent` for create / go-live:
55
-
56
- ```bash
57
- # From the apitogo-local-mcp repo (or after npm pack of the package that ships skills/)
58
- mkdir -p ~/.cursor/skills
59
- cp -R skills/apitogo-product ~/.cursor/skills/apitogo-product
60
- ```
61
-
62
- Or project-scoped under `.cursor/skills/apitogo-product`.
63
-
64
- ## Claude Desktop
65
-
66
- Edit the Claude Desktop MCP config (same `mcpServers` shape as Cursor):
67
-
68
- | OS | Path |
69
- | ------- | ----------------------------------------------------------------- |
70
- | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
71
- | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
72
-
73
- ```json
74
- {
75
- "mcpServers": {
76
- "apitogo": {
77
- "command": "npx",
78
- "args": ["-y", "@lukoweb/apitogo-mcp"],
79
- "env": {
80
- "APITOGO_API_KEY_ID": "apk_...",
81
- "APITOGO_API_SECRET": "..."
82
- }
83
- }
84
- }
85
- }
86
- ```
87
-
88
- Fully quit and reopen Claude Desktop after saving.
89
-
90
- ## Claude Code
91
-
92
- **CLI (user scope — all projects):**
93
-
94
- ```bash
95
- claude mcp add --scope user --env APITOGO_API_KEY_ID=apk_... --env APITOGO_API_SECRET=... \
96
- apitogo -- npx -y @lukoweb/apitogo-mcp
97
- ```
98
-
99
- **Project scope** (committed `.mcp.json` — use `${VAR}` for secrets):
100
-
101
- ```bash
102
- claude mcp add --scope project --env APITOGO_API_KEY_ID=${APITOGO_API_KEY_ID} \
103
- --env APITOGO_API_SECRET=${APITOGO_API_SECRET} \
104
- apitogo -- npx -y @lukoweb/apitogo-mcp
105
- ```
106
-
107
- Or hand-edit `.mcp.json` in the project root:
108
-
109
- ```json
110
- {
111
- "mcpServers": {
112
- "apitogo": {
113
- "type": "stdio",
114
- "command": "npx",
115
- "args": ["-y", "@lukoweb/apitogo-mcp"],
116
- "env": {
117
- "APITOGO_API_KEY_ID": "${APITOGO_API_KEY_ID}",
118
- "APITOGO_API_SECRET": "${APITOGO_API_SECRET}"
119
- }
120
- }
121
- }
122
- }
123
- ```
124
-
125
- User/local scope without a project file lives in `~/.claude.json`. Start a new Claude Code session
126
- after changing config. Approve project-scoped servers when prompted.
127
-
128
- ## OpenAI Codex
129
-
130
- Edit `~/.codex/config.toml` (or project `.codex/config.toml` in a trusted project). The key must be
131
- `mcp_servers` (not `mcpServers`):
132
-
133
- ```toml
134
- [mcp_servers.apitogo]
135
- command = "npx"
136
- args = ["-y", "@lukoweb/apitogo-mcp"]
137
-
138
- [mcp_servers.apitogo.env]
139
- APITOGO_API_KEY_ID = "apk_..."
140
- APITOGO_API_SECRET = "..."
141
- ```
142
-
143
- You can also use `codex mcp add` if your Codex version supports it, then confirm the TOML entry.
144
- Restart Codex / open a new session. See [Codex MCP docs](https://developers.openai.com/codex/mcp).
145
-
146
- ## Other MCP hosts
147
-
148
- Any client that supports **stdio** MCP can run APItoGo:
149
-
150
- 1. Set command `npx`, args `["-y", "@lukoweb/apitogo-mcp"]`
151
- 2. Pass `APITOGO_API_KEY_ID` and `APITOGO_API_SECRET` in the server env
152
- 3. Restart the host and confirm tools load
153
-
154
- Examples: Windsurf, VS Code Copilot Chat MCP, custom MCP clients — follow that product’s “add stdio
155
- server” UI and paste the same command/args/env.
156
-
157
- ## Verify
158
-
159
- In a new agent chat:
160
-
161
- 1. Ask the agent to list APItoGo tools, or call **`whoami`**.
162
- 2. You should see platform tools such as `apply_product_intent`, `create_dev_portal`,
163
- `publish_dev_portal`.
164
-
165
- If the server fails to start: confirm Node 20+, that `npx -y @lukoweb/apitogo-mcp` works in a
166
- terminal, and that the API key id/secret are correct.
167
-
168
- ## Next
169
-
170
- - [Quickstart](../quickstart.md) — first shape prompt
171
- - [Shape](./shape.md) — local portal iteration
172
- - [Go live](./go-live.md) — publish
173
- - [Tools](./tools.md) — catalog
1
+ ---
2
+ title: Configure MCP in your agent
3
+ description:
4
+ Install and wire the APItoGo MCP server in Cursor, Claude Desktop, Claude Code, Codex, and other
5
+ MCP hosts.
6
+ sidebar_icon: plug
7
+ ---
8
+
9
+ Connect **`@lukoweb/apitogo-mcp`** to your AI agent so it can create, shape and deploy APItoGo
10
+ projects. The server is the same everywhere; only the host config file changes.
11
+
12
+ ## Prerequisites
13
+
14
+ - **Node.js 20+** on the machine that runs the agent
15
+ - Signed in to APItoGo: run `npx @lukoweb/apitogo login` once in a terminal. Or give the server API
16
+ credentials (API key id and secret from [apitogo.com](https://apitogo.com)) in its env.
17
+
18
+ ## Shared server definition
19
+
20
+ Every host launches the same stdio process:
21
+
22
+ | Field | Value |
23
+ | ------- | ---------------------------------------------------- |
24
+ | Command | `npx` |
25
+ | Args | `-y`, `@lukoweb/apitogo-mcp` |
26
+ | Env | Optional: `APITOGO_API_KEY_ID`, `APITOGO_API_SECRET` |
27
+
28
+ The tools run the `apitogo` CLI the project installed (`node_modules/@lukoweb/apitogo`), or the
29
+ latest one through npx in a folder without it. Optional env: `APITOGO_API_KEY_ID` and
30
+ `APITOGO_API_SECRET` instead of `apitogo login`, `APITOGO_API_URL`, and `APITOGO_CLI_PATH` (a local
31
+ doc-tool checkout, for CLI development).
32
+
33
+ The server runs the commands in the folder your host starts it in, unless a tool gets a `directory`.
34
+ Start it in your workspace, or tell the agent where the project is.
35
+
36
+ Never commit secrets. Prefer host env blocks or `${VAR}` expansion where the client supports it.
37
+
38
+ ## Cursor
39
+
40
+ Add to `~/.cursor/mcp.json` (user) or `.cursor/mcp.json` (project):
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "apitogo": {
46
+ "command": "npx",
47
+ "args": ["-y", "@lukoweb/apitogo-mcp"],
48
+ "env": {
49
+ "APITOGO_API_KEY_ID": "apk_...",
50
+ "APITOGO_API_SECRET": "..."
51
+ }
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ Restart Cursor (or reload MCP). Confirm the **apitogo** server is connected in MCP settings.
58
+
59
+ ## Claude Desktop
60
+
61
+ Edit the Claude Desktop MCP config (same `mcpServers` shape as Cursor):
62
+
63
+ | OS | Path |
64
+ | ------- | ----------------------------------------------------------------- |
65
+ | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
66
+ | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
67
+
68
+ ```json
69
+ {
70
+ "mcpServers": {
71
+ "apitogo": {
72
+ "command": "npx",
73
+ "args": ["-y", "@lukoweb/apitogo-mcp"],
74
+ "env": {
75
+ "APITOGO_API_KEY_ID": "apk_...",
76
+ "APITOGO_API_SECRET": "..."
77
+ }
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ Fully quit and reopen Claude Desktop after saving.
84
+
85
+ ## Claude Code
86
+
87
+ **CLI (user scope — all projects):**
88
+
89
+ ```bash
90
+ claude mcp add --scope user --env APITOGO_API_KEY_ID=apk_... --env APITOGO_API_SECRET=... \
91
+ apitogo -- npx -y @lukoweb/apitogo-mcp
92
+ ```
93
+
94
+ **Project scope** (committed `.mcp.json` — use `${VAR}` for secrets):
95
+
96
+ ```bash
97
+ claude mcp add --scope project --env APITOGO_API_KEY_ID=${APITOGO_API_KEY_ID} \
98
+ --env APITOGO_API_SECRET=${APITOGO_API_SECRET} \
99
+ apitogo -- npx -y @lukoweb/apitogo-mcp
100
+ ```
101
+
102
+ Or hand-edit `.mcp.json` in the project root:
103
+
104
+ ```json
105
+ {
106
+ "mcpServers": {
107
+ "apitogo": {
108
+ "type": "stdio",
109
+ "command": "npx",
110
+ "args": ["-y", "@lukoweb/apitogo-mcp"],
111
+ "env": {
112
+ "APITOGO_API_KEY_ID": "${APITOGO_API_KEY_ID}",
113
+ "APITOGO_API_SECRET": "${APITOGO_API_SECRET}"
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ User/local scope without a project file lives in `~/.claude.json`. Start a new Claude Code session
121
+ after changing config. Approve project-scoped servers when prompted.
122
+
123
+ ## OpenAI Codex
124
+
125
+ Edit `~/.codex/config.toml` (or project `.codex/config.toml` in a trusted project). The key must be
126
+ `mcp_servers` (not `mcpServers`):
127
+
128
+ ```toml
129
+ [mcp_servers.apitogo]
130
+ command = "npx"
131
+ args = ["-y", "@lukoweb/apitogo-mcp"]
132
+
133
+ [mcp_servers.apitogo.env]
134
+ APITOGO_API_KEY_ID = "apk_..."
135
+ APITOGO_API_SECRET = "..."
136
+ ```
137
+
138
+ You can also use `codex mcp add` if your Codex version supports it, then confirm the TOML entry.
139
+ Restart Codex / open a new session. See [Codex MCP docs](https://developers.openai.com/codex/mcp).
140
+
141
+ ## Other MCP hosts
142
+
143
+ Any client that supports **stdio** MCP can run APItoGo:
144
+
145
+ 1. Set command `npx`, args `["-y", "@lukoweb/apitogo-mcp"]`
146
+ 2. Sign in with `npx @lukoweb/apitogo login`, or pass `APITOGO_API_KEY_ID` and `APITOGO_API_SECRET`
147
+ in the server env
148
+ 3. Restart the host and confirm tools load
149
+
150
+ Examples: Windsurf, VS Code Copilot Chat MCP, custom MCP clients — follow that product’s “add stdio
151
+ server” UI and paste the same command/args/env.
152
+
153
+ ## Verify
154
+
155
+ In a new agent chat:
156
+
157
+ 1. Ask the agent to list the APItoGo tools: they all start with `apitogo_`, such as
158
+ `apitogo_create`, `apitogo_deploy` and `apitogo_status`.
159
+ 2. Ask it for the status of your project; it calls `apitogo_status`.
160
+
161
+ If the server fails to start: confirm Node 20+ and that `npx -y @lukoweb/apitogo-mcp` works in a
162
+ terminal. If a tool says you are not logged in, run `npx @lukoweb/apitogo login` or check the API
163
+ key id and secret.
164
+
165
+ ## Next
166
+
167
+ - [Shape a project](./shape.md) — make and change the project folder
168
+ - [Go live](./go-live.md) — deploy
169
+ - [Tools](./tools.md) — every tool
package/docs/mcp/shape.md CHANGED
@@ -1,77 +1,77 @@
1
- ---
2
- title: Shape with MCP
3
- description:
4
- Scaffold and customize a developer portal locally with apply_product_intent (mode shape).
5
- sidebar_icon: pencil-ruler
6
- ---
7
-
8
- **Shape** means: create or update a local portal site (OpenAPI, plans, auth flags, public routes)
9
- without publishing. You preview with `npx apitogo run`.
10
-
11
- ## Happy path
12
-
13
- ```text
14
- apply_product_intent({ mode: "shape", siteDirectory, backend?, openApi?, plans?, auth?, gatewayPolicies?, branding? })
15
- → scaffold if needed
16
- → wire OpenAPI / plans / auth / gateway.publicRoutes
17
- → you run npx apitogo run
18
- ```
19
-
20
- Example prompt:
21
-
22
- > Create a portal in `./dev-portal` for my API in `./api` with Free (100/min) and Pro (1000/min);
23
- > make `/health` public.
24
-
25
- Never invent Free + Pro gateway plans unless you ask for them. Never put OIDC or Stripe secrets in
26
- chat.
27
-
28
- ## Scaffold only
29
-
30
- If you only want a local site:
31
-
32
- > Create a dev portal in `./dev-portal-site`.
33
-
34
- The agent should call **`create_dev_portal`** (or `apply_product_intent` with shape when you also
35
- pass plans/backend). Then run:
36
-
37
- ```bash
38
- cd ./dev-portal-site
39
- npx apitogo run
40
- ```
41
-
42
- `create_dev_portal` does **not** start the preview server. Use `npx apitogo run` or
43
- `preview_dev_portal_site`.
44
-
45
- Optional: `bootstrapProject: true` on create (or `bootstrap_project`) to create the platform project
46
- without selecting a hosting plan yet.
47
-
48
- ## What to collect
49
-
50
- Ask only for what is missing:
51
-
52
- 1. **siteDirectory** — where to scaffold (e.g. `./dev-portal`)
53
- 2. **backend** / **openApi** — source directory and/or OpenAPI path or URL
54
- 3. **plans** — SKUs, prices, rate limits (your choice; not invented)
55
- 4. **auth.mode** — `native` | `oidc` | `nativeAndOidc`
56
- 5. **gatewayPolicies.publicRoutes** — e.g. `/health` (other routes stay subscription-key protected
57
- by default)
58
-
59
- ## Customize after shape
60
-
61
- Use MCP tools (see [Tools](./tools.md)):
62
-
63
- - Pages → `add_dev_portal_page` / `update_dev_portal_page` (TSX only; `template`:
64
- docs|guide|marketing)
65
- - OpenAPI → `set_dev_portal_openapi`
66
- - Plans / branding → `update_dev_portal_manifest`
67
- - Theme → `set_dev_portal_theme`
68
-
69
- Home page content: hand-edit `landing/LandingPage.tsx` after asking for real copy. Footer:
70
- `modules.landing.content.footer` in `apitogo.config.json`.
71
-
72
- Shape-phase edits hot-reload when the local preview is running. Pass `restartPreview: true` on
73
- manifest updates only when you need mock pricing refreshed.
74
-
75
- ## Next
76
-
77
- When the site looks right, [go live](./go-live.md).
1
+ ---
2
+ title: Shape a project with MCP
3
+ description:
4
+ Create an APItoGo project folder and shape its portal, API and plans with the MCP tools, before
5
+ anything is deployed.
6
+ sidebar_icon: pencil-ruler
7
+ ---
8
+
9
+ **Shaping** is everything before a deploy: making the project folder, choosing the services, and
10
+ setting the portal's name, the API, the docs pages and the plans. It only changes files in the
11
+ folder; nothing reaches the platform yet.
12
+
13
+ ## Start a project
14
+
15
+ A new project with every service and a sample backend, ready to deploy:
16
+
17
+ > Create an APItoGo project called Books in `./books`.
18
+
19
+ The agent calls **`apitogo_create`** with `template: "full"`. For empty services it uses
20
+ `template: "blank"`, and `services` picks only some of them:
21
+
22
+ | Service | What it is |
23
+ | ---------- | -------------------------------------------------------- |
24
+ | `portal` | The developer website: landing page, docs, API reference |
25
+ | `gateway` | API protection: keys, rate limits, quotas |
26
+ | `identity` | Login for the people who use your API |
27
+ | `plans` | Pricing and API keys |
28
+
29
+ **An existing API repository?** The agent calls **`apitogo_init`** in that folder, then
30
+ **`apitogo_add`** for each service, for example a gateway in front of an API that already runs:
31
+
32
+ ```json
33
+ {
34
+ "service": "gateway",
35
+ "options": { "origin": "proxy", "url": "https://api.example.com", "spec": ["openapi.yaml"] }
36
+ }
37
+ ```
38
+
39
+ ## Change it
40
+
41
+ **`apitogo_config`** makes the common changes, with the flags of
42
+ [`apitogo config`](../configuration/make-config.mdx):
43
+
44
+ | Change | Options |
45
+ | --------------------------- | ----------------------------------------------------------- |
46
+ | Portal name | `title` |
47
+ | Add an OpenAPI file | `openapi` |
48
+ | A docs page | `pageSlug`, `pageTitle`, `pageContent` (markdown) |
49
+ | A plan | `planSku`, `planName`, `planPrice`, `planRate`, `planQuota` |
50
+ | A contact-us plan | `planSku`, `planPrice: "custom"` |
51
+ | Take a plan out | `removePlan` |
52
+ | Anything else in the config | `patch` (an object merged into `apitogo.config.json`) |
53
+
54
+ Example prompt:
55
+
56
+ > Add a Team plan at 49 USD a month with 120 calls a minute and 200,000 calls a month.
57
+
58
+ The agent sends
59
+ `{"planSku":"team","planName":"Team","planPrice":"49","planRate":"120/60","planQuota":"200000/30"}`.
60
+
61
+ The landing page (`apitogo/portal/landing/LandingPage.tsx`), the footer, the theme and the pages are
62
+ your project's files: the agent edits them directly, like any code.
63
+
64
+ Selling paid plans needs a **Starter** or **Professional** project and your Stripe keys, which you
65
+ set yourself; see [Plans](../configuration/plans.md) and the
66
+ [Stripe guide](../guides/stripe-setup.mdx).
67
+
68
+ ## Check and look
69
+
70
+ - **`apitogo_check`** finds mistakes in the config and its files before a deploy. With `offline` it
71
+ asks the platform nothing.
72
+ - To see the portal locally, run `npx apitogo run` in the folder yourself; it keeps running, so it
73
+ is not an MCP tool.
74
+
75
+ ## Next
76
+
77
+ When it looks right, [go live](./go-live.md).