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
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ Use [Fly.io Sprites](https://sprites.dev) from OpenCode as persistent, isolated

One package supports both OpenCode releases. OpenCode 1 loads the package's `./server` export, and OpenCode 2 loads its `.` export. Each entry point uses the plugin API of its own release, and both share the same server defaults, tool names, guidance, commands, and destructive-tool rules.

The plugin connects OpenCode to the hosted Sprites MCP server, uses OpenCode's browser-based OAuth flow, adds Sprites commands and workflow guidance, and asks for approval before destructive remote operations. You do not need to install the Sprites CLI or create an API token.
The plugin connects OpenCode to the hosted Fly MCP server at `https://mcp.fly.io`, which serves the Sprites tools. It uses OpenCode's browser-based OAuth flow, adds Sprites commands and workflow guidance, and asks for approval before destructive remote operations. You do not need to install the Sprites CLI or create an API token.

## Upgrading from the `sprites.dev/mcp` endpoint

Earlier versions of this plugin connected to `https://sprites.dev/mcp`. We are transitioning to the new Fly MCP server, and the plugin now connects to it at `https://mcp.fly.io`. The MCP server name is still `sprites`, and the Sprites tools keep the same names, so your permission rules and commands continue to work.

The two endpoints have separate OAuth grants. After you update the plugin, authorize one time again: restart OpenCode, then run `opencode mcp auth sprites` (or `opencode2 mcp auth sprites`) if the browser flow does not start by itself. If your configuration sets the `url` option or defines the `sprites` MCP server itself with the old address, change it to `https://mcp.fly.io`.

The Fly MCP server can also offer Fly tools that are not Sprites tools, such as tools for apps and Machines. Which tools appear depends on the access that you grant on the consent screen. They carry the same `sprites_` prefix in OpenCode, because the prefix comes from the server name. Grant only Sprites access if you want only the Sprites tools.

## Requirements

Expand Down Expand Up @@ -91,7 +99,7 @@ OpenCode 2 groups MCP tools in Code Mode by default. The model then reaches them

## What the plugin adds

- Hosted MCP access at `https://sprites.dev/mcp`.
- Hosted MCP access at `https://mcp.fly.io`, registered under the server name `sprites`.
- Sprites workflow and safety guidance in relevant sessions, but not in unrelated work.
- Session inheritance, so a subagent that works with Sprites gets the same guidance as its parent.
- Approval prompts for Sprite destruction, checkpoint restore, and complete network-policy replacement.
Expand Down Expand Up @@ -139,7 +147,7 @@ OpenCode passes an options object to the plugin. OpenCode 1 uses a tuple, and Op
| Option | OpenCode | Default | Meaning |
| ------------- | -------- | ------------------------- | ---------------------------------------------------------- |
| `mcpName` | 1 and 2 | `sprites` | MCP server name and generated tool-name prefix. |
| `url` | 1 and 2 | `https://sprites.dev/mcp` | Remote MCP endpoint. Must use HTTP or HTTPS. |
| `url` | 1 and 2 | `https://mcp.fly.io` | Remote MCP endpoint. Must use HTTP or HTTPS. |
| `timeout` | 1 and 2 | see below | MCP timeouts in milliseconds. |
| `headers` | 1 and 2 | `{}` | Headers merged over the plugin's attribution headers. |
| `mcp` | 1 and 2 | `true` | Register the default MCP server. |
Expand Down
2 changes: 1 addition & 1 deletion src/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

export const DEFAULT_MCP_NAME = "sprites";
export const DEFAULT_MCP_URL = "https://sprites.dev/mcp";
export const DEFAULT_MCP_URL = "https://mcp.fly.io";

export const DEFAULT_HEADERS = Object.freeze({
"Fly-Client-Interactive": "false",
Expand Down
4 changes: 2 additions & 2 deletions test/plugin.bun.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test("the OpenCode 1 entry point configures under Bun", async () => {
await hooks.config(config);

expect(v1.id).toBe("sprites");
expect(config.mcp.sprites.url).toBe("https://sprites.dev/mcp");
expect(config.mcp.sprites.url).toBe("https://mcp.fly.io/");
expect(config.permission["sprites_*destroy_sprite"]).toBe("ask");
});

Expand All @@ -28,7 +28,7 @@ test("the OpenCode 2 entry point registers under Bun", async () => {
const cleanup = await v2.setup(harness.ctx);

expect(v2.id).toBe("sprites");
expect(harness.servers().get("sprites").url).toBe("https://sprites.dev/mcp");
expect(harness.servers().get("sprites").url).toBe("https://mcp.fly.io/");
expect(harness.servers().get("sprites").codemode).toBe(false);
expect(harness.commands().map((command) => command.name)).toEqual([
"sprites-status",
Expand Down
2 changes: 1 addition & 1 deletion test/v1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test("registers the MCP server, commands, and destructive-tool approvals", async

assert.deepEqual(config.mcp.sprites, {
type: "remote",
url: "https://sprites.dev/mcp",
url: "https://mcp.fly.io/",
enabled: true,
oauth: {},
headers: {
Expand Down
2 changes: 1 addition & 1 deletion test/v2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test("registers the Sprites MCP server", async () => {

assert.deepEqual(servers().get("sprites"), {
type: "remote",
url: "https://sprites.dev/mcp",
url: "https://mcp.fly.io/",
headers: {
"Fly-Client-Interactive": "false",
"Fly-Client-Agent": "opencode",
Expand Down
Loading