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
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "caplets",
"interface": {
"displayName": "Caplets"
},
"plugins": [
{
"name": "caplets",
"source": {
"source": "local",
"path": "./"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Developer Tools"
}
]
}
5 changes: 5 additions & 0 deletions .changeset/native-agent-plugin-bundles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"caplets": patch
---

Add root-level Codex and Claude Code plugin artifacts that package Caplets MCP server configuration and shared agent skill guidance.
14 changes: 14 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "caplets",
"owner": {
"name": "Spirit-Led Software LLC"
},
"plugins": [
{
"name": "caplets",
"source": "./",
"description": "Expose configured Caplets as progressive-disclosure tools in Claude Code.",
"category": "Developer Tools"
}
]
}
14 changes: 14 additions & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "caplets",
"version": "0.12.1",
"description": "Expose configured Caplets as progressive-disclosure tools in Claude Code.",
"author": {
"name": "Spirit-Led Software LLC"
},
"homepage": "https://github.com/spiritledsoftware/caplets#readme",
"repository": "https://github.com/spiritledsoftware/caplets",
"license": "MIT",
"keywords": ["caplets", "mcp", "claude-code", "tools"],
"skills": "./skills/",
"mcpServers": "./claude.mcp.json"
}
28 changes: 28 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "caplets",
"version": "0.12.1",
"description": "Expose configured Caplets as progressive-disclosure tools in Codex.",
"author": {
"name": "Spirit-Led Software LLC"
},
"homepage": "https://github.com/spiritledsoftware/caplets#readme",
"repository": "https://github.com/spiritledsoftware/caplets",
"license": "MIT",
"keywords": ["caplets", "mcp", "codex", "tools"],
"skills": "./skills/",
"mcpServers": "./codex.mcp.json",
"interface": {
"displayName": "Caplets",
"shortDescription": "Progressive disclosure for Caplets tools.",
"longDescription": "Use Caplets to discover and call configured MCP, OpenAPI, GraphQL, HTTP, and CLI tools without flattening every downstream tool into context.",
"developerName": "Spirit-Led Software LLC",
"category": "Developer Tools",
"capabilities": ["MCP", "Tools"],
"websiteURL": "https://github.com/spiritledsoftware/caplets",
"defaultPrompt": [
"Use Caplets to discover configured capability domains before calling downstream tools.",
"Use Caplets progressive discovery before calling downstream tools."
],
"brandColor": "#4F46E5"
}
}
134 changes: 96 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,99 @@
# Caplets

Caplets is a progressive-disclosure gateway for Model Context Protocol (MCP) servers,
native OpenAPI endpoints, native GraphQL endpoints, and explicitly configured HTTP APIs.
Caplets turns sprawling tool setups into focused capability cards for coding agents.
Connect MCP servers, OpenAPI specs, GraphQL endpoints, HTTP actions, and curated CLI
commands without flooding the model with every downstream operation up front.

Instead of connecting an MCP client to many downstream servers or HTTP APIs and exposing
every operation up front, Caplets exposes one top-level tool per configured capability.
An agent first chooses a capability domain, then asks Caplets to list, search, inspect,
or call that backend's underlying tools or operations.
Instead of exposing a flat wall of tools, Caplets shows one top-level tool per capability.
The agent chooses a domain first, then uses scoped operations like `search_tools`,
`get_tool`, and `call_tool` only when it needs more detail.

This keeps the initial MCP tool list small, makes tool selection easier, and avoids
flattened tool-name collisions across servers.
## Quick Start

Caplets requires Node.js 22 or newer.

```sh
pnpm add -g caplets
caplets init
```

Add a capability from an existing system:

```sh
# Wrap an MCP server
caplets add mcp docs --command npx --arg -y --arg @upstash/context7-mcp

# Convert useful repository commands into curated tools
caplets add cli repo-tools --repo . --include git,gh,package

# Install ready-made Caplets from a repository
caplets install spiritledsoftware/caplets github linear context7
```

