@xberg-io/opencode-liter-llm 2.2.1 → 2.2.4

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.
Files changed (39) hide show
  1. package/.opencode/ai-rulez-bundle.json +25 -16
  2. package/.opencode/ai-rulez-content.js +3 -3
  3. package/.opencode/commands/liter-llm-chat.md +14 -0
  4. package/.opencode/commands/liter-llm-stream.md +14 -0
  5. package/.opencode/plugins/liter-llm.js +9 -21
  6. package/.opencode/skills/liter-llm/SKILL.md +18 -24
  7. package/.opencode/skills/liter-llm/index.md +10 -0
  8. package/.opencode/skills/{calling-llms → liter-llm-calling-llms}/SKILL.md +13 -7
  9. package/.opencode/skills/liter-llm-calling-llms/index.md +10 -0
  10. package/.opencode/skills/{embeddings-and-search → liter-llm-embeddings-and-search}/SKILL.md +3 -3
  11. package/.opencode/skills/liter-llm-embeddings-and-search/index.md +10 -0
  12. package/.opencode/skills/{running-the-proxy → liter-llm-running-the-proxy}/SKILL.md +3 -3
  13. package/.opencode/skills/liter-llm-running-the-proxy/index.md +10 -0
  14. package/.opencode/skills/{streaming-responses → liter-llm-streaming-responses}/SKILL.md +3 -3
  15. package/.opencode/skills/liter-llm-streaming-responses/index.md +10 -0
  16. package/.opencode/skills/{tool-calling → liter-llm-tool-calling}/SKILL.md +3 -3
  17. package/.opencode/skills/liter-llm-tool-calling/index.md +10 -0
  18. package/.opencode/skills/liter-llm-using-the-mcp-server/SKILL.md +91 -0
  19. package/.opencode/skills/liter-llm-using-the-mcp-server/index.md +10 -0
  20. package/.pi/prompts/liter-llm-chat.md +14 -0
  21. package/.pi/prompts/liter-llm-stream.md +14 -0
  22. package/.pi/skills/liter-llm/SKILL.md +208 -0
  23. package/.pi/skills/liter-llm/index.md +10 -0
  24. package/.pi/skills/liter-llm-calling-llms/SKILL.md +75 -0
  25. package/.pi/skills/liter-llm-calling-llms/index.md +10 -0
  26. package/.pi/skills/liter-llm-embeddings-and-search/SKILL.md +81 -0
  27. package/.pi/skills/liter-llm-embeddings-and-search/index.md +10 -0
  28. package/.pi/skills/liter-llm-running-the-proxy/SKILL.md +74 -0
  29. package/.pi/skills/liter-llm-running-the-proxy/index.md +10 -0
  30. package/.pi/skills/liter-llm-streaming-responses/SKILL.md +63 -0
  31. package/.pi/skills/liter-llm-streaming-responses/index.md +10 -0
  32. package/.pi/skills/liter-llm-tool-calling/SKILL.md +77 -0
  33. package/.pi/skills/liter-llm-tool-calling/index.md +10 -0
  34. package/.pi/skills/liter-llm-using-the-mcp-server/SKILL.md +91 -0
  35. package/.pi/skills/liter-llm-using-the-mcp-server/index.md +10 -0
  36. package/README.md +151 -14
  37. package/package.json +76 -21
  38. package/scripts/mcp-launch.sh +6 -5
  39. package/.opencode/skills/using-the-mcp-server/SKILL.md +0 -63
