diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..feb2b140 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Red Hat, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 12c605c8..aca7f47b 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,14 @@ npm run start:dev ### Use via npx (after publishing) ```bash -npx @jephilli-patternfly-docs/mcp +npx @patternfly/patternfly-mcp ``` Or install locally in a project and run: ```bash -npm install @jephilli-patternfly-docs/mcp -npx @jephilli-patternfly-docs/mcp +npm install @patternfly/patternfly-mcp +npx @patternfly/patternfly-mcp ``` ## Scripts @@ -111,7 +111,7 @@ If you run the server with --docs-host, local paths you pass in urlList are reso Example: ```bash -npx @jephilli-patternfly-docs/mcp --docs-host +npx @patternfly/patternfly-mcp --docs-host ``` Then, passing a local path such as react-core/6.0.0/llms.txt in urlList will load from llms-files/react-core/6.0.0/llms.txt. @@ -127,7 +127,7 @@ Most MCP clients use a JSON configuration that tells the client how to start thi "mcpServers": { "patternfly-docs": { "command": "npx", - "args": ["-y", "@jephilli-patternfly-docs/mcp@latest"], + "args": ["-y", "@patternfly/patternfly-mcp@latest"], "description": "PatternFly React development rules and documentation" } } @@ -141,7 +141,7 @@ Most MCP clients use a JSON configuration that tells the client how to start thi "mcpServers": { "patternfly-docs": { "command": "npx", - "args": ["-y", "@jephilli-patternfly-docs/mcp@latest", "--docs-host"], + "args": ["-y", "@patternfly/patternfly-mcp@latest", "--docs-host"], "description": "PatternFly docs (docs-host mode)" } } @@ -207,10 +207,10 @@ Example (ESM): ```js // Prefer the public export subpath -import { runServer } from '@jephilli-patternfly-docs/mcp/server'; +import { runServer } from '@patternfly/patternfly-mcp/server'; // Or from the package root (index.ts re-exports it) -import { runServer } from '@jephilli-patternfly-docs/mcp'; +import { runServer } from '@patternfly/patternfly-mcp'; // Starts the MCP server and listens on stdio await runServer(); @@ -247,7 +247,7 @@ npm publish After publishing, users can run your MCP server with: ```bash -npx @jephilli-patternfly-docs/mcp +npx @patternfly/patternfly-mcp ``` ## Contributing diff --git a/package-lock.json b/package-lock.json index e00f0786..681896d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "@jephilli-patternfly-docs/mcp", - "version": "1.1.0", + "name": "@patternfly/patternfly-mcp", + "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@jephilli-patternfly-docs/mcp", - "version": "1.1.0", + "name": "@patternfly/patternfly-mcp", + "version": "0.0.0", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.19.1", diff --git a/package.json b/package.json index 9ca78bad..3e24aeba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@jephilli-patternfly-docs/mcp", - "version": "1.1.0", + "name": "@patternfly/patternfly-mcp", + "version": "0.0.0", "description": "PatternFly documentation MCP server built with Node.js and TypeScript", "main": "dist/index.js", "type": "module", @@ -44,7 +44,7 @@ "documentation", "react" ], - "author": "Jeff Phillips", + "author": "Red Hat", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.19.1", @@ -70,11 +70,11 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/jeff-phillips-18/patternfly-mcp.git" + "url": "git+https://github.com/patternfly/patternfly-mcp.git" }, "types": "./dist/index.d.ts", "bugs": { - "url": "https://github.com/jeff-phillips-18/patternfly-mcp/issues" + "url": "https://github.com/patternfly/patternfly-mcp/issues" }, - "homepage": "https://github.com/jeff-phillips-18/patternfly-mcp#readme" + "homepage": "https://github.com/patternfly/patternfly-mcp#readme" } diff --git a/src/__tests__/__snapshots__/options.test.ts.snap b/src/__tests__/__snapshots__/options.test.ts.snap index a99570ef..a2f7afd1 100644 --- a/src/__tests__/__snapshots__/options.test.ts.snap +++ b/src/__tests__/__snapshots__/options.test.ts.snap @@ -6,7 +6,7 @@ exports[`freezeOptions should return frozen options with consistent properties: "docsHost": true, "docsPath": "/documentation", "llmsFilesPath": "/llms-files", - "name": "@jephilli-patternfly-docs/mcp", + "name": "@patternfly/patternfly-mcp", "pfExternal": "https://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content", "pfExternalAccessibility": "https://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content/accessibility", "pfExternalCharts": "https://raw.githubusercontent.com/patternfly/patternfly-react/refs/heads/main/packages/react-charts/src", @@ -46,7 +46,7 @@ exports[`freezeOptions should return frozen options with consistent properties: }, }, "urlRegex": /\\^\\(https\\?:\\)\\\\/\\\\//i, - "version": "1.1.0", + "version": "0.0.0", } `; @@ -61,7 +61,7 @@ exports[`options should return specific properties 1`] = ` "contextPath": "/", "docsPath": "/documentation", "llmsFilesPath": "/llms-files", - "name": "@jephilli-patternfly-docs/mcp", + "name": "@patternfly/patternfly-mcp", "pfExternal": "https://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content", "pfExternalAccessibility": "https://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content/accessibility", "pfExternalCharts": "https://raw.githubusercontent.com/patternfly/patternfly-react/refs/heads/main/packages/react-charts/src", @@ -101,7 +101,7 @@ exports[`options should return specific properties 1`] = ` }, }, "urlRegex": /\\^\\(https\\?:\\)\\\\/\\\\//i, - "version": "1.1.0", + "version": "0.0.0", }, "PF_EXTERNAL": "https://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content", "PF_EXTERNAL_ACCESSIBILITY": "https://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content/accessibility", diff --git a/src/__tests__/__snapshots__/server.test.ts.snap b/src/__tests__/__snapshots__/server.test.ts.snap index 9f0ffb20..49353dc9 100644 --- a/src/__tests__/__snapshots__/server.test.ts.snap +++ b/src/__tests__/__snapshots__/server.test.ts.snap @@ -11,8 +11,8 @@ exports[`runServer should attempt to run server, create transport, connect, and "mcpServer": [ [ { - "name": "@jephilli-patternfly-docs/mcp", - "version": "1.1.0", + "name": "@patternfly/patternfly-mcp", + "version": "0.0.0", }, { "capabilities": { @@ -40,8 +40,8 @@ exports[`runServer should attempt to run server, register a tool: console 1`] = "mcpServer": [ [ { - "name": "@jephilli-patternfly-docs/mcp", - "version": "1.1.0", + "name": "@patternfly/patternfly-mcp", + "version": "0.0.0", }, { "capabilities": { @@ -81,8 +81,8 @@ exports[`runServer should attempt to run server, register multiple tools: consol "mcpServer": [ [ { - "name": "@jephilli-patternfly-docs/mcp", - "version": "1.1.0", + "name": "@patternfly/patternfly-mcp", + "version": "0.0.0", }, { "capabilities": { @@ -155,8 +155,8 @@ exports[`runServer should attempt to run server, use default tools: console 1`] "mcpServer": [ [ { - "name": "@jephilli-patternfly-docs/mcp", - "version": "1.1.0", + "name": "@patternfly/patternfly-mcp", + "version": "0.0.0", }, { "capabilities": { diff --git a/src/options.ts b/src/options.ts index 018ec117..3d718f43 100644 --- a/src/options.ts +++ b/src/options.ts @@ -160,7 +160,7 @@ const OPTIONS: GlobalOptions = { separator: DEFAULT_SEPARATOR, urlRegex: URL_REGEX, name: packageJson.name, - version: packageJson.version, + version: (process.env.NODE_ENV === 'local' && '0.0.0') || packageJson.version, repoName: process.cwd()?.split?.('/')?.pop?.()?.trim?.(), contextPath: (process.env.NODE_ENV === 'local' && '/') || process.cwd(), docsPath: (process.env.NODE_ENV === 'local' && '/documentation') || join(process.cwd(), 'documentation'),