nlweb-chatgpt-appsdk

Integrate NLWeb with ChatGPT's Apps SDK — the Node.js MCP server in `openai-apps-sdk-integration/`, the `nlweb-list` tool, the React widget at `ui://widget/nlweb-list.html`, and the port-8100 AppSDK adapter that translates NLWeb's message list to OpenAI Apps SDK envelopes. Use when publishing an NLWeb site as a ChatGPT app or wiring NLWeb results into an Apps SDK widget.

17 stars

Best use case

nlweb-chatgpt-appsdk is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Integrate NLWeb with ChatGPT's Apps SDK — the Node.js MCP server in `openai-apps-sdk-integration/`, the `nlweb-list` tool, the React widget at `ui://widget/nlweb-list.html`, and the port-8100 AppSDK adapter that translates NLWeb's message list to OpenAI Apps SDK envelopes. Use when publishing an NLWeb site as a ChatGPT app or wiring NLWeb results into an Apps SDK widget.

Teams using nlweb-chatgpt-appsdk should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nlweb-chatgpt-appsdk/SKILL.md --create-dirs "https://raw.githubusercontent.com/OrcaQubits/agentic-commerce-skills-plugins/main/dist/antigravity/nlweb-protocol/.agent/skills/nlweb-chatgpt-appsdk/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nlweb-chatgpt-appsdk/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nlweb-chatgpt-appsdk Compares

Feature / Agentnlweb-chatgpt-appsdkStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Integrate NLWeb with ChatGPT's Apps SDK — the Node.js MCP server in `openai-apps-sdk-integration/`, the `nlweb-list` tool, the React widget at `ui://widget/nlweb-list.html`, and the port-8100 AppSDK adapter that translates NLWeb's message list to OpenAI Apps SDK envelopes. Use when publishing an NLWeb site as a ChatGPT app or wiring NLWeb results into an Apps SDK widget.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# NLWeb + ChatGPT Apps SDK

## Before writing code

**Fetch live docs**:
1. Fetch https://github.com/nlweb-ai/NLWeb/blob/main/docs/nlweb-chatgpt-integration.md for the canonical wiring steps.
2. Fetch https://github.com/nlweb-ai/NLWeb/blob/main/docs/nlweb-appsdk-adapter.md for the port-8100 adapter.
3. Inspect `openai-apps-sdk-integration/nlweb_server_node/` in the live repo — this is a separate Node.js/TypeScript MCP server.
4. Web-search OpenAI's current Apps SDK documentation — link from https://platform.openai.com.
5. Verify the React widget contract — what `nlweb-list.html` expects from the tool result envelope.

## Conceptual Architecture

### Why a Separate Adapter?

NLWeb's native `/mcp` returns generic MCP tool results — a list of Schema.org objects. ChatGPT's Apps SDK expects a richer envelope that pairs tool output with a UI resource (widget). The integration ships **two extra pieces** on top of the base NLWeb server:

1. **`openai-apps-sdk-integration/nlweb_server_node/`** — a Node.js/TypeScript MCP server that registers an `nlweb-list` tool and serves a React widget at `ui://widget/nlweb-list.html`. ChatGPT discovers this and renders the widget when the tool returns results.

2. **AppSDK Adapter (port 8100, `appsdk_adapter_server.py`)** — an aiohttp server that takes legacy NLWeb message-list responses and re-shapes them into the OpenAI Apps SDK envelope on the fly. Useful if you already have NLWeb running and want to plug ChatGPT in without rewriting clients.

Native MCP clients (Claude, Gemini) ignore both — they hit the canonical `/mcp` on port 8000.

### The Two Integration Paths

| Path | Use When |
|------|----------|
| **Node.js MCP server with widget** | You want the full ChatGPT app experience with the React widget |
| **Port-8100 AppSDK adapter** | You only want translation; you don't need a widget |

For a new build, use path 1. For retrofitting an existing NLWeb deployment, path 2 is lower-risk.

### The `nlweb-list` Tool

The Node.js server registers a single MCP tool, `nlweb-list`, with a schema like:

```json
{
  "name": "nlweb-list",
  "description": "Query the site and render a list of results as a card carousel.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": { "type": "string" },
      "site": { "type": "string" }
    },
    "required": ["query"]
  }
}
```

(Verify exact schema in the live repo.)

The tool internally calls the NLWeb `/ask` endpoint and returns:
- Structured tool output (the result list)
- A UI resource reference: `ui://widget/nlweb-list.html`

ChatGPT's Apps SDK runtime renders the widget, passes the tool output into it via the SDK's `window.openai`-style API (or its successor — Apps SDK is rapidly evolving).