@@ -0,0 +1,91 @@
1
+ ---
2
+ description: Use when calling LLM APIs through the liter-llm MCP server's 22 tools, and to decide when MCP beats the CLI or SDK. Covers the tool surface, the auto-installing launcher, and authentication.
3
+ name: liter-llm-using-the-mcp-server
4
+ ---
5
+
6
+ <!--
7
+ AI-RULEZ :: GENERATED FILE — DO NOT EDIT
8
+ Content-Hash: blake3:6925dd58f9790a1cc57f093167cf3b430886393ff3792d28003f15269b5546a2
9
+ Source-Hash: blake3:b4401694fa726347666d3c38e03983129e7cacf42d479c669a3702937e26a7ff
10
+ Schema-Version: v1
11
+ -->
12
+
13
+ # Using the MCP Server
14
+
15
+ The `liter-llm` MCP server exposes 22 tools that mirror the proxy's REST
16
+ endpoints, so an MCP-compatible client (Claude Code, Claude Desktop) can call
17
+ 174 LLM providers as tools with no glue code.
18
+
19
+ ## Standalone skill installation
20
+
21
+ Installing this skill alone does not register an MCP server or include the plugin launcher.
22
+ Install the CLI (for example, `brew install xberg-io/tap/liter-llm`), then configure your MCP client with
23
+ `liter-llm mcp --transport stdio` as its stdio command. The full product plugin supplies registration where
24
+ the runtime supports MCP.
25
+
26
+ ## How it runs in this plugin
27
+
28
+ The plugin auto-registers the server. Its command is the bundled launcher
29
+ `scripts/mcp-launch.sh`, which execs `liter-llm mcp --transport stdio`. On first
30
+ run the launcher resolves a `liter-llm` binary: it reuses one on `PATH`, then
31
+ tries `npx`/`uvx`, then Homebrew, then downloads a prebuilt
32
+ from the tool's latest GitHub release. Override with
33
+ `LITER_LLM_LAUNCHER=auto|npx|uvx|brew|download`.
34
+
35
+ To run it manually:
36
+
37
+ ```bash
38
+ liter-llm mcp --transport stdio # for Claude Code / Claude Desktop
39
+ liter-llm mcp --transport http --port 3001
40
+ ```
41
+
42
+ ## Configure model routing
43
+
44
+ Provider-backed tools use the proxy model registry. Create `liter-llm-proxy.toml` in the
45
+ working directory, or pass `--config /absolute/path/liter-llm-proxy.toml` when launching:
46
+
47
+ ```toml
48
+ [[models]]
49
+ name = "gpt-4o"
50
+ provider_model = "openai/gpt-4o"
51
+ ```
52
+
53
+ Supply `OPENAI_API_KEY` in the MCP process environment, then call `chat` using the
54
+ configured name `gpt-4o`. `list_models` shows configured names; an unknown model is a
55
+ request error. Missing credentials are also reported on provider-backed requests.
56
+ Gemini filters host credentials: install with `--skip-settings` and configure the selected
57
+ provider through `gemini extensions config liter-llm "OpenAI key"`. Local stdio does not
58
+ need a separate proxy virtual key.
59
+
60
+ ## The 22 tools
61
+
62
+ Modality tools: `chat`, `embed`, `generate_image`, `speech`, `transcribe`,
63
+ `moderate`, `rerank`, `search`, `ocr`.
64
+
65
+ Model listing: `list_models`.
66
+
67
+ File operations: `create_file`, `list_files`, `retrieve_file`, `delete_file`,
68
+ `file_content`.
69
+
70
+ Batch operations: `create_batch`, `list_batches`, `retrieve_batch`,
71
+ `cancel_batch`.
72
+
73
+ Responses API: `create_response`, `retrieve_response`, `cancel_response`.
74
+
75
+ ## Authentication
76
+
77
+ Local stdio trusts the invoking local client by default, so the registered command starts
78
+ without extra proxy authentication configuration. Provider API keys still come from environment
79
+ variables and are needed for provider-backed requests.
80
+
81
+ To apply a restricted virtual key, configure `mcp.stdio_key_id`; an unknown key fails startup.
82
+ Set `mcp.stdio_trust_local = false` to require an explicit virtual key. HTTP transport retains
83
+ its authentication policy; the local stdio default does not disable HTTP authorization.
84
+
85
+ ## When to prefer MCP over the CLI or SDK
86
+
87
+ - **Prefer MCP** inside an agent session: the agent invokes tools directly, with
88
+ no code to write or process to manage.
89
+ - **Prefer the SDK** when building application software in a specific language.
90
+ - **Prefer the proxy** when many apps or teams need a shared OpenAI-compatible
91
+ endpoint with keys, budgets, and rate limits.
@@ -0,0 +1,10 @@
1
+ <!--
2
+ AI-RULEZ :: GENERATED FILE — DO NOT EDIT
3
+ Content-Hash: blake3:f82f5f5a906c27ad7e64d5944e1ab1c02685f1df4d61b3b312a8b1d474dfb465
4
+ Source-Hash: blake3:b4401694fa726347666d3c38e03983129e7cacf42d479c669a3702937e26a7ff
5
+ Schema-Version: v1
6
+ -->
7
+
8
+ # Concepts
9
+
10
+ * [Using The Mcp Server](SKILL.md) - Use when calling LLM APIs through the liter-llm MCP server's 22 tools, and to decide when MCP beats the CLI or SDK. Covers the tool surface, the auto-installing launcher, and authentication.
package/README.md CHANGED
@@ -17,13 +17,50 @@ Self-host:
17
17
  /plugin install liter-llm@liter-llm
