react-tourlight-mcp 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # react-tourlight-mcp
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Prepare the local MCP server for npm distribution with installation instructions, repository and funding metadata, and an included MIT license. Report the package version during the MCP handshake.
8
+ - Updated dependencies [cab6376]
9
+ - react-tourlight@0.5.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 react-tourlight contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # React Tourlight MCP
2
+
3
+ Local tools for authoring portable Tourlight documents. MIT licensed. Requires Node.js 20+.
4
+
5
+ The server accepts JSON and returns JSON or generated source. It never reads application files, writes changes, executes callbacks, opens a browser, or sends data to a model provider. The MCP host supplies the model and any file/browser access.
6
+
7
+ ## Install and run
8
+
9
+ Requires `react-tourlight` 0.5.0 or later, installed automatically as a dependency.
10
+ For the 0.1.1 release, configure your preferred client with:
11
+
12
+ ```sh
13
+ claude mcp add --transport stdio tourlight -- npx -y react-tourlight-mcp@0.1.1
14
+ codex mcp add tourlight -- npx -y react-tourlight-mcp@0.1.1
15
+ ```
16
+
17
+ Use one command for your chosen client. These commands require the corresponding
18
+ npm releases to be published; for an unreleased checkout use the source setup below.
19
+
20
+ ## Run from this repository
21
+
22
+ After `pnpm install` and `pnpm build` at the repository root:
23
+
24
+ ```sh
25
+ node /absolute/path/to/react-tourlight/packages/tourlight-mcp/index.mjs
26
+ ```
27
+
28
+ Configure a local client using that exact absolute path:
29
+
30
+ ```sh
31
+ claude mcp add --transport stdio tourlight -- node /absolute/path/to/react-tourlight/packages/tourlight-mcp/index.mjs
32
+ codex mcp add tourlight -- node /absolute/path/to/react-tourlight/packages/tourlight-mcp/index.mjs
33
+ ```
34
+
35
+ The commands are alternative client configurations, not prerequisites for each other. Stdio intentionally prints protocol messages only; the process waits for a client connection.
36
+
37
+ ## Tools
38
+
39
+ | Tool | Input | Result |
40
+ | --- | --- | --- |
41
+ | `tourlight_schema` | `{}` | Full JSON Schema |
42
+ | `tourlight_template` | Optional `id`, `name` | Starter document |
43
+ | `tourlight_validate` | `document` | Validity and field-level issues |
44
+ | `tourlight_inspect` | `document` | Routes, targets, and required handlers |
45
+ | `tourlight_format` | `document` | Canonical JSON string |
46
+ | `tourlight_generate_tests` | `document`, `baseUrl` | Playwright target smoke-test source |
47
+
48
+ Every tool is read-only and deterministic. Validation does not check live selectors. Generated tests skip steps requiring application-specific setup; extend them before claiming full journey coverage.
49
+
50
+ ## Client boundaries
51
+
52
+ - Claude Code and Codex support local stdio MCP servers. The protocol test verifies a real SDK client handshake, discovery, valid/invalid inputs, and all six tools. It is not a claim that every client version has been manually tested.
53
+ - ChatGPT web needs a supported remote/private connection path; it cannot directly launch this local stdio process. This package does not ship HTTP transport, authentication, a tunnel, or a published ChatGPT plugin. Follow the [current connection guide](https://developers.openai.com/plugins/deploy/connect-chatgpt) when adding a separate hosted adapter.
54
+ - The portable `skills/tourlight` workflow can be installed in [Claude Code](https://code.claude.com/docs/en/skills), [Codex](https://learn.chatgpt.com/docs/build-skills), or [OpenClaw](https://docs.openclaw.ai/tools/skills) using each host's documented skill directory. A copied skill is not a verified marketplace integration.
55
+
56
+ SDK reference: [MCP TypeScript SDK v2](https://ts.sdk.modelcontextprotocol.io/v2/), protocol 2026-07-28. SDK 2.1.0 is the verified baseline.
57
+
58
+ ## Support Tourlight
59
+
60
+ This server and the Tourlight package are free under MIT. You can
61
+ [give once](https://buy.stripe.com/fZu14m0FO3v050PfqP3ks00) or explore
62
+ [monthly sponsorship](https://react-tourlight.vercel.app/support) to support maintenance,
63
+ documentation, and new features. Sponsorship does not unlock additional tools or dedicated support.
64
+ Stripe checkout uses our existing GPT Hotline account name and logo.
package/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio'
3
+ import { createTourlightServer } from './server.mjs'
4
+
5
+ const server = createTourlightServer()
6
+ await server.connect(new StdioServerTransport())
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "react-tourlight-mcp",
3
+ "version": "0.1.1",
4
+ "description": "Local MCP tools for authoring, validating, and testing portable Tourlight documents",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/btahir/react-tourlight.git",
10
+ "directory": "packages/tourlight-mcp"
11
+ },
12
+ "homepage": "https://react-tourlight.vercel.app/docs/agents",
13
+ "bugs": {
14
+ "url": "https://github.com/btahir/react-tourlight/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "funding": {
20
+ "type": "individual",
21
+ "url": "https://react-tourlight.vercel.app/support"
22
+ },
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "bin": {
27
+ "react-tourlight-mcp": "./index.mjs"
28
+ },
29
+ "files": [
30
+ "index.mjs",
31
+ "server.mjs",
32
+ "README.md",
33
+ "CHANGELOG.md",
34
+ "LICENSE"
35
+ ],
36
+ "dependencies": {
37
+ "@modelcontextprotocol/server": "^2.1.0",
38
+ "zod": "^4.6.5",
39
+ "react-tourlight": "0.5.0"
40
+ },
41
+ "devDependencies": {
42
+ "@modelcontextprotocol/client": "^2.1.0"
43
+ },
44
+ "scripts": {
45
+ "test": "node --test protocol.test.mjs"
46
+ }
47
+ }
package/server.mjs ADDED
@@ -0,0 +1,28 @@
1
+ import { McpServer } from '@modelcontextprotocol/server'
2
+ import * as z from 'zod/v4'
3
+ import { readFileSync } from 'node:fs'
4
+ import { createRequire } from 'node:module'
5
+ import { createTourDocument, formatTourDocument, generateTourTest, inspectTourDocument, parseTourDocument, validateTourDocument } from 'react-tourlight/document'
6
+
7
+ const annotations = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }
8
+ const require = createRequire(import.meta.url)
9
+ const { version } = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
10
+ const documentInput = z.object({ document: z.unknown().describe('A Tourlight schemaVersion 1 JSON object. Content is plain text; callbacks are registered names, never code.') })
11
+ const output = (value) => ({ content: [{ type: 'text', text: JSON.stringify(value, null, 2) }], structuredContent: value })
12
+
13
+ export function createTourlightServer() {
14
+ const server = new McpServer({ name: 'react-tourlight', version }, {
15
+ instructions: 'Author source-owned Tourlight JSON documents. These tools only transform input and return results. They do not read project files, inspect a browser, execute handlers, save changes, or publish. Obtain actual selectors from the user application. Validate documents and verify the live journey before describing a tour as working.',
16
+ })
17
+ const register = (name, description, inputSchema, run) => server.registerTool(name, { description, inputSchema, annotations }, async (args) => {
18
+ try { return output(await run(args)) }
19
+ catch (error) { return { ...output({ error: error.message, ...(error.issues ? { issues: error.issues } : {}) }), isError: true } }
20
+ })
21
+ register('tourlight_schema', 'Get the full JSON Schema for portable Tourlight documents. Unique step ids are additionally checked by tourlight_validate.', z.object({}), () => JSON.parse(readFileSync(require.resolve('react-tourlight/schema.json'), 'utf8')))
22
+ register('tourlight_template', 'Create a valid starter document to customize with real application targets and meaningful onboarding copy.', z.object({ id: z.string().optional(), name: z.string().optional() }), (args) => ({ document: createTourDocument(args) }))
23
+ register('tourlight_validate', 'Validate a tour document, returning exact field paths and actionable errors. Does not resolve selectors in a browser.', documentInput, ({ document }) => validateTourDocument(document))
24
+ register('tourlight_inspect', 'Summarize routes, selectors, action names, and conditions that an application must provide. Static analysis only.', documentInput, ({ document }) => inspectTourDocument(parseTourDocument(document)))
25
+ register('tourlight_format', 'Return canonical JSON for review or saving by the caller. Does not write a file.', documentInput, ({ document }) => ({ json: formatTourDocument(parseTourDocument(document)) }))
26
+ register('tourlight_generate_tests', 'Generate Playwright target smoke checks. Setup-dependent steps are explicitly skipped. Add app authentication, setup, tour navigation, and task outcome assertions; these checks alone do not prove the user journey.', z.object({ document: z.unknown(), baseUrl: z.string() }), ({ document, baseUrl }) => ({ filename: 'tourlight.targets.spec.ts', source: generateTourTest(parseTourDocument(document), baseUrl) }))
27
+ return server
28
+ }