Connect Caplets to any MCP client:

```json
{
"mcpServers": {
"caplets": {
"command": "caplets",
"args": ["serve"]
}
}
}
```

Ask your agent to use Caplets. It will see a compact capability list first, then inspect
only the backend it needs.

## Agent Plugins

Use Caplets as a normal MCP server everywhere, or install a native agent integration when
your coding agent supports one.

| Agent | Install | What It Provides |
| -------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Any MCP client | Add `caplets serve` as a stdio MCP server | Universal progressive-disclosure gateway |
| Claude Code | `claude plugin marketplace add spiritledsoftware/caplets && claude plugin install caplets@caplets` | Claude Code plugin metadata, MCP config, and shared skill guidance |
| Codex | `codex plugin marketplace add spiritledsoftware/caplets`, then install `caplets` from Codex plugins | Codex plugin metadata, MCP config, and shared skill guidance |
| OpenCode | Install [`@caplets/opencode`](packages/opencode/README.md) | Native `caplets_<id>` tools and prompt guidance hooks |
| Pi | Install [`@caplets/pi`](packages/pi/README.md) | Native `caplets_<id>` tools with Pi prompt snippets/guidelines |

Codex and Claude Code plugins are plugin-native but MCP-backed. Their manifests live in
`.codex-plugin/` and `.claude-plugin/`; component files live at the plugin root so
marketplace installs can copy and resolve them correctly.

The Claude Code and Codex commands install from this GitHub repository through each agent's
plugin marketplace flow; users do not need to clone the repository manually. Plugin MCP
configs run `caplets serve` directly, so install the Caplets CLI globally first.

## Convert Existing Tooling

Caplets is designed to convert what you already use into agent-friendly capability domains.

| Existing source | Command |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| Local MCP server | `caplets add mcp local-tools --command node --arg ./server.mjs` |
| Remote MCP server | `caplets add mcp remote-tools --url https://mcp.example.com/mcp --transport http --token-env MCP_TOKEN` |
| OpenAPI service | `caplets add openapi users --spec ./openapi.json --base-url https://api.example.com --token-env USERS_API_TOKEN` |
| GraphQL endpoint | `caplets add graphql catalog --endpoint-url https://api.example.com/graphql --schema ./schema.graphql` |
| Simple HTTP API | `caplets add http status-api --base-url https://api.example.com --action get_status:GET:/status/{service}` |
| Repository CLI workflows | `caplets add cli repo-tools --repo . --include git,gh,package` |
| Shared Caplet catalog | `caplets install spiritledsoftware/caplets github linear context7` |

Generated Caplet files are written to `./.caplets` by default so teams can review,
version, and customize them with the project.

## Why It Matters

Large MCP setups make agents worse before they make them better. If every downstream
server exposes every tool up front, the model starts with a noisy flat list, duplicate
tool names, and a bigger context surface before it knows which capability matters.
Large MCP setups can make agents harder to steer. If every downstream server exposes
every tool up front, the model starts with a noisy flat list, duplicate tool names, and
a larger context surface before it knows which capability matters.

Caplets turns that flat tool wall into progressive disclosure: one capability card first,
then scoped discovery only after the agent chooses the relevant domain.

## Benchmark Results
## Benchmark

In Caplets' reproducible coding-agent benchmark, the same three mock MCP servers are
exposed two ways: direct flat MCP aggregation versus Caplets progressive disclosure.
Expand All @@ -32,9 +105,9 @@ exposed two ways: direct flat MCP aggregation versus Caplets progressive disclos
| Approx. context surface | 8,023 tokens | 2,100 tokens | 5,923 fewer |
| Top-level name collisions | 3 duplicate names | 0 | eliminated |