18
18
  ```
19
19
 
20
+ ### Kimi installation and compatibility
21
+
22
+ From a checkout of this repository, install with the Python Kimi CLI version used for native
23
+ plugin validation:
24
+
25
+ ```sh
26
+ uvx --from kimi-cli==1.51.0 kimi plugin install ./plugin
27
+ ```
28
+
29
+ Native plugin installation was validated with Python Kimi CLI 1.51.0. The replacement
30
+ `@moonshot-ai/kimi-code` 2.1.1 does not provide a `plugin` CLI subcommand; its interactive
31
+ plugin loading has not been verified. These results do not establish compatibility with
32
+ newer Kimi releases.
33
+
34
+ ### Pi
35
+
36
+ From a checkout of this repository, run:
37
+
38
+ ```bash
39
+ pi install ./plugin
40
+ ```
41
+
42
+ Once a plugin release includes Pi support, use the shared OpenCode/Pi npm package:
43
+
44
+ ```bash
45
+ pi install npm:@xberg-io/opencode-liter-llm
46
+ ```
47
+
48
+ Pi discovers skills from `.pi/skills` and prompt templates from `.pi/prompts`.
49
+ Use `/liter-llm-chat` and `/liter-llm-stream` to start a task.
50
+ Install the CLI separately using the instructions below. The Pi package does not
51
+ register MCP servers, hooks, or executable extensions. The MCP integration
52
+ sections below apply to clients with MCP support.
53
+
54
+ Git installs use the repository root's `package.json` resource paths. GitHub
55
+ hosts the checkout resources; the existing npm plugin release publishes the same
56
+ Pi content alongside the OpenCode adapter. No separate Pi release job is needed.
57
+
20
58
  ### Binary requirement
21
59
 
22
60
  The bundled MCP launcher (`scripts/mcp-launch.sh`) resolves a `liter-llm` binary
23
61
  automatically on first run: it reuses one already on `PATH`, then tries
24
- `npx`/`uvx`, then Homebrew, then a checksum-verified prebuilt binary from the
25
- tool's latest GitHub release. No manual install is required to use the MCP
26
- server.
62
+ `npx`/`uvx`, then Homebrew, then a prebuilt binary from the
63
+ tool's latest GitHub release. If every method fails, install a CLI with MCP support using the commands below.
27
64
 
28
65
  To install the CLI yourself (also gives you the proxy server):
29
66
 
@@ -32,7 +69,7 @@ brew install xberg-io/tap/liter-llm
32
69
  # or from crates.io (compiles from source):
33
70
  cargo install liter-llm-cli
34
71
  # or run it without a persistent install (the CLI proxy package self-installs the binary):
35
- npx @xberg-io/liter-llm-cli --help
72
+ pnpm dlx @xberg-io/liter-llm-cli --help
36
73
  uvx --from liter-llm-cli liter-llm --help
37
74
  # or download a prebuilt binary from the latest GitHub release:
38
75
  # https://github.com/xberg-io/liter-llm/releases/latest
@@ -48,12 +85,28 @@ Set provider API keys via environment variables (`OPENAI_API_KEY`,
48
85
  | Skill | Trigger |
49
86
  |-------|---------|
50
87
  | **liter-llm** | Universal LLM client surface — chat, streaming, tools, embeddings, image/audio, moderation, search, OCR, reranking — across 174 providers and 14 language bindings. Use when writing LLM code in any supported language or choosing between the SDK, proxy, and MCP server. |
51
- | **calling-llms** | Use when sending chat completions and routing to a specific provider via the `provider/model` prefix. |
52
- | **streaming-responses** | Use when streaming tokens incrementally over SSE or async iterators. |
53
- | **tool-calling** | Use when defining functions/tools for the model to call, or requesting structured outputs. |
54
- | **embeddings-and-search** | Use when generating embeddings, calling the web-search providers, or running OCR over documents. |
55
- | **running-the-proxy** | Use when running the `liter-llm api` OpenAI-compatible gateway with virtual keys, rate limits, and budgets. |
56
- | **using-the-mcp-server** | Use when calling LLM APIs through the 22 MCP tools, and to decide when MCP beats the CLI or SDK. |
88
+ | **liter-llm-calling-llms** | Use when sending chat completions and routing to a specific provider via the `provider/model` prefix. |
89
+ | **liter-llm-streaming-responses** | Use when streaming tokens incrementally over SSE or async iterators. |
90
+ | **liter-llm-tool-calling** | Use when defining functions/tools for the model to call, or requesting structured outputs. |
91
+ | **liter-llm-embeddings-and-search** | Use when generating embeddings, calling the web-search providers, or running OCR over documents. |
92
+ | **liter-llm-running-the-proxy** | Use when running the `liter-llm api` OpenAI-compatible gateway with virtual keys, rate limits, and budgets. |
93
+ | **liter-llm-using-the-mcp-server** | Use when calling LLM APIs through the 22 MCP tools, and to decide when MCP beats the CLI or SDK. |
94
+
95
+ ## CLI release compatibility
96
+
97
+ Published CLI 2.2.3 predates the local-stdio trust and deferred-provider-credential fixes.
98
+ Until a CLI release includes them, use a source build for startup without an extra auth config:
99
+
100
+ ```sh
101
+ cargo install --git https://github.com/xberg-io/liter-llm \
102
+ --rev f14fb8862f9cc73e2c4ab38a2876efe77fab8bf4 --locked liter-llm-cli
103
+ ```
104
+
105
+ Put the installed binary on the assistant's PATH. If a plugin has already cached an older binary,
106
+ remove that plugin's `bin/liter-llm` (or `bin/liter-llm.exe`) before retrying so it selects the source build.
107
+ The released 2.2.3 binary requires `mcp.stdio_trust_local = true` or a configured `mcp.stdio_key_id`;
108
+ configured providers may also require credentials at startup. The source build defers missing provider
109
+ credentials until a request uses that provider. HTTP authentication remains configured separately.
57
110
 
58
111
  ## MCP server
59
112
 
@@ -75,14 +128,16 @@ through to the next on any failure (override with
75
128
  `LITER_LLM_LAUNCHER=auto|npx|uvx|brew|download`):
76
129
 
77
130
  1. Any working `liter-llm` already cached in the plugin's `bin/` or on `PATH`.
78
- 2. `npx @xberg-io/liter-llm-cli` — the published npm CLI proxy package self-installs/runs
131
+ 2. `pnpm dlx @xberg-io/liter-llm-cli` — the published npm CLI proxy package self-installs/runs
79
132
  the binary (probed first; falls through if not published yet).
80
133
  3. `uvx --from liter-llm-cli liter-llm` — the published PyPI CLI proxy package
81
134
  (probed first; falls through if not published yet).
82
135
  4. `brew install xberg-io/tap/liter-llm` if Homebrew is available.
83
- 5. A checksum-verified prebuilt binary from the tool's *latest* GitHub release
84
- (`liter-llm-<latest-version>-<target>.tar.gz`, verified against
85
- `SHA256SUMS-<latest-version>.txt`). The tool version is resolved from the
136
+ 5. A prebuilt binary from the tool's *latest* GitHub release
137
+ (`liter-llm-<latest-version>-<target>.tar.gz`). Its hash is checked against
138
+ `SHA256SUMS-<latest-version>.txt` when the manifest and a hashing tool are available.
139
+ Missing checksums cause an explicit warning and HTTPS-only download fallback;
140
+ a hash mismatch fails. The tool version is resolved from the
86
141
  GitHub API — it is independent of the plugin's own version.
87
142
 
88
143
  The `@xberg-io/*` / `liter-llm` binding packages (NAPI-RS / PyO3) are language
@@ -152,6 +207,22 @@ Embed these five paragraphs with openai/text-embedding-3-small and rank them aga
152
207
 
153
208
  The plugin version tracks the liter-llm core release (`Cargo.toml`). See [CHANGELOG.md](../CHANGELOG.md) for release notes.
154
209
 
210
+ ## Maintaining the plugin
211
+
212
+ Edit `plugin/.ai-rulez` sources, then run these commands from the repository root
213
+ with a Pi-capable ai-rulez v5 binary installed:
214
+
215
+ ```bash
216
+ task plugin:generate
217
+ task plugin:verify
218
+ task plugin:test
219
+ ```
220
+
221
+ CI builds the generator from a pinned source revision and verifies the generated
222
+ bundles, OpenCode tools, and actual npm archive before publication. The shared
223
+ npm package publishes both OpenCode and Pi resources; Hermes uses its existing
224
+ PyPI release job. GitHub hosts the remaining plugin bundles and marketplace indexes.
225
+
155
226
  ## License
156
227
 
157
228
  MIT. Skill content references the upstream [liter-llm](https://github.com/xberg-io/liter-llm) repository.
@@ -160,3 +231,69 @@ MIT. Skill content references the upstream [liter-llm](https://github.com/xberg-
160
231
 
161
232
  - **Marketplace**: this repo — `/plugin marketplace add xberg-io/liter-llm`
162
233
  - **Upstream**: [xberg-io/liter-llm](https://github.com/xberg-io/liter-llm)
234
+
235
+ ## Generated runtime bundles
236
+
237
+ `plugin/.ai-rulez/config.toml` loads `config.plugins.toml` through the `plugins` layer;
238
+ skills, commands and runtime adapters are authored alongside it. AI-Rulez 5.3.0 generates
239
+ all eleven supported runtimes: Claude, Cursor, Codex, Gemini, Kimi, OpenCode, Factory,
240
+ Hermes, Pi, Agent Plugins and Copilot. Codex ships both manifest layouts; repository-root
241
+ Claude and Codex marketplace indexes point to the `plugin` bundle. Cursor also has a marketplace index.
242
+
243
+ Pi packages skills and prompts without MCP integration. Copilot packages skills and MCP configuration, but does not package slash commands or hooks.
244
+ Hermes includes a Python package under `.hermes/package`; OpenCode and Pi share the npm package.
245
+ The Agent Plugins manifest uses the stable 1.0 specification. Runtime capabilities differ;
246
+ install the CLI before using skills in a runtime without MCP registration.
247
+
248
+ Run `ai-rulez generate --plugin` from the repository root to regenerate and
249
+ `ai-rulez verify --plugin` to compare current source output and provenance.
250
+ The release workflow packages every runtime into a deterministic archive, checksums,
251
+ and marketplace metadata; npm and PyPI retain their existing publishing jobs.
252
+
253
+ ## Hermes runtime setup
254
+
255
+ Install the product CLI with MCP support and put it on Hermes' PATH before using the plugin.
256
+ The Hermes adapter registers every bundled skill under the product namespace and provides
257
+ `liter_llm_call`, which calls the selected native MCP tool with `tool_arguments` through a local
258
+ stdio session. Select `tool: "list_tools"` first to inspect the server's exact request schemas. Hermes skills are selected explicitly; they are not automatically appended to the
259
+ system prompt. Enable the plugin in Hermes configuration; project plugins also require
260
+ `HERMES_ENABLE_PROJECT_PLUGINS=true`.
261
+
262
+ The bridge uses the installed CLI directly. The auto-installing launchers used by other MCP clients
263
+ are not included in the Hermes Python wheel. Provider credentials are inherited from the environment,
264
+ and are needed for provider-backed requests. Missing CLIs, unavailable tools and model preparation
265
+ fail with an actionable request error. CLI result data remains untrusted document content.
266
+
267
+ ## Public Agent Skills
268
+
269
+ The repository-root `skills/` directory contains the same generated skills and supporting
270
+ resources as `plugin/skills/`. Install them independently of a plugin runtime:
271
+
272
+ ```sh
273
+ npx skills add xberg-io/liter-llm --skill liter-llm
274
+ ```
275
+
276
+ Edit `plugin/.ai-rulez/skills`, then run `task plugin:generate` to regenerate runtime
277
+ bundles and synchronize the public export. `task plugin:verify` checks both projections;
278
+ `task plugin:skills:test` verifies resource freshness, ownership and symlink protection.
279
+ The public ownership manifest records SHA-256 hashes of every exported file.
280
+
281
+ ## Gemini provider credentials
282
+
283
+ Gemini filters sensitive shell environment variables. This extension declares provider keys
284
+ through native sensitive settings; values are entered in Gemini and stored in its keychain.
285
+ To install without entering credentials for every provider:
286
+
287
+ ```sh
288
+ gemini extensions install ./plugin --skip-settings
289
+ gemini extensions config liter-llm "OpenAI key"
290
+ ```
291
+
292
+ Configure only the provider used by your `liter-llm-proxy.toml` model routing. The local stdio
293
+ server can start without provider credentials; provider-backed requests require a configured
294
+ model and its credentials. For a provider with another variable name, add an appropriate
295
+ `[[plugin.gemini.settings]]` entry in the source and regenerate, or configure a Gemini MCP
296
+ server override. Never put key values in source or a generated manifest.
297
+
298
+ Launcher and visual assets are authored in `plugin/.ai-rulez/scripts/` and
299
+ `plugin/.ai-rulez/assets/`; `task plugin:generate` copies them into the runtime bundle.
package/package.json CHANGED
@@ -1,32 +1,87 @@
1
1
  {
2
- "name": "@xberg-io/opencode-liter-llm",
3
- "version": "2.2.1",
2
+ "author": {
3
+ "email": "contact@xberg.io",
4
+ "name": "Kreuzberg, Inc.",
5
+ "url": "https://xberg.io"
6
+ },
7
+ "dependencies": {
8
+ "@opencode/plugin": "^2.0.26"
9
+ },
4
10
  "description": "Universal LLM API client for 174 providers — chat, streaming, tools, embeddings, search, OCR, plus an OpenAI-compatible proxy and an MCP server.",
11
+ "exports": {
12
+ ".": "./.opencode/plugins/liter-llm.js"
13
+ },
14
+ "files": [
15
+ ".opencode/ai-rulez-bundle.json",
16
+ ".opencode/ai-rulez-content.js",
17
+ ".opencode/commands/liter-llm-chat.md",
18
+ ".opencode/commands/liter-llm-stream.md",
19
+ ".opencode/plugins/liter-llm.js",
20
+ ".opencode/skills/liter-llm-calling-llms/SKILL.md",
21
+ ".opencode/skills/liter-llm-calling-llms/index.md",
22
+ ".opencode/skills/liter-llm-embeddings-and-search/SKILL.md",
23
+ ".opencode/skills/liter-llm-embeddings-and-search/index.md",
24
+ ".opencode/skills/liter-llm-running-the-proxy/SKILL.md",
25
+ ".opencode/skills/liter-llm-running-the-proxy/index.md",
26
+ ".opencode/skills/liter-llm-streaming-responses/SKILL.md",
27
+ ".opencode/skills/liter-llm-streaming-responses/index.md",
28
+ ".opencode/skills/liter-llm-tool-calling/SKILL.md",
29
+ ".opencode/skills/liter-llm-tool-calling/index.md",
30
+ ".opencode/skills/liter-llm-using-the-mcp-server/SKILL.md",
31
+ ".opencode/skills/liter-llm-using-the-mcp-server/index.md",
32
+ ".opencode/skills/liter-llm/SKILL.md",
33
+ ".opencode/skills/liter-llm/index.md",
34
+ ".pi/prompts/liter-llm-chat.md",
35
+ ".pi/prompts/liter-llm-stream.md",
36
+ ".pi/skills/liter-llm-calling-llms/SKILL.md",
37
+ ".pi/skills/liter-llm-calling-llms/index.md",
38
+ ".pi/skills/liter-llm-embeddings-and-search/SKILL.md",
39
+ ".pi/skills/liter-llm-embeddings-and-search/index.md",
40
+ ".pi/skills/liter-llm-running-the-proxy/SKILL.md",
41
+ ".pi/skills/liter-llm-running-the-proxy/index.md",
42
+ ".pi/skills/liter-llm-streaming-responses/SKILL.md",
43
+ ".pi/skills/liter-llm-streaming-responses/index.md",
44
+ ".pi/skills/liter-llm-tool-calling/SKILL.md",
45
+ ".pi/skills/liter-llm-tool-calling/index.md",
46
+ ".pi/skills/liter-llm-using-the-mcp-server/SKILL.md",
47
+ ".pi/skills/liter-llm-using-the-mcp-server/index.md",
48
+ ".pi/skills/liter-llm/SKILL.md",
49
+ ".pi/skills/liter-llm/index.md",
50
+ "README.md",
51
+ "assets/",
52
+ "scripts/"
53
+ ],
54
+ "homepage": "https://xberg.io",
5
55
  "keywords": [
56
+ "embeddings",
6
57
  "llm",
58
+ "mcp",
7
59
  "openai",
8
- "proxy",
9
- "embeddings",
10
- "mcp"
60
+ "pi-package",
61
+ "proxy"
11
62
  ],
12
- "homepage": "https://xberg.io",
63
+ "license": "MIT",
64
+ "main": ".opencode/plugins/liter-llm.js",
65
+ "name": "@xberg-io/opencode-liter-llm",
66
+ "pi": {
67
+ "prompts": [
68
+ "./.pi/prompts/liter-llm-chat.md",
69
+ "./.pi/prompts/liter-llm-stream.md"
70
+ ],
71
+ "skills": [
72
+ "./.pi/skills/liter-llm-calling-llms",
73
+ "./.pi/skills/liter-llm-embeddings-and-search",
74
+ "./.pi/skills/liter-llm-running-the-proxy",
75
+ "./.pi/skills/liter-llm-streaming-responses",
76
+ "./.pi/skills/liter-llm-tool-calling",
77
+ "./.pi/skills/liter-llm-using-the-mcp-server",
78
+ "./.pi/skills/liter-llm"
79
+ ]
80
+ },
13
81
  "repository": {
14
82
  "type": "git",
15
83
  "url": "https://github.com/xberg-io/liter-llm"
16
84
  },
17
- "license": "MIT",
18
85
  "type": "module",
19
- "main": ".opencode/plugins/liter-llm.js",
20
- "exports": {
21
- ".": "./.opencode/plugins/liter-llm.js"
22
- },
23
- "files": [
24
- ".opencode/",
25
- "assets/",
26
- "README.md",
27
- "scripts/"
28
- ],
29
- "dependencies": {
30
- "@opencode/plugin": "^2.0.20"
31
- }
32
- }
86
+ "version": "2.2.4"
87
+ }
@@ -48,12 +48,13 @@ if have "$BINARY_NAME"; then
48
48
  fi
49
49
 
50
50
  if want npx && have npx; then
51
- log "probing npx $NPM_PKG@latest ..."
51
+ log "resolving npx $NPM_PKG@latest ..."
52
52
  scratch="$(mktemp -d)"
53
- if (cd "$scratch" && npx -y "$NPM_PKG@latest" --version >/dev/null 2>&1); then
54
- log "launching via npx $NPM_PKG@latest"
55
- cd "$scratch"
56
- exec npx -y "$NPM_PKG@latest" "$@"
53
+ # Resolve in an empty project, then execute the selected binary in the caller's cwd. ~keep
54
+ if npm_bin="$(cd "$scratch" && npx -y --package "$NPM_PKG@latest" --call "command -v ${BINARY_NAME%.exe}" 2>/dev/null)" && runs_ok "$npm_bin"; then
55
+ rm -rf "$scratch"
56
+ log "launching npm package binary $npm_bin"
57
+ exec "$npm_bin" "$@"
57
58
  fi
58
59
  rm -rf "$scratch"
59
60
  log "npx $NPM_PKG not available (no CLI bin yet); falling through"
@@ -1,63 +0,0 @@
1
- ---
2
- name: using-the-mcp-server
3
- description: Use when calling LLM APIs through the liter-llm MCP server's 22 tools, and to decide when MCP beats the CLI or SDK. Covers the tool surface, the auto-installing launcher, and authentication.
4
- ---
5
-
6
- <!--
7
- AI-RULEZ :: GENERATED FILE — DO NOT EDIT
8
- Content-Hash: blake3:bb42aaf38dca362b154240ddbee4e03bb76614ff452facc744f7d560cfc6d523
9
- Source-Hash: blake3:08d1b547eeb7749df4ddf38c0cb5caba2dd24acd39ee5e68886582db666c5662
10
- Schema-Version: v1
11
- -->
12
-
13
- # Using the MCP Server
14
-
15
- The `liter-llm` MCP server exposes 22 tools that mirror the proxy's REST
16
- endpoints, so an MCP-compatible client (Claude Code, Claude Desktop) can call
17
- 174 LLM providers as tools with no glue code.
18
-
19
- ## How it runs in this plugin
20
-
21
- The plugin auto-registers the server. Its command is the bundled launcher
22
- `scripts/mcp-launch.sh`, which execs `liter-llm mcp --transport stdio`. On first
23
- run the launcher resolves a `liter-llm` binary: it reuses one on `PATH`, then
24
- tries `npx`/`uvx`, then Homebrew, then downloads a checksum-verified prebuilt
25
- from the tool's latest GitHub release. Override with
26
- `LITER_LLM_LAUNCHER=auto|npx|uvx|brew|download`.
27
-
28
- To run it manually:
29
-
30
- ```bash
31
- liter-llm mcp --transport stdio # for Claude Code / Claude Desktop
32
- liter-llm mcp --transport http --port 3001
33
- ```
34
-
35
- ## The 22 tools
36
-
37
- Modality tools: `chat`, `embed`, `generate_image`, `speech`, `transcribe`,
38
- `moderate`, `rerank`, `search`, `ocr`.
39
-
40
- Model listing: `list_models`.
41
-
42
- File operations: `create_file`, `list_files`, `retrieve_file`, `delete_file`,
43
- `file_content`.
44
-
45
- Batch operations: `create_batch`, `list_batches`, `retrieve_batch`,
46
- `cancel_batch`.
47
-
48
- Responses API: `create_response`, `retrieve_response`, `cancel_response`.
49
-
50
- ## Authentication
51
-
52
- stdio has no per-request auth headers, so the server binds auth once at startup
53
- via `[mcp]` config: set `mcp.stdio_key_id` to bind a specific virtual key, or
54
- `mcp.stdio_trust_local = true` for fully trusted local environments. Provider
55
- keys still come from env vars.
56
-
57
- ## When to prefer MCP over the CLI or SDK
58
-
59
- - **Prefer MCP** inside an agent session: the agent invokes tools directly, with
60
- no code to write or process to manage.
61
- - **Prefer the SDK** when building application software in a specific language.
62
- - **Prefer the proxy** when many apps or teams need a shared OpenAI-compatible
63
- endpoint with keys, budgets, and rate limits.