### The React Widget

The widget lives in the Node.js project and is bundled into a single HTML file served at `ui://widget/nlweb-list.html`. It renders the Schema.org results as cards (image, name, description, score). Typical features:
- Type-aware cards (Recipe vs Product vs Event)
- Click-through to source URL
- Optional follow-up actions

### Port 8100 Adapter

`webserver/appsdk_adapter_server.py` runs as a **separate process** alongside the main NLWeb server. It:
- Listens on port 8100
- Proxies `/ask` to the main server on port 8000
- Translates NLWeb's stream of message objects to OpenAI Apps SDK envelope shape
- Serves a UI resource ChatGPT can render

Existing clients still hit `:8000/ask`; only ChatGPT clients hit `:8100/ask`. They share the same backend data and config.

### MCP Protocol Version Compatibility

The Node.js MCP server uses the same protocol version (`2024-11-05`) as NLWeb's Python `/mcp`. Pin to this; ChatGPT updates its Apps SDK runtime frequently — re-test on every OpenAI release.

### ChatGPT App Approval

Publishing as a public ChatGPT app requires going through OpenAI's review process. The dev experience:
1. Build the MCP server + widget
2. Test locally with ChatGPT's developer mode (links it to localhost)
3. Submit for review per OpenAI's current process (verify the latest steps)
4. Distribute via the GPT Store

OpenAI's policies change — always check the current submission docs.

## Implementation Guidance

### Path 1: Run the Node.js MCP Server

```bash
cd openai-apps-sdk-integration/nlweb_server_node
npm install
npm run build
npm start
```

(Verify exact commands against the live `package.json`.)

Configure the underlying NLWeb URL via env var (typically `NLWEB_ASK_URL=http://localhost:8000/ask`).

Then add the MCP server to ChatGPT's developer mode pointing at the Node.js server's URL.

### Path 2: Run the Port-8100 Adapter

```bash
# Main NLWeb on :8000
python AskAgent/python/app-aiohttp.py

# AppSDK adapter on :8100
python AskAgent/python/webserver/appsdk_adapter_server.py
```

Point ChatGPT at the :8100 endpoint instead of :8000.

### Widget Customization

If you fork the React widget:
- Keep the result-list shape stable — ChatGPT expects a consistent contract
- Test in multiple ChatGPT clients (web, mobile) — rendering quirks vary
- Don't make the widget too large; ChatGPT clips overflowing content

### Tool Naming for Discovery

ChatGPT picks tools based on the description. For an NLWeb-backed app, write the `description` to be specific about the *domain* (e.g., "Search recipes from Joy of Cooking" not "Generic NL search"). Site operators frequently fork the Node.js server to customize this.

### Combining With Native MCP

A single NLWeb deployment can serve both audiences:
- Claude / Gemini / direct MCP clients → port 8000 `/mcp`
- ChatGPT → port 8100 adapter OR Node.js server (whichever path you chose)

Both share the same retrieval and ranking. No data duplication.

### Common Pitfalls

- **Widget renders but data is empty** — the result envelope doesn't match what the widget JS expects. Console-log the tool output in ChatGPT's developer mode to inspect.
- **ChatGPT can't find the MCP server** — port not exposed, or the server didn't advertise itself correctly during the developer-mode handshake.
- **CORS errors when widget loads** — the UI resource origin restrictions. Serve from a single origin or set proper CORS.
- **Latency spikes via :8100 adapter** — the adapter buffers the SSE stream before translating. Acceptable for short queries; problematic for `mode=generate`. Use path 1 for streaming-heavy use cases.
- **Apps SDK API changes break the widget** — OpenAI updates the `window.openai`-style runtime frequently. Pin a tested SDK version in the React build.

Always re-fetch `nlweb-chatgpt-integration.md` and the Node.js project's `README.md` before customizing — this is one of the fastest-moving parts of NLWeb.

Related Skills

nlweb-tools-framework

17
from OrcaQubits/agentic-commerce-skills-plugins

Design and implement NLWeb tools — the per-Schema.org-type handlers that turn a query into a specialized response (search, item_details, compare_items, ensemble, recipe_substitution, accompaniment, conversation_search, etc.). Covers `tools.xml`, the ToolSelector router, builtin handlers in `methods/`, writing a custom tool with a `<returnStruc>` contract, and disabling tool selection for raw retrieval. Use when extending NLWeb beyond the default query → results flow.

nlweb-setup

17
from OrcaQubits/agentic-commerce-skills-plugins

