Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions flux/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ can call it directly from chat.
## Quick Start

1. **Install this extension.** VS Code registers the `flux` MCP server automatically.
2. **Get an API token** from [Ace Data Cloud](https://platform.acedata.cloud) → *API Keys*. New accounts include free trial credit.
3. **Open Copilot Chat** in agent mode and ask for a image task — VS Code will prompt for the token the first time and store it securely.
2. **Get an API key** from [Ace Data Cloud](https://platform.acedata.cloud/console/applications) (Applications → API Key). New accounts include free trial credit.
3. **Open Copilot Chat** in agent mode and ask for a image task — the extension prompts for the API key the first time and stores it in the OS keychain via VS Code's `SecretStorage`.

You can rotate or remove the API key any time from the command palette:

- **Flux MCP: Set Ace Data Cloud API Key**
- **Flux MCP: Clear Ace Data Cloud API Key**

> The default config talks to the **hosted streamable-HTTP endpoint** at
> `https://flux.mcp.acedata.cloud/mcp` — no Python, no `uvx`, no local install needed.
Expand Down Expand Up @@ -53,7 +58,23 @@ From $0.025 per image. Free trial credit on sign-up. See full pricing at [https:

## Configuration

This extension contributes the following entry to your VS Code MCP config:
This extension implements the `mcpServerDefinitionProviders` contribution point
and registers a single hosted server with VS Code:

```text
Provider id : acedatacloud.flux
Server label: Flux MCP
Server URL : https://flux.mcp.acedata.cloud/mcp
Transport : Streamable HTTP
Auth : Bearer API key from VS Code SecretStorage (or $ACEDATACLOUD_API_TOKEN)
```

You don't need to edit `mcp.json` — the extension handles registration and
token handling automatically. If you'd rather configure things by hand, the
sections below show equivalent `mcp.json` snippets you can use **instead of**
this extension.

### Alternative: manual `mcp.json` (hosted)

```jsonc
{
Expand All @@ -68,21 +89,17 @@ This extension contributes the following entry to your VS Code MCP config:
{
"type": "promptString",
"id": "acedatacloud_api_token",
"description": "Ace Data Cloud API token",
"description": "Ace Data Cloud API key",
"password": true
}
]
}
```

VS Code will prompt for the token on first use and persist it in the OS
secret store (Keychain / Credential Manager / libsecret).

### Alternative: local stdio (no network roundtrip)

If you prefer running the server locally — for offline dev, air-gapped
environments, or to pin to a specific PyPI version — install
[`uv`](https://docs.astral.sh/uv/) and replace your `mcp.json` entry with:
For offline dev, air-gapped environments, or pinning to a specific PyPI
version, install [`uv`](https://docs.astral.sh/uv/) and use:

```jsonc
{
Expand All @@ -99,12 +116,6 @@ environments, or to pin to a specific PyPI version — install

`uvx` will download and run the latest [`mcp-flux-pro`](https://pypi.org/project/mcp-flux-pro/) on demand.

### Alternative: OAuth via Dynamic Client Registration

The hosted endpoint also accepts OAuth 2.1 with [DCR](https://datatracker.ietf.org/doc/html/rfc7591).
Drop the `headers` and `inputs` blocks and VS Code will run the auth flow on
first use (redirect URL `http://127.0.0.1:33418` or `https://vscode.dev/redirect`).

---

## Links
Expand Down
92 changes: 92 additions & 0 deletions flux/vscode/extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Auto-generated by scripts/build_vscode_extensions.py — DO NOT EDIT BY HAND.
//
// Registers the hosted Ace Data Cloud "flux" MCP server with VS Code
// via the stable `vscode.lm.registerMcpServerDefinitionProvider` API. The
// Bearer API key is read from (in order):
// 1. process.env.ACEDATACLOUD_API_TOKEN
// 2. VS Code SecretStorage (key "flux.apiToken")
// 3. An interactive showInputBox prompt on first use
//
// Two commands are exposed for managing the API key from the command palette:
// - acedatacloud.flux.setApiToken
// - acedatacloud.flux.clearApiToken

const vscode = require("vscode");

const PROVIDER_ID = "acedatacloud.flux";
const SERVER_LABEL = "Flux MCP";
const SERVER_URL = "https://flux.mcp.acedata.cloud/mcp";
const SET_TOKEN_CMD = "acedatacloud.flux.setApiToken";
const CLEAR_TOKEN_CMD = "acedatacloud.flux.clearApiToken";
// Per-extension SecretStorage namespace; we keep one key per service so
// rotating one API key doesn't affect siblings.
const SECRET_KEY = "flux.apiToken";
const SIGNUP_URL = "https://platform.acedata.cloud";

async function readToken(context) {
const env = process.env.ACEDATACLOUD_API_TOKEN;
if (env && env.trim()) return env.trim();
const stored = await context.secrets.get(SECRET_KEY);
return stored ? stored.trim() : undefined;
}

async function promptForToken(context) {
const token = await vscode.window.showInputBox({
title: `${SERVER_LABEL} — Ace Data Cloud API key`,
prompt: `Paste an API key from ${SIGNUP_URL}/console/applications (Applications -> API Key). Stored in the OS keychain.`,
placeHolder: "API key from /console/applications",
password: true,
ignoreFocusOut: true,
});
if (!token) return undefined;
const trimmed = token.trim();
if (!trimmed) return undefined;
await context.secrets.store(SECRET_KEY, trimmed);
return trimmed;
}

function activate(context) {
const onDidChange = new vscode.EventEmitter();

context.subscriptions.push(
onDidChange,
vscode.commands.registerCommand(SET_TOKEN_CMD, async () => {
const t = await promptForToken(context);
if (t) {
vscode.window.showInformationMessage(`${SERVER_LABEL}: API key saved.`);
onDidChange.fire();
}
}),
vscode.commands.registerCommand(CLEAR_TOKEN_CMD, async () => {
await context.secrets.delete(SECRET_KEY);
vscode.window.showInformationMessage(`${SERVER_LABEL}: API key cleared.`);
onDidChange.fire();
}),
context.secrets.onDidChange((e) => {
if (e.key === SECRET_KEY) onDidChange.fire();
}),
vscode.lm.registerMcpServerDefinitionProvider(PROVIDER_ID, {
onDidChangeMcpServerDefinitions: onDidChange.event,
provideMcpServerDefinitions: () => [
new vscode.McpHttpServerDefinition(SERVER_LABEL, vscode.Uri.parse(SERVER_URL)),
],
resolveMcpServerDefinition: async (server) => {
let token = await readToken(context);
if (!token) token = await promptForToken(context);
if (!token) {
throw new Error(
`${SERVER_LABEL} needs an Ace Data Cloud API key. ` +
`Run "${SERVER_LABEL}: Set Ace Data Cloud API Key" from the command palette.`
);
}
return new vscode.McpHttpServerDefinition(server.label, server.uri, {
Authorization: `Bearer ${token}`,
});
},
})
);
}

function deactivate() {}

module.exports = { activate, deactivate };
33 changes: 18 additions & 15 deletions flux/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "mcp-flux",
"displayName": "Flux MCP",
"description": "Flux image generation by Black Forest Labs — dev, pro, ultra, and kontext editing.",
"version": "0.2.0",
"version": "0.3.0",
"publisher": "acedatacloud",
"icon": "icon.png",
"license": "MIT",
"engines": {
"vscode": "^1.99.0"
"vscode": "^1.101.0"
},
"categories": [
"AI",
Expand Down Expand Up @@ -37,22 +37,25 @@
"bugs": {
"url": "https://github.com/AceDataCloud/FluxMCP/issues"
},
"activationEvents": [],
"main": "./extension.js",
"contributes": {
"mcpServers": {
"flux": {
"type": "http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer ${input:acedatacloud_api_token}"
}
"mcpServerDefinitionProviders": [
{
"id": "acedatacloud.flux",
"label": "Flux MCP"
}
},
"inputs": [
],
"commands": [
{
"command": "acedatacloud.flux.setApiToken",
"title": "Flux MCP: Set Ace Data Cloud API Key",
"category": "MCP"
},
{
"type": "promptString",
"id": "acedatacloud_api_token",
"description": "Ace Data Cloud API token. Sign in at https://platform.acedata.cloud and create a token in 'API Keys'. Stored securely by VS Code.",
"password": true
"command": "acedatacloud.flux.clearApiToken",
"title": "Flux MCP: Clear Ace Data Cloud API Key",
"category": "MCP"
}
]
}
Expand Down
43 changes: 27 additions & 16 deletions hailuo/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ can call it directly from chat.
## Quick Start

1. **Install this extension.** VS Code registers the `hailuo` MCP server automatically.
2. **Get an API token** from [Ace Data Cloud](https://platform.acedata.cloud) → *API Keys*. New accounts include free trial credit.
3. **Open Copilot Chat** in agent mode and ask for a video task — VS Code will prompt for the token the first time and store it securely.
2. **Get an API key** from [Ace Data Cloud](https://platform.acedata.cloud/console/applications) (Applications → API Key). New accounts include free trial credit.
3. **Open Copilot Chat** in agent mode and ask for a video task — the extension prompts for the API key the first time and stores it in the OS keychain via VS Code's `SecretStorage`.

You can rotate or remove the API key any time from the command palette:

- **Hailuo MCP: Set Ace Data Cloud API Key**
- **Hailuo MCP: Clear Ace Data Cloud API Key**

> The default config talks to the **hosted streamable-HTTP endpoint** at
> `https://hailuo.mcp.acedata.cloud/mcp` — no Python, no `uvx`, no local install needed.
Expand Down Expand Up @@ -49,7 +54,23 @@ From $0.20 per clip. Free trial credit on sign-up. See full pricing at [https://

## Configuration

This extension contributes the following entry to your VS Code MCP config:
This extension implements the `mcpServerDefinitionProviders` contribution point
and registers a single hosted server with VS Code:

```text
Provider id : acedatacloud.hailuo
Server label: Hailuo MCP
Server URL : https://hailuo.mcp.acedata.cloud/mcp
Transport : Streamable HTTP
Auth : Bearer API key from VS Code SecretStorage (or $ACEDATACLOUD_API_TOKEN)
```

You don't need to edit `mcp.json` — the extension handles registration and
token handling automatically. If you'd rather configure things by hand, the
sections below show equivalent `mcp.json` snippets you can use **instead of**
this extension.

### Alternative: manual `mcp.json` (hosted)

```jsonc
{
Expand All @@ -64,21 +85,17 @@ This extension contributes the following entry to your VS Code MCP config:
{
"type": "promptString",
"id": "acedatacloud_api_token",
"description": "Ace Data Cloud API token",
"description": "Ace Data Cloud API key",
"password": true
}
]
}
```

VS Code will prompt for the token on first use and persist it in the OS
secret store (Keychain / Credential Manager / libsecret).

### Alternative: local stdio (no network roundtrip)

If you prefer running the server locally — for offline dev, air-gapped
environments, or to pin to a specific PyPI version — install
[`uv`](https://docs.astral.sh/uv/) and replace your `mcp.json` entry with:
For offline dev, air-gapped environments, or pinning to a specific PyPI
version, install [`uv`](https://docs.astral.sh/uv/) and use:

```jsonc
{
Expand All @@ -95,12 +112,6 @@ environments, or to pin to a specific PyPI version — install

`uvx` will download and run the latest [`mcp-hailuo`](https://pypi.org/project/mcp-hailuo/) on demand.

### Alternative: OAuth via Dynamic Client Registration

The hosted endpoint also accepts OAuth 2.1 with [DCR](https://datatracker.ietf.org/doc/html/rfc7591).
Drop the `headers` and `inputs` blocks and VS Code will run the auth flow on
first use (redirect URL `http://127.0.0.1:33418` or `https://vscode.dev/redirect`).

---

## Links
Expand Down
92 changes: 92 additions & 0 deletions hailuo/vscode/extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Auto-generated by scripts/build_vscode_extensions.py — DO NOT EDIT BY HAND.
//
// Registers the hosted Ace Data Cloud "hailuo" MCP server with VS Code
// via the stable `vscode.lm.registerMcpServerDefinitionProvider` API. The
// Bearer API key is read from (in order):
// 1. process.env.ACEDATACLOUD_API_TOKEN
// 2. VS Code SecretStorage (key "hailuo.apiToken")
// 3. An interactive showInputBox prompt on first use
//
// Two commands are exposed for managing the API key from the command palette:
// - acedatacloud.hailuo.setApiToken
// - acedatacloud.hailuo.clearApiToken

const vscode = require("vscode");

const PROVIDER_ID = "acedatacloud.hailuo";
const SERVER_LABEL = "Hailuo MCP";
const SERVER_URL = "https://hailuo.mcp.acedata.cloud/mcp";
const SET_TOKEN_CMD = "acedatacloud.hailuo.setApiToken";
const CLEAR_TOKEN_CMD = "acedatacloud.hailuo.clearApiToken";
// Per-extension SecretStorage namespace; we keep one key per service so
// rotating one API key doesn't affect siblings.
const SECRET_KEY = "hailuo.apiToken";
const SIGNUP_URL = "https://platform.acedata.cloud";

async function readToken(context) {
const env = process.env.ACEDATACLOUD_API_TOKEN;
if (env && env.trim()) return env.trim();
const stored = await context.secrets.get(SECRET_KEY);
return stored ? stored.trim() : undefined;
}

async function promptForToken(context) {
const token = await vscode.window.showInputBox({
title: `${SERVER_LABEL} — Ace Data Cloud API key`,
prompt: `Paste an API key from ${SIGNUP_URL}/console/applications (Applications -> API Key). Stored in the OS keychain.`,
placeHolder: "API key from /console/applications",
password: true,
ignoreFocusOut: true,
});
if (!token) return undefined;
const trimmed = token.trim();
if (!trimmed) return undefined;
await context.secrets.store(SECRET_KEY, trimmed);
return trimmed;
}

function activate(context) {
const onDidChange = new vscode.EventEmitter();

context.subscriptions.push(
onDidChange,
vscode.commands.registerCommand(SET_TOKEN_CMD, async () => {
const t = await promptForToken(context);
if (t) {
vscode.window.showInformationMessage(`${SERVER_LABEL}: API key saved.`);
onDidChange.fire();
}
}),
vscode.commands.registerCommand(CLEAR_TOKEN_CMD, async () => {
await context.secrets.delete(SECRET_KEY);
vscode.window.showInformationMessage(`${SERVER_LABEL}: API key cleared.`);
onDidChange.fire();
}),
context.secrets.onDidChange((e) => {
if (e.key === SECRET_KEY) onDidChange.fire();
}),
vscode.lm.registerMcpServerDefinitionProvider(PROVIDER_ID, {
onDidChangeMcpServerDefinitions: onDidChange.event,
provideMcpServerDefinitions: () => [
new vscode.McpHttpServerDefinition(SERVER_LABEL, vscode.Uri.parse(SERVER_URL)),
],
resolveMcpServerDefinition: async (server) => {
let token = await readToken(context);
if (!token) token = await promptForToken(context);
if (!token) {
throw new Error(
`${SERVER_LABEL} needs an Ace Data Cloud API key. ` +
`Run "${SERVER_LABEL}: Set Ace Data Cloud API Key" from the command palette.`
);
}
return new vscode.McpHttpServerDefinition(server.label, server.uri, {
Authorization: `Bearer ${token}`,
});
},
})
);
}

function deactivate() {}

module.exports = { activate, deactivate };
Loading