Repository navigation
[CI only] feat(aimlapi): MCP server built-in plugin - #3
Closed
hugoaimlapi wants to merge 7 commits into
Closed
hugoaimlapi wants to merge 7 commits into
hugoaimlapi wants to merge 7 commits into
Conversation
Requests from any MCP server whose URL is https on the exact hostname mcp.aimlapi.com now carry X-AIMLAPI-Source and X-AIMLAPI-Partner-ID, resolved through the existing resolveAimlapiAttributionHeaders helper so a configured header cannot replace the partner id. The hook sits in getMcpServerHeaders, so it covers SSE/HTTP transports for both a hand-added server and a plugin-provided one. Other MCP servers and look-alike hosts keep exactly the headers they were configured with.
Add the aimlapi@builtin plugin, which provides the remote MCP server https://mcp.aimlapi.com/mcp (Toolbox tools_*, image/video/audio generation, model and account tools). It follows the karpathy-guidelines precedent: defaultEnabled is false, so the user turns it on explicitly with `openclaude plugin enable aimlapi@builtin` or the /plugin UI, and a present key never connects a billed server on its own. The server authenticates with `Authorization: Bearer ${AIMLAPI_API_KEY}`, an environment reference expanded at load time, so the key is never written to settings or an MCP config. An active aimlapi.com profile already exports its saved key under that name. The plugin is hidden when no key is set, or when the aimlapi route points at a non-canonical (proxy) base URL, whose credential the profile exports under the same name. `openclaude mcp list` now registers built-in plugins first, like the skills subcommands do, so it lists and health-checks the server the way a session sees it. Docs cover the plugin and the zero-code `openclaude mcp add` commands (API key header or OAuth).
Bun runs test files in a shared process, and StartupScreen.test.ts leaves its
settings.js mock registered (mock.restore() does not undo mock.module). In the
shard where that file runs before aimlapiMcp.test.ts, getSettings_DEPRECATED
always returned {}, so the opt-in plugin never showed as enabled and two tests
failed.
Mock settings.js in this file the way ModelPicker.test.tsx does: pin
getSettings_DEPRECATED to the test's own settings, restore the real module
after each test, and hold the shared mutation lock while the mock is active.
The plugin code is unchanged.
…a pool
A provider profile can export a comma-separated credential pool as
AIMLAPI_API_KEY, so `Bearer ${AIMLAPI_API_KEY}` could expand to several keys
in one header. For the mcp.aimlapi.com host only, resolveAimlapiMcpHeaders now
keeps the first usable key of a bearer pool (firstUsableCredential), the
same rule Twigpine#2465 uses for web search. Single keys, non-bearer values and every
other MCP server are left unchanged.
…BASE alias hasAimlapiMcpCredential now uses firstUsableCredential, so a placeholder value such as `null` no longer makes the plugin available, and it treats OPENAI_API_BASE like OPENAI_BASE_URL when withholding a proxy profile's key. Tests cover the alias, the placeholder and a pooled key reaching the server as a single Bearer token.
…ugin Mention OPENAI_API_BASE in the proxy rule and that a pooled AIMLAPI_API_KEY sends only its first usable key to the MCP server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI validation run for the upstream PR to Twigpine/openclaude. Not for merge; will be closed once PR Checks finish.