Elicit.js

Using Elicit.js with coding agents

An agent can ask you with a chart instead of a question in words. In a chat, it shows an Elicit.js card, you answer by dragging, drawing or clicking, and it reads your answer as rows. In a codebase, it writes Elicit.js into your app. The elicitjs-mcp server and the agent skill that ships with the package give it both.

Quick start

Paste this into your agent. It sets up the server, checks it, and asks you a first question.

Help me set up Elicit.js for my agent.

1. Add the Elicit.js MCP server to my client. It runs with: npx -y elicitjs-mcp
   Set ELICITJS_MCP_MODE to "chat" if you will ask me questions in this chat,
   or "build" if you are writing Elicit.js into this project.
2. If we are in a project folder, run: npx -y elicitjs-mcp setup
   so every agent here reads the Elicit.js skill.
3. Check it works: list the Elicit.js widgets.
4. Then ask me something with a chart: how I split my week between
   work, sleep, people and play.

To set it up by hand, see Install and configure.

What you can ask

Each chat below is live. Answer the card: the line under it is what the agent reads while you work, and Submit sends it as your next message.

Split a budget

We have $100k for next quarter. Ask me how I'd split it across hiring, marketing, tools and travel.

Drag each bar to set its share. The four always add up to 100.

The agent reads nothing yet

Draw a forecast

I have a hunch about our sign-ups for the next ten weeks. Let me draw it instead of typing numbers.

Draw your forecast on the card. I'll compare it with the real numbers as they come in.

The agent reads nothing yet

Show a feeling

The launch is next week. Ask me how I'm feeling about it.

Shape the face until it looks the way you feel.

The agent reads nothing yet

Point to a likelihood

How likely is it that we ship by March? Ask me in words, not percentages.

Point the needle at how likely you think it is.

The agent reads nothing yet

Build a diagram together

Help me map what drives churn. Start a diagram and I'll add to it.

Here's a start with three ideas. Add yours, link what causes what, and rename anything.

The agent reads nothing yet

Write it into your app

In build mode the agent writes the card into your code and tests it with check_spec before it hands it over.

Add a question to our onboarding survey where people rank five features.

I've added it to the survey. Here's the code, and the card it draws:

import { Elicit, compile } from "elicitjs";
const chart = Elicit(compile({
widget: {
type: "ranking",
question: "Rank these features by how much you would use them",
items: ["Offline mode", "Shared lists", "Reminders", "Dark theme", "Export"],
},
}));
document.querySelector("#feature-rank").append(chart.dom());
// The rows are the answer: save them with the rest of the survey.
chart.on("change", (rows) => survey.save("featureRank", rows));
The agent reads nothing yet

What the server provides

Ask in a chat

Shows a card in the conversation. The agent reads the chart as you leave it and can change it too; your edits and its edits show on the same card. Submit carries on the chat without typing. The card can go full screen or float.

ask_with_visualread_chartupdate_chart

Look it up

The skill, a keyword, a docs page or example, or a search, by one string.

elicitjs_docs

Check and test

Builds a spec headlessly, lists what to fix, answers it as a person would, and renders it to PNG.

check_spec

Export

Writes a page with the card and the library, which opens from disk.

export_html

Prompts

Slash commands in hosts that list prompts: ask with a card, or design a new way to ask.

author_elicit_chartdesign_elicitation

ELICITJS_MCP_MODE picks the tools:

  • chat asks a person in a chat host, such as Claude Desktop: ask_with_visual, read_chart, update_chart and elicitjs_docs.
  • build is for an agent writing Elicit.js into an app: elicitjs_docs, check_spec and export_html.

Leave out ELICITJS_MCP_MODE for all six tools. Specs are JSON, the form compile() reads. The server is alpha.

Install and configure

In Claude Code, add the server in build mode:

claude mcp add elicitjs-build -e ELICITJS_MCP_MODE=build -- npx -y elicitjs-mcp

In Claude Desktop, add it in chat mode to claude_desktop_config.json, then restart the app:

{
"mcpServers": {
"elicitjs": {
"command": "npx",
"args": ["-y", "elicitjs-mcp"],
"env": { "ELICITJS_MCP_MODE": "chat" }
}
}
}

Other clients take the same command, npx -y elicitjs-mcp. For PNG rendering in check_spec, also run npx playwright install chromium once.

The skill

The elicit skill is a short SKILL.md with reference files: how to write a spec, ask well, design a new technique, and build Elicit.js into an app. It ships inside the npm package, so an agent reads the version that matches the library you installed: node_modules/elicitjs/skills/elicit/SKILL.md.

To tell every agent that works in a project to read it, run this in the project's folder:

npx -y elicitjs-mcp setup

It adds a short block to the project's AGENTS.md, and to its CLAUDE.md when that file does not already read AGENTS.md. Running it again refreshes the block and leaves the rest of the file alone.

To add the skill to your agent's own skills folder instead:

npx skills add elicitjs/elicitjs --skill elicit

skills add copies the skill from the GitHub repository, so it follows the latest source rather than your installed version.

The docs as Markdown

The site publishes three plain-text forms of these pages:

  • /llms.txt lists every page with a one-line description, grouped as the sidebar groups them.
  • /llms-full.txt holds every page in one file.
  • Each page's route plus .md is that page alone: its prose, each example's title and code, and its API reference. This page is /start/agents.md.

The examples name keywords bare and call the docs' mount(node). Reading the examples shows how they map to your own code.