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
31 changes: 6 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,15 @@ host are welcome.

## Adding a polyfill

A polyfill implements the client side of one published extension inside one
host that hasn't shipped it, and does nothing once the host supports the
extension itself. The extension is an MCP extension, or a spec for agents
published outside MCP, such as ARD. Each one is a folder in this repository.

### 1. Meet the contract

Every polyfill here meets [`docs/polyfill-contract.md`](docs/polyfill-contract.md):

- one published extension and nothing else;
- a named spec revision;
- a test for each client rule, plus a run against a server someone else
wrote;
- a stand-down;
- stated limits;
- server content treated as untrusted data.

The `create-polyfill` skill walks an agent through building one to that
contract. Install it with:

```
/plugin install polyfill-author --marketplace idosal/AgentPolyfill
```
Implement the client side of a published extension for a specific host. Name the
specification revision, test the client requirements, and document any exceptions.
Include an interoperability test with an independent server and a way to disable
the adapter when the host adds native support. Treat server content as untrusted.

Then ask for the extension and host you want, for example "polyfill MCP
Server Cards in Claude Code". If what you want isn't in any spec, the
`design-extension` skill in the same plugin covers that case, because a
polyfill never adds behaviour of its own.
See the [polyfill contract](docs/polyfill-contract.md) for the full requirements and
[polyfill-author](plugins/polyfill-author/) for the optional authoring tools.

### 2. Put it in its folder

Expand Down
1,398 changes: 46 additions & 1,352 deletions README.md

Large diffs are not rendered by default.

48 changes: 1 addition & 47 deletions community/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,7 @@ Open a pull request that adds one object to the `polyfills` array:
Other hosts are welcome too.
- **`summary`**: one plain sentence.
- **`repository`** and **`install`**: where it lives, and the command or steps
that install it. For a Pi extension, give its tested `pi install` command;
if it needs a clone, include the clone steps and local path. For an
OpenCode plugin, give the `opencode plugin add` line, or the folder to put
in `plugins` in `opencode.json`. For an Antigravity plugin, give the
`agy plugin install` line and the folder it takes. For a Copilot CLI plugin,
give the marketplace and `copilot plugin install` lines, and say if it needs
experimental mode (every Copilot extension does). For a Hermes Agent
plugin, give the `hermes plugins install` line and the settings it needs
in `config.yaml`. The repository's README states the spec revision, its
that install it, including any required host settings. The repository’s README states the spec revision, its
limits and what it sends where.
- **`maintainer`**: your GitHub handle.
- **`contract`**: where it stands on this project's
Expand All @@ -80,44 +72,6 @@ Open a pull request that adds one object to the `polyfills` array:
Entries stay in the order they were added. The site's build checks each one
for these fields.

This repository's Pi forms are in `polyfills/<polyfill>/pi/`, with the
installable extension in `extension/`. They cover Events, Skills, Server
Cards and ARD; Apps has no Pi form.
`pi install git:github.com/idosal/AgentPolyfill` installs Events, Skills and
Server Cards together. A clone is the alternative for one form, and the
way to install ARD: its search sends the words of your request to a registry
after asking each time, so it is left out of the one-line install as it is
from the Claude Code bundle. Nothing for Pi here is published to npm or
Pi's package gallery. The [root README](../README.md#install) has the steps.