Bootstrap a local NLWeb development environment from scratch — clone the repo, configure .env, install Python deps via `nlweb init-python`, run `nlweb init` for interactive LLM/retrieval selection, load sample Schema.org data, and verify with `nlweb check`. Use when starting a new NLWeb deployment from zero.

nlweb-schema-org-grounding

17
from OrcaQubits/agentic-commerce-skills-plugins

Prepare and structure site content as Schema.org JSON-LD for NLWeb ingestion — covers the supported types (Recipe, Product, Movie, Event, Article, RealEstate, Course, etc.), per-type behavior in NLWeb's tool routing, JSON-LD embedding patterns in HTML, sites.xml registration, and how the `schema_object` flows through ranking back to agent results. Use when authoring or auditing the structured data on a site that will be exposed via NLWeb.

nlweb-retrieval-backends

17
from OrcaQubits/agentic-commerce-skills-plugins

Choose and configure NLWeb retrieval backends — Qdrant (local + remote), Azure AI Search, Elasticsearch, OpenSearch (with/without k-NN), Postgres pgvector, Milvus, Snowflake Cortex Search, Cloudflare AutoRAG, Shopify MCP, and Bing Web Search. Covers `config_retrieval.yaml`, the single `write_endpoint` rule, parallel read-fanout with URL dedup, and per-backend setup pages. Use when picking a retrieval store, migrating between backends, or debugging "results are empty."

nlweb-prompts-customization

17
from OrcaQubits/agentic-commerce-skills-plugins

Customize NLWeb's LLM prompts and per-Schema.org-type behavior via `prompts.xml` and `site_types.xml` — covers the `<promptString>` template format, `<returnStruc>` JSON schemas, prompt inheritance, decontextualization/ranking/generate templates, per-site overrides, and pitfalls of editing prompts in place. Use when tuning answer quality, supporting a new domain, or localizing prompts.

nlweb-mcp-server

17
from OrcaQubits/agentic-commerce-skills-plugins

Expose NLWeb as an MCP (Model Context Protocol) server — JSON-RPC 2.0 endpoint at /mcp, the `ask` / `list_sites` / `who` tools, MCP protocol version 2024-11-05, and integration with ChatGPT, Claude, Gemini, and other agent clients. Use when wiring NLWeb to an AI agent via MCP or building an MCP client that consumes an NLWeb site.

nlweb-llm-providers

17
from OrcaQubits/agentic-commerce-skills-plugins

Configure NLWeb LLM and embedding providers — OpenAI, Azure OpenAI (default), Anthropic, Google Gemini, DeepSeek on Azure, Llama on Azure, HuggingFace, Inception Labs, Snowflake Cortex, Ollama, Pi Labs. Covers `config_llm.yaml` high/low tier model selection, the ModelRouter cost/quality routing logic, `config_embedding.yaml`, and adding a custom provider. Use when picking models, tuning cost, or wiring a new LLM backend.

nlweb-data-loading

17
from OrcaQubits/agentic-commerce-skills-plugins

Ingest site content into NLWeb's vector store using `db_load.py` — supports RSS/Atom feeds, Schema.org JSON-LD, sitemap-driven URL lists, and CSV. Covers chunking, embedding computation, site partitioning, batch sizing, delete-and-reload, and per-backend write_endpoint targeting. Use when bootstrapping a site's index, refreshing content, or migrating between retrieval backends.

nlweb-auth-multitenancy

17
from OrcaQubits/agentic-commerce-skills-plugins

Configure NLWeb authentication and multi-tenant deployments — OAuth providers (GitHub, Google, Microsoft, Facebook), session storage, the `sites:` allowlist in `config_nlweb.yaml`, conversation persistence per authenticated user, and per-tenant data isolation. Use when adding login to an NLWeb instance, hosting multiple customers on one deployment, or persisting conversation history.

nlweb-ask-endpoint

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement and consume the NLWeb /ask REST endpoint — request shape (GET/POST, query-string and v0.55 structured body), SSE streaming response, modes (list/summarize/generate), in-stream "message_type" headers, error envelopes, and client-side parsing. Use when building an NLWeb server route, calling /ask from a custom agent, or debugging /ask responses.

woo-testing

17
from OrcaQubits/agentic-commerce-skills-plugins

Test WooCommerce extensions — PHPUnit unit/integration tests, WP test suite, WooCommerce test helpers, E2E with Playwright, and WP-CLI test scaffolding. Use when writing tests for WooCommerce plugins or setting up a test environment.

woo-shipping

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce shipping methods — WC_Shipping_Method, shipping zones, shipping classes, rate calculation, tracking, and integration with carriers. Use when creating custom shipping integrations or configuring shipping logic.