The important part: Caplets does not remove access to the downstream tools. It hides
them behind scoped discovery operations like `search_tools`, `get_tool`, and `call_tool`,
so the agent sees less up front while still being able to reach the same capabilities.
Caplets does not remove access to downstream tools. It places them behind scoped
discovery operations, so the agent sees less up front while retaining access to the same
capabilities when needed.

A local OpenCode live benchmark also completed the full benchmark matrix successfully:

Expand All @@ -57,10 +130,10 @@ pnpm build
CAPLETS_BENCH_LIVE=1 pnpm benchmark:live:opencode -- --model openai/gpt-5.5-fast
```

## Inspiration
## Design Model

Caplets is a mashup of two ideas that work well separately but leave a gap together:
agent skills and MCP servers.
Caplets combines two ideas that work well separately but leave a gap together: agent
skills and MCP servers.

Agent skills are great at progressive disclosure. They show an agent a compact capability
card first, then let it read deeper instructions only when that skill is relevant. MCP
Expand All @@ -72,7 +145,7 @@ Caplets borrows the skill-shaped discovery model and applies it to MCP. Each dow
server becomes a skill-like capability card first; its actual MCP tools stay hidden until
the agent chooses that server and asks to search, list, inspect, or call them.

## What It Does
## Capabilities

- Reads downstream MCP server definitions, native OpenAPI endpoint definitions, native GraphQL endpoint definitions, explicit HTTP API action definitions, and curated CLI tool definitions from the user config file.
- Registers one generated MCP tool for each enabled MCP server, OpenAPI endpoint, GraphQL endpoint, HTTP API, or CLI tools backend.
Expand All @@ -89,21 +162,6 @@ the agent chooses that server and asks to search, list, inspect, or call them.
- Redacts secrets from structured errors.
- Supports static remote auth and OAuth token storage for remote servers.

## Install

Caplets requires Node.js 22 or newer.

```sh
pnpm add -g caplets
```

For local development from this repository:

```sh
pnpm install
pnpm build
```

## Configure

Create a starter user config at `${XDG_CONFIG_HOME:-~/.config}/caplets/config.json` on Unix-like platforms or `%APPDATA%\caplets\config.json` on Windows:
Expand Down Expand Up @@ -706,11 +764,11 @@ top-level MCP tool list without restarting Caplets. When an MCP-backed Caplet ch
removed, Caplets closes only that affected downstream connection; unrelated Caplets and
their downstream connections keep running.

## Native Agent Integrations
## Additional Native Integrations

Caplets can also run as native agent extensions when the host supports native tools. Native
integrations expose one prefixed tool per configured Caplet, such as `caplets_github`, while
reusing the same Caplets config and backend runtime.
OpenCode and Pi support true native tool registration. Those integrations expose one
prefixed tool per configured Caplet, such as `caplets_github`, while reusing the same
Caplets config and backend runtime.

- [`@caplets/opencode`](packages/opencode/README.md): OpenCode plugin that injects prompt guidance through plugin hooks instead of editing `opencode.json`.
- [`@caplets/pi`](packages/pi/README.md): Pi extension installable with `pi install npm:@caplets/pi`, with guidance provided through Pi tool prompt snippets and guidelines.
Expand Down
8 changes: 8 additions & 0 deletions claude.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"caplets": {
"command": "caplets",
"args": ["serve"]
}
}
}
8 changes: 8 additions & 0 deletions codex.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"caplets": {
"command": "caplets",
"args": ["serve"],
"startup_timeout_sec": 20,
"tool_timeout_sec": 120
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"typecheck": "pnpm -r --filter './packages/*' typecheck",
"test": "pnpm -r --filter './packages/*' test",
"verify": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm schema:check && pnpm test && pnpm benchmark:check && pnpm build",
"version-packages": "changeset version"
"version-packages": "changeset version && node scripts/sync-plugin-versions.mjs && oxfmt .codex-plugin/plugin.json .claude-plugin/plugin.json"
},
"devDependencies": {
"@changesets/cli": "^2.31.0",
Expand Down
Loading
Loading