This repository's OpenCode forms are in `polyfills/<polyfill>/opencode/`,
with the installable plugin in `plugin/`. They cover Events, Skills, Server
Cards and ARD; Apps has no OpenCode form. Nothing for OpenCode here is
published to npm: `opencode plugin add` installs each one from GitHub. The
[root README](../README.md#install) has the tested install lines.

This repository's Antigravity forms are in `polyfills/<polyfill>/antigravity/`,
with the installable plugin in `plugin/`. They cover Events, Skills, Server
Cards and ARD; Apps has no Antigravity form, because the App shows MCP Apps
itself. Nothing is published to Antigravity's Marketplace. Each installs from
its `plugin/` folder on GitHub with `agy plugin install`, which needs the
Antigravity CLI (the App doesn't ship `agy`) and Git, as the
[root README](../README.md#install) shows.

This repository's Copilot CLI forms are in `polyfills/<polyfill>/copilot/`,
with the installable plugin in `plugin/`. They cover Events, Server Cards and
ARD; Copilot has Skills and Apps built in. Its marketplace is
`.github/plugin/marketplace.json`, installed from a clone (tested with 1.0.115) or from GitHub
(checked in Copilot CLI 1.0.105; not checked in 1.0.115, in the interactive
TUI, or in VS Code). The [root README](../README.md#install) has
the steps.

This repository's Hermes Agent forms are in `polyfills/<polyfill>/hermes/`,
with the installable plugin in `plugin/`. They cover Events, Skills, Server
Cards and ARD; Apps has no Hermes form yet. `hermes plugins install` installs
each one from its folder on GitHub; there is no marketplace file. The
[root README](../README.md#install) has the install lines.

## What gets listed

- It implements the client side of a published extension, in a host that
Expand Down
32 changes: 13 additions & 19 deletions docs/host-changes.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# What hosts would need to change

Claude Code, Codex, Pi, OpenCode, Antigravity, GitHub Copilot CLI and Hermes
Agent all let outside code extend them. That gets a polyfill most of the way:
it can add tools, react to what happens in a
session, and wake a session that has gone idle. What none of them lets a
plugin do is speak an extension's own protocol over the host's connection to
a server. This page explains that gap, the four small changes that would close
it in each host, and what each extension needs from them.
Events, Skills and Apps need MCP methods or notifications that host plugin APIs
do not fully expose. Adapters that open their own connection cannot reuse the
host’s OAuth session. The tables below identify the missing APIs and the
extensions that would use them.

None of the changes names an extension. They are generic, and any future
extension would use them the same way.

This page is for these versions:
Versions examined:

- Claude Code 2.1.330 (its mod API types).
- Codex CLI 0.170.0 (its `app-server` protocol, as
Expand Down Expand Up @@ -96,11 +90,11 @@ headers for the method, or takes them from the caller.

- **Claude Code** has nothing like it today. It could be
`$.mcp.request(server, method, params)` next to the existing `$.mcp.call`.
- **Codex** already has the hard part. Its MCP client can send any request
- The **Codex** MCP client can send any request
(`send_custom_request`), but only Codex itself can use it. It could be an
app-server method such as `mcpServer/request { threadId, server, method, params }`,
behind `experimentalApi`, returning the raw result.
- **Pi** has the hard part too. Its MCP client (`McpClient.request()` in
- The **Pi** MCP client (`McpClient.request()` in
`pi-mcp`) sends any method, but the built-in MCP extension keeps its clients
to itself. It could be `pi.getMcpServerSession(name)` in the extension API,
provided by whichever extension connects MCP servers, as
Expand All @@ -109,18 +103,18 @@ headers for the method, or takes them from the caller.
the caller the request's JSON-RPC id (push notifications are routed by it),
takes per-request `Mcp-*` routing headers, and refuses `tools/call`, so
tools stay on Pi's tool pipeline, where permission extensions see them.
- **OpenCode** has the hard part too: its MCP client already sends `events/*`
- The **OpenCode** MCP client sends `events/*`
for itself. It could be `ctx.mcp.request({ server, method, params })` beside
`ctx.mcp.list`, on the connection OpenCode holds, with its sign-in.
- **Antigravity** has nothing like it. Its MCP client is closed, so this
would be a new plugin API, for example a method a plugin's MCP server or
sidecar can call.
- **Copilot** has the same shape next to it: `session.rpc.mcp.callTool` and
- **Copilot** exposes two related methods: `session.rpc.mcp.callTool` and
`resources.read` already go over Copilot's connection "with the existing
server admission and tool permission checks". A
`session.rpc.mcp.request({ serverName, method, params })` beside them,
returning the raw result, would close it.
- **Hermes** has the hard part too: its webhook support for Events
- The **Hermes** webhook implementation for Events
(`tools/mcp_tool_events.py`) sends `events/*` over the native session with
`session.send_request`, under the server's RPC lock. It could be
`ctx.mcp_request(server, method, params, timeout)` next to `ctx.call_mcp`,
Expand Down Expand Up @@ -560,8 +554,8 @@ details:
- **Scope.** A plugin could declare in its manifest which extension it
implements and which method prefixes it will send (`events/`, `skills/`).
Then you see the grant when you install it, and the pipe isn't open-ended.
- **Credentials.** Requests go out with your sign-in. That's the point, and
it's also why the scope above matters.
- **Credentials.** Requests use the host’s authenticated connection. Restrict that access
to the servers and methods granted to the plugin.
- **Who may call, in Copilot.** An extension already gets an elevated-permission
question before it may skip tool prompts or register hooks. A raw MCP pipe
is the same kind of grant, and could be asked the same way, naming the
Expand Down Expand Up @@ -592,4 +586,4 @@ details:
- **MCP Apps in Antigravity's CLI and IDE,** which show text only. The App
supports MCP Apps itself, so there is no Apps polyfill for Antigravity.
- **Hosts with no extension layer and no API like Codex's `app-server`**
(ChatGPT is one). See the [README](../README.md#other-hosts).
(ChatGPT is one). See the [host support table](../README.md#polyfills).
Binary file added docs/media/demos/apps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/demos/ard.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/demos/events.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/demos/launch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/demos/server-cards.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/demos/skills.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions docs/polyfill-contract.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The polyfill contract

A polyfill in this repository meets these rules. Where one doesn't yet, its
README says so.
These requirements apply to each host adapter. Document exceptions in the
adapter’s README.

## 1. One published extension, client side, and nothing else

Expand All @@ -20,7 +20,6 @@ unchanged, and "extension" below means either kind.

It adds no methods, fields, capabilities or policy of its own. If a server
behaves in a way the spec doesn't define, the polyfill refuses or ignores it.
It doesn't invent an accommodation.

One exception is allowed: an earlier form of the same extension that servers
in real use still speak. A polyfill may accept that form if it:
Expand All @@ -30,8 +29,7 @@ in real use still speak. A polyfill may accept that form if it:
exactly;
- says in its README that this goes beyond the spec.

Any other exception is one the user makes on purpose, for one server at a
time, and is off by default.
Other exceptions require explicit opt-in for each server and are disabled by default.

Example: by default `mcp-events` also uses servers that advertise events in
the form from before SEP-3415. `MCP_EVENTS_PRE_STANDARD=off` turns that off,
Expand Down
7 changes: 0 additions & 7 deletions docs/t3-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ Checked against T3 Code 0.1.11 (the `t3` npm package, released 20 November

## What T3 Code is

T3 Tools makes one agent product that runs on your machine: T3 Code. T3 Chat,
the company's chat app, is a hosted web product. Neither pingdotgg nor
t3dotgg publishes its source (the repositories named after it on GitHub are
other people's clones), and T3 Code's docs mention it only as a plan that lets
T3 Connect link more machines. It has nothing local for a polyfill to plug
into, so nothing here applies to it.

T3 Code doesn't have an agent loop of its own. It drives the agents you
already have and are signed in to: Claude Code, Codex, Cursor, OpenCode, Grok
Build, Antigravity, Kiro, Pi, Muse Code, fx, and any ACP agent. Each is a
Expand Down
42 changes: 12 additions & 30 deletions plugins/agent-polyfill/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
# agent-polyfill

Installs every MCP polyfill in the [AgentPolyfill](../../README.md)
marketplace for Claude Code at once. It holds no code of its own: it lists
each polyfill as a dependency, and Claude Code installs the dependencies from
the same marketplace.
Install the Claude Code plugin bundle, then start a new session:

```
```text
/plugin install agent-polyfill --marketplace idosal/AgentPolyfill
```

Today that is:

- `mcp-apps-cli`: MCP Apps, app UIs inline in the terminal
([README](../../polyfills/apps/claude-code/README.md)).
- `mcp-events`: MCP Events, Claude watches events on your MCP servers and
reacts when they happen
([README](../../polyfills/events/claude-code/README.md)).
- `mcp-server-cards`: MCP Server Cards, Claude finds the MCP servers a domain
publishes and adds the one you pick
([README](../../polyfills/server-cards/claude-code/README.md)).

Each polyfill is a plugin of its own, so you can disable or uninstall any of
them on its own, or install only the ones you want
(`/plugin install mcp-apps-cli --marketplace idosal/AgentPolyfill`).
- [`mcp-apps-cli`](../../polyfills/apps/claude-code/) — Render interactive MCP Apps in the terminal.
- [`mcp-events`](../../polyfills/events/claude-code/) — Watch and receive MCP events.
- [`mcp-server-cards`](../../polyfills/server-cards/claude-code/) — Discover and add MCP servers by domain.

## Skills is no longer in the bundle
Each plugin can also be installed or disabled individually.
[ARD discovery](../../polyfills/ard/claude-code/) is installed separately.

Up to version 0.2.0 the bundle also installed `mcp-skills`. From 0.3.0 it
doesn't, and the marketplace no longer lists it: Claude Code lists skills from
MCP servers itself, in beta from 2.1.332
([changelog](https://code.claude.com/docs/en/changelog)).
## Upgrading from 0.2.0

If you installed it before, by name or through this bundle, remove it with
`/plugin uninstall mcp-skills@agent-polyfill`. Whether Claude Code removes a
plugin by itself when a bundle stops depending on it isn't known here, so
look in `/plugin` after updating. What it kept on your machine, and how to
remove that, is in
[`polyfills/claude-code/skills`](../../polyfills/claude-code/skills/README.md).
Claude Code supports MCP Skills natively from 2.1.332 (beta). Version 0.3.0
removed `mcp-skills` from the bundle. Check `/plugin` after updating. If the old
plugin is still installed, run `/plugin uninstall mcp-skills@agent-polyfill`.
See [migration and local data cleanup](../../polyfills/claude-code/skills/README.md).
28 changes: 11 additions & 17 deletions polyfills/apps/claude-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ MCP Apps in the Claude Code terminal. When Claude calls a tool that ships an
interface appears inline, under the tool call, and you can click, drag and
type into it. Existing MCP servers work unmodified.

<a href="https://agentpolyfill.com/media/apps.mp4">
<picture>
<source media="(prefers-reduced-motion: reduce)" srcset="../../../site/public/media/apps.jpg">
<img src="../../../docs/media/demos/apps.gif" alt="Claude Code runs DOOM, plots CPU usage and rotates a 3D model in the terminal.">
</picture>
</a>

[Watch DOOM, a live chart and a 3D model in Claude Code (19 s)](https://agentpolyfill.com/media/apps.mp4)

- **Real pixels** in terminals that show images: iTerm2 3.5+, kitty and
Ghostty.
- **Character cells** everywhere else: Terminal.app, VS Code, tmux and so on.
Text, including chart labels, stays real characters.

![Real pixels on the left, character cells on the right](docs/demo-side-by-side.png)

The [video](https://github.com/idosal/AgentPolyfill/releases/download/mcp-apps-cli-v0.1.0/mcp-apps-cli-demo.mp4)
(33 s, MP4) starts with a classic shareware game from the hosted arcade
server, played with keys and clicks. Next, a cohort heatmap from an MCP server
opens under the tool call and answers the pointer. Last comes a 3D scene
Claude writes, turned by dragging. The still above is from an earlier
recording of two terminals side by side.

Codex: not yet. What Codex would need is in
[What hosts would need to change](../../../docs/host-changes.md).

Expand Down Expand Up @@ -109,6 +109,8 @@ Each of these comes up once.

### Using a view

![Graphics and character-cell rendering side by side](docs/demo-side-by-side.png)

Add MCP servers as usual. When Claude calls a tool with an MCP App, the app
appears under the call, sized to fit.

Expand Down Expand Up @@ -307,11 +309,3 @@ Releases are built on GitHub Actions
Apache-2.0 ([LICENSE](../../../LICENSE)). The helper includes third-party
crates and npm packages under their own licenses:
[THIRD_PARTY_LICENSES.txt](THIRD_PARTY_LICENSES.txt).

Part of [AgentPolyfill](../../../README.md): MCP extensions for hosts that
haven't shipped them yet.

This is a community project. It isn't affiliated with or endorsed by
Anthropic, OpenAI, the Model Context Protocol project, the Agentic AI
Foundation or the Linux Foundation. Claude and Claude Code are trademarks of
Anthropic, PBC. OpenAI and Codex are trademarks of OpenAI.
9 changes: 9 additions & 0 deletions polyfills/ard/antigravity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ Find MCP servers for Google Antigravity through Agentic Resource Discovery
a task in plain words. Each search, and each server you add, is put to you
first in Antigravity's own approval card.

<a href="https://agentpolyfill.com/media/ard.mp4">
<picture>
<source media="(prefers-reduced-motion: reduce)" srcset="../../../site/public/media/ard.jpg">
<img src="../../../docs/media/demos/ard.gif" alt="Claude Code finds Buildkite’s MCP server by domain, then asks permission to search a local ARD registry.">
</picture>
</a>

[Watch Claude Code look up Buildkite and search a registry (16 s)](https://agentpolyfill.com/media/ard.mp4)

ARD is a draft from outside MCP, published by the
[ards-project](https://github.com/ards-project/ard-spec) on GitHub; this
plugin follows v0.91 (see [Spec and conformance](#spec-and-conformance)).
Expand Down
21 changes: 11 additions & 10 deletions polyfills/ard/claude-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Claude finds MCP servers through Agentic Resource Discovery (ARD): in what a
domain lists, or by asking an ARD registry for a server that can do a task.
You choose the registry, and Claude Code asks you before every search.

<a href="https://agentpolyfill.com/media/ard.mp4">
<picture>
<source media="(prefers-reduced-motion: reduce)" srcset="../../../site/public/media/ard.jpg">
<img src="../../../docs/media/demos/ard.gif" alt="Claude Code finds Buildkite’s MCP server by domain, then asks permission to search a local ARD registry.">
</picture>
</a>

[Watch Claude Code look up Buildkite and search a registry (16 s)](https://agentpolyfill.com/media/ard.mp4)

Also available for Codex, Pi and OpenCode: [ard-discovery for Codex](../codex/README.md), [ard-discovery for Pi](../pi/README.md), [ard-discovery for OpenCode](../opencode/README.md).

> Search for an MCP server that can check why my CI build failed.
Expand Down Expand Up @@ -262,7 +271,7 @@ Codex differs.

The one public ARD registry found returns MCP results that point at an MCP
Registry `server.json` rather than a Server Card, so `mcp-server-cards`
refuses every one (see [Findings](#findings-to-report-upstream)). Until a
refuses every one (see [Findings](#interoperability-notes)). Until a
public registry serves valid cards, the [demo registry](#demo-registry)
stands in.

Expand Down Expand Up @@ -297,9 +306,7 @@ stands in.
- **Upstream conformance:** the MCP conformance suite has no Server Card or
ARD scenarios (`modelcontextprotocol/conformance` at `96a6f9478b`).

### Findings to report upstream

Not yet reported upstream:
### Interoperability notes

- **Hugging Face Discover** (the Space at `huggingface-hf-discover.hf.space`)
answers searches with entries typed `application/mcp-server-card+json`
Expand Down Expand Up @@ -335,9 +342,3 @@ The code is in [`mod/hooks`](mod/hooks):
## Licence

Apache-2.0, like the rest of this repository ([LICENSE](../../../LICENSE)).

This is a community project. It isn't affiliated with or endorsed by
Anthropic, OpenAI, the Model Context Protocol project, the Agentic AI
Foundation, the Linux Foundation, or the authors of ARD. Claude and Claude
Code are trademarks of Anthropic, PBC. OpenAI and Codex are trademarks of
OpenAI.
Loading
Loading