@apicity/mcp-server 0.3.5 → 0.4.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 +141 -108
- package/dist/endpoint-docs.tsv +1 -0
- package/dist/src/cli.d.ts +2 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +46 -18
- package/dist/src/cli.js.map +1 -1
- package/dist/src/env-file.d.ts +3 -0
- package/dist/src/env-file.d.ts.map +1 -0
- package/dist/src/env-file.js +53 -0
- package/dist/src/env-file.js.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +22 -22
package/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# @apicity/mcp-server
|
|
2
2
|
|
|
3
3
|
Optional MCP (Model Context Protocol) server that exposes every endpoint from
|
|
4
|
-
the `@apicity/*` provider packages as a tool
|
|
5
|
-
endpoint
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
in lockstep with the providers.
|
|
4
|
+
the `@apicity/*` provider packages as a tool — one MCP tool per upstream
|
|
5
|
+
endpoint, no new abstractions, no curated subset. The endpoint list is sourced
|
|
6
|
+
from the monorepo's `scripts/endpoint-docs.tsv` (bundled as
|
|
7
|
+
`dist/endpoint-docs.tsv` for installed users), so it stays in lockstep with
|
|
8
|
+
the providers.
|
|
10
9
|
|
|
11
10
|
## Install
|
|
12
11
|
|
|
@@ -20,132 +19,189 @@ pnpm add @apicity/mcp-server
|
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
21
|
# Stdio server. Logs to stderr; stdout is reserved for MCP framing.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
--op-
|
|
22
|
+
|
|
23
|
+
# 1Password mode
|
|
24
|
+
npx -y @apicity/mcp-server@latest \
|
|
25
|
+
--op-vault apicity --op-token "$OP_SERVICE_ACCOUNT_TOKEN"
|
|
26
|
+
|
|
27
|
+
# .env file mode (no 1Password)
|
|
28
|
+
npx -y @apicity/mcp-server@latest --env-file ~/.config/apicity/.env
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
Use `@latest` with `npx`; bare `npx -y @apicity/mcp-server` can reuse an older
|
|
30
32
|
cached package that does not understand newer flags.
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
Credentials come from one of two modes:
|
|
35
|
+
|
|
36
|
+
- **1Password** — put each provider secret in a 1Password item named after the
|
|
37
|
+
env var (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, etc.) with the value in the
|
|
38
|
+
`password` field, then pass the vault name and a service-account token.
|
|
39
|
+
`--op-token` accepts a literal token, `env:VAR`, `$VAR`, or an existing env
|
|
40
|
+
var name; `APICITY_OP_VAULT` and `APICITY_OP_SERVICE_TOKEN` work instead of
|
|
41
|
+
the flags.
|
|
42
|
+
- **.env file** — a plain dotenv file of `KEY=VALUE` provider credentials.
|
|
43
|
+
Vars already set in the environment win; `op://` values are skipped.
|
|
44
|
+
|
|
45
|
+
### Claude Code
|
|
36
46
|
|
|
37
47
|
```bash
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
--op-
|
|
48
|
+
claude mcp add apicity -- \
|
|
49
|
+
npx -y @apicity/mcp-server@latest \
|
|
50
|
+
--op-vault apicity --op-token "$OP_SERVICE_ACCOUNT_TOKEN"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or with a .env file instead of 1Password:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
claude mcp add apicity -- \
|
|
57
|
+
npx -y @apicity/mcp-server@latest --env-file ~/.config/apicity/.env
|
|
41
58
|
```
|
|
42
59
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
The shell expands `"$OP_SERVICE_ACCOUNT_TOKEN"` when the `add` command runs,
|
|
61
|
+
so the token is stored as a literal in the client's MCP config — no `-e` env
|
|
62
|
+
plumbing needed.
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
### Codex
|
|
48
65
|
|
|
49
66
|
```bash
|
|
50
|
-
|
|
51
|
-
-e OP_SERVICE_ACCOUNT_TOKEN="$OP_SERVICE_ACCOUNT_TOKEN" \
|
|
52
|
-
-- \
|
|
67
|
+
codex mcp add apicity -- \
|
|
53
68
|
npx -y @apicity/mcp-server@latest \
|
|
54
|
-
--op-vault apicity
|
|
55
|
-
--op-service-token env:OP_SERVICE_ACCOUNT_TOKEN
|
|
69
|
+
--op-vault apicity --op-token "$OP_SERVICE_ACCOUNT_TOKEN"
|
|
56
70
|
```
|
|
57
71
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
Or add it to `~/.codex/config.toml` directly:
|
|
73
|
+
|
|
74
|
+
```toml
|
|
75
|
+
[mcp_servers.apicity]
|
|
76
|
+
command = "npx"
|
|
77
|
+
args = [
|
|
78
|
+
"-y",
|
|
79
|
+
"@apicity/mcp-server@latest",
|
|
80
|
+
"--op-vault",
|
|
81
|
+
"apicity",
|
|
82
|
+
"--op-token",
|
|
83
|
+
"ops_...",
|
|
84
|
+
]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Claude Desktop
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"mcpServers": {
|
|
92
|
+
"apicity": {
|
|
93
|
+
"command": "npx",
|
|
94
|
+
"args": [
|
|
95
|
+
"-y",
|
|
96
|
+
"@apicity/mcp-server@latest",
|
|
97
|
+
"--op-vault",
|
|
98
|
+
"apicity",
|
|
99
|
+
"--op-token",
|
|
100
|
+
"ops_..."
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
62
106
|
|
|
63
107
|
### Flags
|
|
64
108
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
| `--
|
|
70
|
-
| `--
|
|
71
|
-
| `--
|
|
72
|
-
| `--
|
|
109
|
+
One of `--op-vault` + `--op-token`, or `--env-file`, is required.
|
|
110
|
+
|
|
111
|
+
| Flag | Description |
|
|
112
|
+
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
113
|
+
| `--op-vault <vault>` | Resolve missing provider credentials from `op://<vault>/<ENV_VAR>/password` (or `APICITY_OP_VAULT`). |
|
|
114
|
+
| `--op-token <token>` | 1Password service-account token, `env:VAR`, `$VAR`, or env var name (or `APICITY_OP_SERVICE_TOKEN`). `--op-service-token` is an alias. |
|
|
115
|
+
| `--env-file <path>` | Load provider credentials from a dotenv-style file instead of 1Password. Set env vars win; `op://` values skip. |
|
|
116
|
+
| `--output-dir <path>` | Override where binary results and downloaded media URLs land. Defaults to `CLAUDE_PROJECT_DIR`, then cwd. |
|
|
117
|
+
| `--providers <csv>` | Allow-list of providers (default: every one with its env var set). |
|
|
118
|
+
| `--paygate-secret-file <path>` | File holding the shared HMAC secret used to verify paid-endpoint OTPs (see [Paid endpoints](#paid-endpoints)). |
|
|
119
|
+
| `--help` | Print usage. |
|
|
73
120
|
|
|
74
121
|
### Credentials
|
|
75
122
|
|
|
76
|
-
| Provider | Env var
|
|
77
|
-
| ------------ |
|
|
78
|
-
| `openai` | `OPENAI_API_KEY`
|
|
79
|
-
| `xai` | `XAI_API_KEY`
|
|
80
|
-
| `anthropic` | `ANTHROPIC_API_KEY`
|
|
81
|
-
| `fireworks` | `FIREWORKS_API_KEY`
|
|
82
|
-
| `fal` | `FAL_API_KEY`
|
|
83
|
-
| `dolthub` | `DOLTHUB_API_KEY`
|
|
84
|
-
| `kie` | `KIE_API_KEY`
|
|
85
|
-
| `kimicoding` | `KIMI_CODING_API_KEY`
|
|
86
|
-
| `alibaba` | `DASHSCOPE_API_KEY`
|
|
87
|
-
| `binance` | _(none — public APIs)_
|
|
88
|
-
| `elevenlabs` | `ELEVENLABS_API_KEY`
|
|
89
|
-
| `s3` | `S3_ACCESS_KEY_ID` + `S3_SECRET_ACCESS_KEY`
|
|
123
|
+
| Provider | Env var |
|
|
124
|
+
| ------------ | --------------------------------------------------------- |
|
|
125
|
+
| `openai` | `OPENAI_API_KEY` |
|
|
126
|
+
| `xai` | `XAI_API_KEY` |
|
|
127
|
+
| `anthropic` | `ANTHROPIC_API_KEY` |
|
|
128
|
+
| `fireworks` | `FIREWORKS_API_KEY` |
|
|
129
|
+
| `fal` | `FAL_API_KEY` |
|
|
130
|
+
| `dolthub` | `DOLTHUB_API_KEY` |
|
|
131
|
+
| `kie` | `KIE_API_KEY` |
|
|
132
|
+
| `kimicoding` | `KIMI_CODING_API_KEY` |
|
|
133
|
+
| `alibaba` | `DASHSCOPE_API_KEY` |
|
|
134
|
+
| `binance` | _(none — public APIs)_ |
|
|
135
|
+
| `elevenlabs` | `ELEVENLABS_API_KEY` |
|
|
136
|
+
| `s3` | `S3_ACCESS_KEY_ID` + `S3_SECRET_ACCESS_KEY` |
|
|
90
137
|
| `b2` | `B2_ACCESS_KEY_ID` + `B2_SECRET_ACCESS_KEY` + `B2_REGION` |
|
|
91
|
-
| `google` | `GOOGLE_API_KEY`
|
|
92
|
-
| `x` | `X_ACCESS_TOKEN`
|
|
93
|
-
| `ig` | `IG_ACCESS_TOKEN`
|
|
94
|
-
| `polymarket` | _(none for public data)_
|
|
95
|
-
| `youtube` | `YOUTUBE_ACCESS_TOKEN`
|
|
96
|
-
| `telegram` | `TELEGRAM_BOT_KEY`
|
|
97
|
-
| `free` | _(none — public APIs)_
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
existing provider secrets in one batch
|
|
101
|
-
to the child `op` process. Provider env vars
|
|
102
|
-
untouched.
|
|
103
|
-
startup error; without
|
|
138
|
+
| `google` | `GOOGLE_API_KEY` |
|
|
139
|
+
| `x` | `X_ACCESS_TOKEN` |
|
|
140
|
+
| `ig` | `IG_ACCESS_TOKEN` |
|
|
141
|
+
| `polymarket` | _(none for public data)_ |
|
|
142
|
+
| `youtube` | `YOUTUBE_ACCESS_TOKEN` |
|
|
143
|
+
| `telegram` | `TELEGRAM_BOT_KEY` |
|
|
144
|
+
| `free` | _(none — public APIs)_ |
|
|
145
|
+
|
|
146
|
+
In 1Password mode, the CLI lists the vault once before the server starts and
|
|
147
|
+
resolves existing provider secrets in one batch, with
|
|
148
|
+
`OP_SERVICE_ACCOUNT_TOKEN` scoped to the child `op` process. Provider env vars
|
|
149
|
+
already set are left untouched. With `--providers`, a missing requested secret
|
|
150
|
+
is a startup error; without it, missing vault items are skipped. With
|
|
151
|
+
`--env-file`, 1Password is skipped entirely (unless the op flags are also
|
|
152
|
+
given, in which case 1Password fills whatever the file left missing).
|
|
104
153
|
|
|
105
154
|
## Tool naming
|
|
106
155
|
|
|
107
|
-
Every tool is named `<provider>_<dotPath_with_underscores>` and corresponds
|
|
108
|
-
to a row in `scripts/endpoint-docs.tsv`.
|
|
156
|
+
Every tool is named `<provider>_<dotPath_with_underscores>` and corresponds
|
|
157
|
+
1-1 to a row in `scripts/endpoint-docs.tsv`. The tool description always
|
|
158
|
+
includes the upstream URL and docs URL. Examples:
|
|
109
159
|
|
|
110
160
|
- `openai_v1_chat_completions` → `POST https://api.openai.com/v1/chat/completions`
|
|
111
161
|
- `anthropic_v1_messages` → `POST https://api.anthropic.com/v1/messages`
|
|
112
162
|
- `xai_v1_images_generations` → `POST https://api.x.ai/v1/images/generations`
|
|
113
163
|
- `kie_api_v1_jobs_recordInfo` → `GET https://api.kie.ai/api/v1/jobs/recordInfo`
|
|
114
164
|
|
|
115
|
-
The tool description always includes the upstream URL and docs URL.
|
|
116
|
-
|
|
117
165
|
## Output handling
|
|
118
166
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
167
|
+
Binary results and downloaded media URLs land in `CLAUDE_PROJECT_DIR` when
|
|
168
|
+
Claude Code provides it, otherwise the current directory; `--output-dir`
|
|
169
|
+
overrides.
|
|
122
170
|
|
|
123
171
|
- **Binary responses** (`ArrayBuffer` / `Uint8Array`, e.g. `openai_v1_audio_speech`)
|
|
124
172
|
are written to the directory; the tool result is `{ savedTo, bytes }`.
|
|
125
173
|
- **JSON responses with media URLs** (keys `url`, `download_url`, `audio_url`,
|
|
126
|
-
`video_url`, `image_url`, `file_url`,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
174
|
+
`video_url`, `image_url`, `file_url`, snake or camel case) are scanned
|
|
175
|
+
shallowly; each URL is downloaded and a sibling `*_savedTo` field is added.
|
|
176
|
+
Failures are inlined as `*_savedTo: "error: ..."` and don't break the
|
|
177
|
+
response.
|
|
130
178
|
- Streaming endpoints (anthropic streams, etc.) are buffered into an array.
|
|
131
179
|
|
|
132
180
|
## Paid endpoints
|
|
133
181
|
|
|
134
|
-
A few
|
|
135
|
-
|
|
182
|
+
A few tools incur direct marginal cost (`kie_post_api_v1_jobs_create_task` for
|
|
183
|
+
general media generation, plus the direct VEO tools
|
|
136
184
|
`kie_post_api_v1_veo_generate` and `kie_post_api_v1_veo_extend`) and are gated
|
|
137
185
|
behind a single-use OTP. The server is the **code client**: pass
|
|
138
186
|
`--paygate-secret-file <path>` and it holds the shared HMAC secret to
|
|
139
187
|
**verify** OTPs — it never mints them. Paid tools advertise an extra optional
|
|
140
188
|
`otp` argument.
|
|
141
189
|
|
|
142
|
-
To run a paid call, a human mints an OTP out-of-band from the same secret
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
190
|
+
To run a paid call, a human mints an OTP out-of-band from the same secret and
|
|
191
|
+
the caller passes it as the tool's `otp` argument:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
apicity-paygate otp mint \
|
|
195
|
+
--secret-file ./paygate.secret \
|
|
196
|
+
--dot-path api.v1.jobs.createTask \
|
|
197
|
+
--payload-file request.json \
|
|
198
|
+
--ttl 10m
|
|
199
|
+
# direct VEO: --dot-path api.v1.veo.generate (or api.v1.veo.extend)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The AI driving the tool never sees the secret, so it cannot self-approve: with
|
|
203
|
+
no `otp` (or no secret configured) the paid call fails closed. See
|
|
204
|
+
[@apicity/cost](../provider/cost) for the full spec.
|
|
149
205
|
|
|
150
206
|
## Programmatic use
|
|
151
207
|
|
|
@@ -161,29 +217,6 @@ await startServer({
|
|
|
161
217
|
`buildRegistry()` and `zodToJsonSchema()` are also exported if you want to
|
|
162
218
|
embed the registry into your own MCP server.
|
|
163
219
|
|
|
164
|
-
## Claude Desktop config
|
|
165
|
-
|
|
166
|
-
```json
|
|
167
|
-
{
|
|
168
|
-
"mcpServers": {
|
|
169
|
-
"apicity": {
|
|
170
|
-
"command": "npx",
|
|
171
|
-
"args": [
|
|
172
|
-
"-y",
|
|
173
|
-
"@apicity/mcp-server@latest",
|
|
174
|
-
"--op-vault",
|
|
175
|
-
"apicity",
|
|
176
|
-
"--op-service-token",
|
|
177
|
-
"env:OP_SERVICE_ACCOUNT_TOKEN"
|
|
178
|
-
],
|
|
179
|
-
"env": {
|
|
180
|
-
"OP_SERVICE_ACCOUNT_TOKEN": "ops_..."
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
220
|
Part of the [apicity](https://github.com/justintanner/apicity) monorepo.
|
|
188
221
|
|
|
189
222
|
## License
|
package/dist/endpoint-docs.tsv
CHANGED
|
@@ -208,6 +208,7 @@ dolthub v1alpha1.sql.read GET https://www.dolthub.com/api/v1alpha1/{owner}/{data
|
|
|
208
208
|
dolthub v1alpha1.sql.write POST https://www.dolthub.com/api/v1alpha1/{owner}/{database}/write/{fromBranch}/{toBranch}{query} https://www.dolthub.com/docs/products/dolthub/api/sql
|
|
209
209
|
dolthub v1alpha1.sql.writePoll GET https://www.dolthub.com/api/v1alpha1/{owner}/{database}/write{query} https://www.dolthub.com/docs/products/dolthub/api/sql
|
|
210
210
|
dolthub v1alpha1.user GET https://www.dolthub.com/api/v1alpha1/user
|
|
211
|
+
elevenlabs v1.models GET https://api.elevenlabs.io/v1/models https://elevenlabs.io/docs/api-reference/models/list
|
|
211
212
|
elevenlabs v1.voices GET https://api.elevenlabs.io/v1/voices/{voiceId} https://elevenlabs.io/docs/api-reference/voices/get
|
|
212
213
|
elevenlabs v1.voices.settings GET https://api.elevenlabs.io/v1/voices/{voiceId}/settings https://elevenlabs.io/docs/api-reference/voices/get-settings
|
|
213
214
|
elevenlabs v1.soundGeneration POST https://api.elevenlabs.io/v1/sound-generation https://elevenlabs.io/docs/api-reference/text-to-sound-effects/convert
|
package/dist/src/cli.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface ParsedArgs {
|
|
|
4
4
|
paygateSecretFile?: string;
|
|
5
5
|
opVault?: string;
|
|
6
6
|
opServiceToken?: string;
|
|
7
|
+
envFile?: string;
|
|
7
8
|
help: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface ResolvedOnePasswordOptions {
|
|
@@ -14,7 +15,7 @@ export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
|
14
15
|
export declare function resolveOutputDir(explicitOutputDir?: string, env?: NodeJS.ProcessEnv, cwd?: string): string;
|
|
15
16
|
export declare function resolveOpVault(explicitOpVault?: string, env?: NodeJS.ProcessEnv): string | undefined;
|
|
16
17
|
export declare function resolveOpServiceToken(explicitOpServiceToken?: string, env?: NodeJS.ProcessEnv): string | undefined;
|
|
17
|
-
export declare function
|
|
18
|
+
export declare function resolveOnePasswordOptions(args: Pick<ParsedArgs, "opVault" | "opServiceToken" | "envFile">, env?: NodeJS.ProcessEnv): ResolvedOnePasswordOptions | undefined;
|
|
18
19
|
export declare function printHelp(): void;
|
|
19
20
|
export declare function runCli(argv?: string[]): Promise<void>;
|
|
20
21
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/src/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAoCpD;AAED,wBAAgB,gBAAgB,CAC9B,iBAAiB,CAAC,EAAE,MAAM,EAC1B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,SAAgB,GAClB,MAAM,CAER;AAED,wBAAgB,cAAc,CAC5B,eAAe,CAAC,EAAE,MAAM,EACxB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,qBAAqB,CACnC,sBAAsB,CAAC,EAAE,MAAM,EAC/B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAWpB;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAAC,EAChE,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,0BAA0B,GAAG,SAAS,CAiBxC;AAED,wBAAgB,SAAS,IAAI,IAAI,CAsChC;AAED,wBAAsB,MAAM,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BxE"}
|
package/dist/src/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { startServer } from "./server.js";
|
|
3
3
|
import { fillOnePasswordEnv } from "./one-password.js";
|
|
4
|
+
import { loadEnvFile } from "./env-file.js";
|
|
4
5
|
export function parseArgs(argv) {
|
|
5
6
|
const out = { help: false };
|
|
6
7
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -29,12 +30,24 @@ export function parseArgs(argv) {
|
|
|
29
30
|
else if (a.startsWith("--op-vault=")) {
|
|
30
31
|
out.opVault = a.slice(11);
|
|
31
32
|
}
|
|
33
|
+
else if (a === "--op-token") {
|
|
34
|
+
out.opServiceToken = argv[++i];
|
|
35
|
+
}
|
|
36
|
+
else if (a.startsWith("--op-token=")) {
|
|
37
|
+
out.opServiceToken = a.slice(11);
|
|
38
|
+
}
|
|
32
39
|
else if (a === "--op-service-token") {
|
|
33
40
|
out.opServiceToken = argv[++i];
|
|
34
41
|
}
|
|
35
42
|
else if (a.startsWith("--op-service-token=")) {
|
|
36
43
|
out.opServiceToken = a.slice(19);
|
|
37
44
|
}
|
|
45
|
+
else if (a === "--env-file") {
|
|
46
|
+
out.envFile = argv[++i];
|
|
47
|
+
}
|
|
48
|
+
else if (a.startsWith("--env-file=")) {
|
|
49
|
+
out.envFile = a.slice(11);
|
|
50
|
+
}
|
|
38
51
|
else {
|
|
39
52
|
throw new Error(`unknown arg: ${a}`);
|
|
40
53
|
}
|
|
@@ -59,14 +72,20 @@ export function resolveOpServiceToken(explicitOpServiceToken, env = process.env)
|
|
|
59
72
|
}
|
|
60
73
|
return env[tokenOrRef] ?? tokenOrRef;
|
|
61
74
|
}
|
|
62
|
-
export function
|
|
75
|
+
export function resolveOnePasswordOptions(args, env = process.env) {
|
|
63
76
|
const vault = resolveOpVault(args.opVault, env);
|
|
77
|
+
const serviceAccountToken = resolveOpServiceToken(args.opServiceToken, env);
|
|
78
|
+
if (!vault && !serviceAccountToken) {
|
|
79
|
+
if (args.envFile)
|
|
80
|
+
return undefined;
|
|
81
|
+
throw new Error("Credentials are required: pass --op-vault and --op-token, " +
|
|
82
|
+
"or --env-file <path>.");
|
|
83
|
+
}
|
|
64
84
|
if (!vault) {
|
|
65
|
-
throw new Error("--op-vault is required.");
|
|
85
|
+
throw new Error("--op-vault is required when --op-token is set.");
|
|
66
86
|
}
|
|
67
|
-
const serviceAccountToken = resolveOpServiceToken(args.opServiceToken, env);
|
|
68
87
|
if (!serviceAccountToken) {
|
|
69
|
-
throw new Error("--op-
|
|
88
|
+
throw new Error("--op-token is required when --op-vault is set.");
|
|
70
89
|
}
|
|
71
90
|
return { vault, serviceAccountToken };
|
|
72
91
|
}
|
|
@@ -75,19 +94,23 @@ export function printHelp() {
|
|
|
75
94
|
"apicity-mcp — MCP server exposing every @apicity provider endpoint as a tool.",
|
|
76
95
|
"",
|
|
77
96
|
"Usage:",
|
|
78
|
-
" apicity-mcp --op-vault <vault> --op-
|
|
97
|
+
" apicity-mcp --op-vault <vault> --op-token <token|env:VAR>",
|
|
98
|
+
" [--output-dir <path>] [--providers <csv>]",
|
|
99
|
+
" apicity-mcp --env-file <path>",
|
|
79
100
|
" [--output-dir <path>] [--providers <csv>]",
|
|
80
101
|
"",
|
|
81
102
|
"Options:",
|
|
82
|
-
" --op-vault <vault>
|
|
103
|
+
" --op-vault <vault> Resolve missing provider credentials from 1Password.",
|
|
83
104
|
" Looks for op://<vault>/<ENV_VAR>/password.",
|
|
84
105
|
" Can also be set with APICITY_OP_VAULT.",
|
|
85
|
-
" --op-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
106
|
+
" --op-token <token|env:VAR>",
|
|
107
|
+
" 1Password service-account token for non-interactive",
|
|
108
|
+
" credential reads. Literal tokens, env:VAR, $VAR, or an",
|
|
109
|
+
" existing env var name are accepted. Can also be set with",
|
|
110
|
+
" APICITY_OP_SERVICE_TOKEN. --op-service-token is an alias.",
|
|
111
|
+
" --env-file <path> Load provider credentials from a dotenv-style file",
|
|
112
|
+
" (KEY=VALUE lines) instead of 1Password. Vars already set",
|
|
113
|
+
" in the environment win; op:// values are skipped.",
|
|
91
114
|
" --output-dir <path> Directory to write binary results and downloaded media URLs.",
|
|
92
115
|
" Defaults to CLAUDE_PROJECT_DIR, then the current directory.",
|
|
93
116
|
" --providers <csv> Comma-separated provider allow-list (e.g. openai,xai,anthropic).",
|
|
@@ -109,12 +132,17 @@ export async function runCli(argv = process.argv.slice(2)) {
|
|
|
109
132
|
printHelp();
|
|
110
133
|
return;
|
|
111
134
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
135
|
+
if (args.envFile) {
|
|
136
|
+
loadEnvFile(args.envFile);
|
|
137
|
+
}
|
|
138
|
+
const onePassword = resolveOnePasswordOptions(args);
|
|
139
|
+
if (onePassword) {
|
|
140
|
+
await fillOnePasswordEnv({
|
|
141
|
+
vault: onePassword.vault,
|
|
142
|
+
enabledProviders: args.enabledProviders,
|
|
143
|
+
serviceAccountToken: onePassword.serviceAccountToken,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
118
146
|
const paygateSecret = args.paygateSecretFile
|
|
119
147
|
? readFileSync(args.paygateSecretFile, "utf8").trim()
|
|
120
148
|
: undefined;
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM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AC,GAAG,MAAM,kBAAkB,IAAI,cAAc,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-file.d.ts","sourceRoot":"","sources":["../../src/env-file.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,IAAI,CAON;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAarE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
export function loadEnvFile(path, env = process.env) {
|
|
3
|
+
const content = readEnvFile(path);
|
|
4
|
+
for (const [key, value] of parseEnvFile(content)) {
|
|
5
|
+
if (hasResolvedEnvValue(env[key]))
|
|
6
|
+
continue;
|
|
7
|
+
if (value.startsWith("op://"))
|
|
8
|
+
continue;
|
|
9
|
+
env[key] = value;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function parseEnvFile(content) {
|
|
13
|
+
const entries = [];
|
|
14
|
+
for (const rawLine of content.split(/\r?\n/)) {
|
|
15
|
+
const line = rawLine.trim();
|
|
16
|
+
if (line === "" || line.startsWith("#"))
|
|
17
|
+
continue;
|
|
18
|
+
const eq = line.indexOf("=");
|
|
19
|
+
if (eq <= 0)
|
|
20
|
+
continue;
|
|
21
|
+
const key = line.slice(0, eq).trim();
|
|
22
|
+
const value = stripQuotes(line.slice(eq + 1).trim());
|
|
23
|
+
if (key === "")
|
|
24
|
+
continue;
|
|
25
|
+
entries.push([key, value]);
|
|
26
|
+
}
|
|
27
|
+
return entries;
|
|
28
|
+
}
|
|
29
|
+
function readEnvFile(path) {
|
|
30
|
+
try {
|
|
31
|
+
return readFileSync(path, "utf8");
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
throw new Error(`--env-file ${path} could not be read: ${errorMessage(err)}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function stripQuotes(value) {
|
|
38
|
+
if (value.length < 2)
|
|
39
|
+
return value;
|
|
40
|
+
const first = value[0];
|
|
41
|
+
const last = value[value.length - 1];
|
|
42
|
+
if ((first === '"' && last === '"') || (first === "'" && last === "'")) {
|
|
43
|
+
return value.slice(1, -1);
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
function hasResolvedEnvValue(value) {
|
|
48
|
+
return value !== undefined && value !== "" && !value.startsWith("op://");
|
|
49
|
+
}
|
|
50
|
+
function errorMessage(err) {
|
|
51
|
+
return err instanceof Error ? err.message : String(err);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=env-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-file.js","sourceRoot":"","sources":["../../src/env-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,UAAU,WAAW,CACzB,IAAY,EACZ,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAClC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;QACjD,IAAI,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAAE,SAAS;QAC5C,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;YAAE,SAAS;QACxC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAA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AAG,CAAC,EAAE,CAAC;QACvE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAyB;IACpD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,YAAY,CAAC,GAAY;IAChC,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { startServer, type StartServerOptions } from "./server.js";
|
|
2
|
-
export { parseArgs, resolveOpServiceToken, resolveOpVault, resolveOutputDir,
|
|
2
|
+
export { parseArgs, resolveOpServiceToken, resolveOpVault, resolveOutputDir, resolveOnePasswordOptions, type ParsedArgs, type ResolvedOnePasswordOptions, } from "./cli.js";
|
|
3
|
+
export { loadEnvFile, parseEnvFile } from "./env-file.js";
|
|
3
4
|
export { fillOnePasswordEnv, getProviderEnvVars, injectOnePasswordSecrets, listOnePasswordItemTitles, onePasswordRef, readOnePasswordSecret, type OnePasswordEnvOptions, type OpInject, type OpListItemTitles, type OpRead, } from "./one-password.js";
|
|
4
5
|
export { buildRegistry, loadTsv, makeToolName, toSnakeCase, type Endpoint, type EndpointTsvRow, type BuildRegistryOptions, } from "./registry.js";
|
|
5
6
|
export { PROVIDERS, type ProviderSpec } from "./providers.js";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,UAAU,EACf,KAAK,0BAA0B,GAChC,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,MAAM,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,EACZ,WAAW,EACX,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,QAAQ,GACT,MAAM,aAAa,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { startServer } from "./server.js";
|
|
2
|
-
export { parseArgs, resolveOpServiceToken, resolveOpVault, resolveOutputDir,
|
|
2
|
+
export { parseArgs, resolveOpServiceToken, resolveOpVault, resolveOutputDir, resolveOnePasswordOptions, } from "./cli.js";
|
|
3
|
+
export { loadEnvFile, parseEnvFile } from "./env-file.js";
|
|
3
4
|
export { fillOnePasswordEnv, getProviderEnvVars, injectOnePasswordSecrets, listOnePasswordItemTitles, onePasswordRef, readOnePasswordSecret, } from "./one-password.js";
|
|
4
5
|
export { buildRegistry, loadTsv, makeToolName, toSnakeCase, } from "./registry.js";
|
|
5
6
|
export { PROVIDERS } from "./providers.js";
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA2B,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA2B,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,GAG1B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,cAAc,EACd,qBAAqB,GAKtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,EACZ,WAAW,GAIZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,QAAQ,GACT,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apicity/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Optional MCP (Model Context Protocol) server that exposes every @apicity provider endpoint as a tool.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -47,27 +47,27 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
50
|
-
"@apicity/
|
|
51
|
-
"@apicity/
|
|
52
|
-
"@apicity/
|
|
53
|
-
"@apicity/
|
|
54
|
-
"@apicity/
|
|
55
|
-
"@apicity/
|
|
56
|
-
"@apicity/
|
|
57
|
-
"@apicity/
|
|
58
|
-
"@apicity/
|
|
59
|
-
"@apicity/
|
|
60
|
-
"@apicity/
|
|
61
|
-
"@apicity/
|
|
62
|
-
"@apicity/kimicoding": "0.
|
|
63
|
-
"@apicity/polymarket": "0.
|
|
64
|
-
"@apicity/openai": "0.
|
|
65
|
-
"@apicity/s3": "0.
|
|
66
|
-
"@apicity/telegram": "0.
|
|
67
|
-
"@apicity/kie": "0.
|
|
68
|
-
"@apicity/
|
|
69
|
-
"@apicity/
|
|
70
|
-
"@apicity/youtube": "0.
|
|
50
|
+
"@apicity/anthropic": "0.4.0",
|
|
51
|
+
"@apicity/alibaba": "0.4.0",
|
|
52
|
+
"@apicity/binance": "0.4.0",
|
|
53
|
+
"@apicity/dolthub": "0.4.0",
|
|
54
|
+
"@apicity/b2": "0.4.0",
|
|
55
|
+
"@apicity/elevenlabs": "0.4.0",
|
|
56
|
+
"@apicity/fal": "0.4.0",
|
|
57
|
+
"@apicity/fireworks": "0.4.0",
|
|
58
|
+
"@apicity/cost": "0.4.0",
|
|
59
|
+
"@apicity/free-media-upload": "0.4.0",
|
|
60
|
+
"@apicity/google": "0.4.0",
|
|
61
|
+
"@apicity/meta": "0.4.0",
|
|
62
|
+
"@apicity/kimicoding": "0.4.0",
|
|
63
|
+
"@apicity/polymarket": "0.4.0",
|
|
64
|
+
"@apicity/openai": "0.4.0",
|
|
65
|
+
"@apicity/s3": "0.4.0",
|
|
66
|
+
"@apicity/telegram": "0.4.0",
|
|
67
|
+
"@apicity/kie": "0.4.0",
|
|
68
|
+
"@apicity/x": "0.4.0",
|
|
69
|
+
"@apicity/xai": "0.4.0",
|
|
70
|
+
"@apicity/youtube": "0.4.0"
|
|
71
71
|
},
|
|
72
72
|
"homepage": "https://github.com/justintanner/apicity#readme",
|
|
73
73
|
"bugs": {
|