@splunk/splunk-ui-mcp 0.1.0 → 0.3.0

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.
Files changed (60) hide show
  1. package/README.md +19 -5
  2. package/lib/constants/versions.js +3 -3
  3. package/lib/index.js +16 -4
  4. package/lib/prompts/audit/audit-prompt.d.ts +2 -0
  5. package/lib/prompts/audit/audit-prompt.js +11 -0
  6. package/lib/prompts/audit/audit.d.ts +16 -0
  7. package/lib/prompts/audit/audit.js +36 -0
  8. package/lib/prompts/audit/index.d.ts +1 -0
  9. package/lib/prompts/audit/index.js +1 -0
  10. package/lib/prompts/build-ui/build-figma-design-prompt.d.ts +2 -0
  11. package/lib/prompts/build-ui/build-figma-design-prompt.js +9 -0
  12. package/lib/prompts/build-ui/build-ui-prompt.d.ts +2 -0
  13. package/lib/prompts/build-ui/build-ui-prompt.js +8 -0
  14. package/lib/prompts/build-ui/build-ui.d.ts +16 -0
  15. package/lib/prompts/build-ui/build-ui.js +62 -0
  16. package/lib/prompts/build-ui/index.d.ts +1 -0
  17. package/lib/prompts/build-ui/index.js +1 -0
  18. package/lib/prompts/create-scaffold/create-scaffold-prompt.d.ts +2 -0
  19. package/lib/prompts/create-scaffold/create-scaffold-prompt.js +34 -0
  20. package/lib/prompts/create-scaffold/create-scaffold.d.ts +16 -0
  21. package/lib/prompts/create-scaffold/create-scaffold.js +60 -0
  22. package/lib/prompts/create-scaffold/index.d.ts +1 -0
  23. package/lib/prompts/create-scaffold/index.js +1 -0
  24. package/lib/prompts/session-feedback/index.d.ts +1 -0
  25. package/lib/prompts/session-feedback/index.js +1 -0
  26. package/lib/prompts/session-feedback/session-feedback-prompt.d.ts +2 -0
  27. package/lib/prompts/session-feedback/session-feedback-prompt.js +113 -0
  28. package/lib/prompts/session-feedback/session-feedback.d.ts +11 -0
  29. package/lib/prompts/session-feedback/session-feedback.js +22 -0
  30. package/lib/prompts/types.d.ts +8 -0
  31. package/lib/resources/components.js +12 -6
  32. package/lib/resources/design-tokens.d.ts +17 -0
  33. package/lib/resources/design-tokens.js +115 -0
  34. package/lib/tools/find_component.d.ts +19 -0
  35. package/lib/tools/find_component.js +93 -0
  36. package/lib/tools/find_design_token.d.ts +16 -0
  37. package/lib/tools/find_design_token.js +134 -0
  38. package/lib/tools/{find_icons.d.ts → find_icon.d.ts} +2 -2
  39. package/lib/tools/{find_icons.js → find_icon.js} +5 -5
  40. package/lib/utils/component-catalog.d.ts +19 -2
  41. package/lib/utils/component-catalog.js +77 -29
  42. package/lib/utils/design-token-catalog.d.ts +37 -0
  43. package/lib/utils/design-token-catalog.js +166 -0
  44. package/lib/utils/package-assets.d.ts +8 -0
  45. package/lib/utils/package-assets.js +35 -0
  46. package/package.json +16 -10
  47. package/lib/resources/tests/components.unit.js +0 -133
  48. package/lib/resources/tests/icons.unit.d.ts +0 -1
  49. package/lib/resources/tests/icons.unit.js +0 -161
  50. package/lib/tools/get_component_docs.d.ts +0 -19
  51. package/lib/tools/get_component_docs.js +0 -82
  52. package/lib/tools/tests/find_icons.unit.d.ts +0 -1
  53. package/lib/tools/tests/find_icons.unit.js +0 -149
  54. package/lib/tools/tests/get_component_docs.unit.d.ts +0 -1
  55. package/lib/tools/tests/get_component_docs.unit.js +0 -131
  56. package/lib/tools/tests/requirements.unit.d.ts +0 -1
  57. package/lib/tools/tests/requirements.unit.js +0 -34
  58. package/lib/utils/tests/component-catalog.unit.d.ts +0 -1
  59. package/lib/utils/tests/component-catalog.unit.js +0 -144
  60. /package/lib/{resources/tests/components.unit.d.ts → prompts/types.js} +0 -0
package/README.md CHANGED
@@ -10,7 +10,7 @@ A Model Context Protocol (MCP) server that gives AI assistants Splunk UI Design
10
10
 
11
11
  - Node.js 22 or newer
12
12
  - An MCP-compatible client (VS Code, Cursor, Windsurf, Claude Desktop, Goose, etc.)
13
- - Access to @splunk/react-ui and @splunk/react-icons (used for component docs and icon metadata)
13
+ - Access to @splunk/react-ui, @splunk/react-icons, and @splunk/themes
14
14
 
15
15
  ## Install and configure
16
16
 
@@ -29,14 +29,15 @@ Use `npx` in your MCP client configuration (works in most tools):
29
29
 
30
30
  To pin a version, replace `@latest` with the desired version.
31
31
 
32
- ## Reference (tools and resources)
32
+ ## Reference
33
33
 
34
- If you need the underlying tool or resource names (for debugging or client integrations), use the list below.
34
+ If you need the underlying tool, resource, or prompt names (for debugging or client integrations), use the list below.
35
35
 
36
36
  ### Tools
37
37
 
38
- - `get_component_docs`: Retrieve full docs for a `@splunk/react-ui` component.
39
- - `find_icons`: Search `@splunk/react-icons` and return a recommended icon plus alternatives.
38
+ - `find_component`: Find `@splunk/react-ui` components by exact name or fuzzy query; returns full docs for exact matches and suggestions otherwise.
39
+ - `find_icon`: Search `@splunk/react-icons` and return a recommended icon plus alternatives.
40
+ - `find_design_token`: Search `@splunk/themes` design tokens and return recommended matches.
40
41
  - `list_splunk_ui_requirements`: Return version requirements and peer dependencies.
41
42
 
42
43
  ### Resources
@@ -52,3 +53,16 @@ mcp://splunk-ui/components/{componentName}
52
53
  ```
53
54
  mcp://splunk-ui/icons/{iconName}
54
55
  ```
56
+
57
+ **Design tokens**
58
+
59
+ ```
60
+ mcp://splunk-ui/design-tokens/{tokenName}
61
+ ```
62
+
63
+ ### Prompts
64
+
65
+ - `audit_code`: Audit code against Splunk UI Design System guidelines.
66
+ - `build_ui`: Implement a Figma design or text description using Splunk UI components.
67
+ - `create_scaffold`: Scaffold new Splunk UI standalone apps.
68
+ - `session_feedback`: Generate quality feedback report on MCP tools, prompts, and resources.
@@ -2,11 +2,11 @@
2
2
  // This file contains version information that gets injected at build time
3
3
  // DO NOT EDIT MANUALLY - this file is auto-generated during build
4
4
  const VERSIONS = {
5
- "@splunk/react-ui": "5.8.0",
5
+ "@splunk/react-ui": "5.9.0",
6
6
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
7
7
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
8
8
  "styled-components": "^5.3.10",
9
- "@splunk/themes": "1.5.0",
10
- "@splunk/react-icons": "5.8.0"
9
+ "@splunk/themes": "1.6.0",
10
+ "@splunk/react-icons": "5.9.0"
11
11
  };
12
12
  export default VERSIONS;
package/lib/index.js CHANGED
@@ -2,10 +2,16 @@
2
2
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import requirements from "./tools/requirements.js";
5
- import findIcons from "./tools/find_icons.js";
6
- import getComponentDocs from "./tools/get_component_docs.js";
5
+ import findIcon from "./tools/find_icon.js";
6
+ import findComponent from "./tools/find_component.js";
7
+ import findDesignToken from "./tools/find_design_token.js";
7
8
  import iconResource from "./resources/icons.js";
8
9
  import componentResource from "./resources/components.js";
10
+ import designTokenResource from "./resources/design-tokens.js";
11
+ import auditPrompt from "./prompts/audit/index.js";
12
+ import buildUiPrompt from "./prompts/build-ui/index.js";
13
+ import createScaffoldPrompt from "./prompts/create-scaffold/index.js";
14
+ import sessionFeedbackPrompt from "./prompts/session-feedback/index.js";
9
15
  // prettier-ignore
10
16
  import packageJson from '../package.json' with { type: 'json' };
11
17
  // Create an MCP server
@@ -19,14 +25,20 @@ const server = new McpServer({
19
25
  },
20
26
  });
21
27
  // Register all tools
22
- const tools = [requirements, findIcons, getComponentDocs];
28
+ const tools = [requirements, findIcon, findComponent, findDesignToken];
23
29
  tools.forEach((tool) => {
24
30
  server.registerTool(tool.name, tool.config, tool.handler);
25
31
  });
26
- const resources = [iconResource, componentResource];
32
+ // Register all resources
33
+ const resources = [iconResource, componentResource, designTokenResource];
27
34
  resources.forEach((resource) => {
28
35
  server.registerResource(resource.name, resource.template, resource.config, resource.handler);
29
36
  });
37
+ // Register all prompts
38
+ const prompts = [auditPrompt, buildUiPrompt, createScaffoldPrompt, sessionFeedbackPrompt];
39
+ prompts.forEach((prompt) => {
40
+ server.registerPrompt(prompt.name, prompt.config, prompt.handler);
41
+ });
30
42
  async function main() {
31
43
  try {
32
44
  const transport = new StdioServerTransport();
@@ -0,0 +1,2 @@
1
+ declare const AUDIT_PROMPT = "Audit the code in **{{target}}** against Splunk Design System guidelines. **DO NOT modify any code.** Only report findings.\n\n1. Look up docs for each Splunk UI component used\n2. Verify the component choice matches the decision tree (e.g., Button vs Link for navigation)\n3. Verify props match the documented API\n4. Note any accessibility gaps from the component's a11y section\n5. Note any hardcoded values that could use `@splunk/themes` variables\n6. Note any Splunk UI component props that could replace custom CSS\n\nReport findings as a table with columns: File:Line, Finding, Severity, Suggested Change";
2
+ export default AUDIT_PROMPT;
@@ -0,0 +1,11 @@
1
+ const AUDIT_PROMPT = `Audit the code in **{{target}}** against Splunk Design System guidelines. **DO NOT modify any code.** Only report findings.
2
+
3
+ 1. Look up docs for each Splunk UI component used
4
+ 2. Verify the component choice matches the decision tree (e.g., Button vs Link for navigation)
5
+ 3. Verify props match the documented API
6
+ 4. Note any accessibility gaps from the component's a11y section
7
+ 5. Note any hardcoded values that could use \`@splunk/themes\` variables
8
+ 6. Note any Splunk UI component props that could replace custom CSS
9
+
10
+ Report findings as a table with columns: File:Line, Finding, Severity, Suggested Change`;
11
+ export default AUDIT_PROMPT;
@@ -0,0 +1,16 @@
1
+ import { GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import { z } from 'zod';
3
+ declare const auditPrompt: {
4
+ name: string;
5
+ config: {
6
+ title: string;
7
+ description: string;
8
+ argsSchema: {
9
+ target: z.ZodOptional<z.ZodString>;
10
+ };
11
+ };
12
+ handler: ({ target }: {
13
+ target?: string;
14
+ }) => GetPromptResult;
15
+ };
16
+ export default auditPrompt;
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import AUDIT_PROMPT from "./audit-prompt.js";
3
+ const auditPrompt = {
4
+ name: 'audit_code',
5
+ config: {
6
+ title: 'Audit Code Against Splunk UI Guidelines',
7
+ description: 'Returns a structured audit workflow for checking code against ' +
8
+ 'Splunk UI design system guidelines. Read-only — does not modify code.',
9
+ argsSchema: {
10
+ target: z
11
+ .string()
12
+ .optional()
13
+ .describe('File path or directory to audit (e.g., "src/App.tsx", "src/components"). ' +
14
+ 'Defaults to the current working directory if not provided.'),
15
+ },
16
+ },
17
+ handler: ({ target }) => {
18
+ const trimmed = target?.trim();
19
+ const resolvedTarget = trimmed && trimmed.length > 0 ? trimmed : process.cwd();
20
+ const isDefault = !trimmed;
21
+ const prompt = AUDIT_PROMPT.replaceAll('{{target}}', resolvedTarget);
22
+ const confirmation = isDefault
23
+ ? `The target directory defaulted to ${resolvedTarget}. Confirm this is correct before proceeding.\n\n`
24
+ : '';
25
+ return {
26
+ description: `Splunk UI audit workflow for ${resolvedTarget}`,
27
+ messages: [
28
+ {
29
+ role: 'user',
30
+ content: { type: 'text', text: `${confirmation}${prompt}` },
31
+ },
32
+ ],
33
+ };
34
+ },
35
+ };
36
+ export default auditPrompt;
@@ -0,0 +1 @@
1
+ export { default } from './audit.ts';
@@ -0,0 +1 @@
1
+ export { default } from "./audit.js";
@@ -0,0 +1,2 @@
1
+ declare const BUILD_FIGMA_DESIGN_PROMPT = "You are a senior frontend engineer, implement the design at {{figmaLink}} as a React component using the Splunk Design System.\n\n1. Read the design context from the Figma link\n2. Verify Splunk UI package versions are correct\n3. Look up component docs for each component BEFORE writing code\n4. Use Splunk UI components with their documented props and patterns\n5. Use styled-components with `@splunk/themes` variables and mixins for any styling that falls outside component props\n6. Flag any design values (colors, sizes, spacing) that don't map to a Splunk UI component prop or theme variable";
2
+ export default BUILD_FIGMA_DESIGN_PROMPT;
@@ -0,0 +1,9 @@
1
+ const BUILD_FIGMA_DESIGN_PROMPT = `You are a senior frontend engineer, implement the design at {{figmaLink}} as a React component using the Splunk Design System.
2
+
3
+ 1. Read the design context from the Figma link
4
+ 2. Verify Splunk UI package versions are correct
5
+ 3. Look up component docs for each component BEFORE writing code
6
+ 4. Use Splunk UI components with their documented props and patterns
7
+ 5. Use styled-components with \`@splunk/themes\` variables and mixins for any styling that falls outside component props
8
+ 6. Flag any design values (colors, sizes, spacing) that don't map to a Splunk UI component prop or theme variable`;
9
+ export default BUILD_FIGMA_DESIGN_PROMPT;
@@ -0,0 +1,2 @@
1
+ declare const BUILD_UI_PROMPT = "You are a senior frontend engineer, build **{{description}}** as a React component using the Splunk Design System.\n\n1. Verify Splunk UI package versions are correct\n2. Look up component docs BEFORE using any Splunk UI component\n3. Follow component decision trees to choose the right component (e.g., Button vs Link for navigation)\n4. Use `@splunk/themes` variables and mixins for custom styling\n5. Flag any requirements that don't map to existing components or theme values";
2
+ export default BUILD_UI_PROMPT;
@@ -0,0 +1,8 @@
1
+ const BUILD_UI_PROMPT = `You are a senior frontend engineer, build **{{description}}** as a React component using the Splunk Design System.
2
+
3
+ 1. Verify Splunk UI package versions are correct
4
+ 2. Look up component docs BEFORE using any Splunk UI component
5
+ 3. Follow component decision trees to choose the right component (e.g., Button vs Link for navigation)
6
+ 4. Use \`@splunk/themes\` variables and mixins for custom styling
7
+ 5. Flag any requirements that don't map to existing components or theme values`;
8
+ export default BUILD_UI_PROMPT;
@@ -0,0 +1,16 @@
1
+ import { GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import { z } from 'zod';
3
+ declare const buildUiPrompt: {
4
+ name: string;
5
+ config: {
6
+ title: string;
7
+ description: string;
8
+ argsSchema: {
9
+ input: z.ZodOptional<z.ZodString>;
10
+ };
11
+ };
12
+ handler: ({ input }: {
13
+ input?: string;
14
+ }) => GetPromptResult;
15
+ };
16
+ export default buildUiPrompt;
@@ -0,0 +1,62 @@
1
+ import { z } from 'zod';
2
+ import BUILD_UI_PROMPT from "./build-ui-prompt.js";
3
+ import BUILD_FIGMA_DESIGN_PROMPT from "./build-figma-design-prompt.js";
4
+ const buildUiPrompt = {
5
+ name: 'build_ui',
6
+ config: {
7
+ title: 'Build UI',
8
+ description: 'Returns a structured workflow for implementing a UI from a text description or Figma design ' +
9
+ 'using the Splunk UI Design System.',
10
+ argsSchema: {
11
+ input: z
12
+ .string()
13
+ .optional()
14
+ .describe('Text description of the feature/UI to build (e.g., "a settings page with a form") ' +
15
+ 'OR a Figma link (e.g., "https://figma.com/design/...").'),
16
+ },
17
+ },
18
+ handler: ({ input }) => {
19
+ const trimmed = input?.trim();
20
+ if (!trimmed) {
21
+ return {
22
+ description: 'Splunk UI build workflow — awaiting input',
23
+ messages: [
24
+ {
25
+ role: 'user',
26
+ content: {
27
+ type: 'text',
28
+ text: 'Please provide either:\n- A text description of the UI to build (e.g., "a settings page with a form and save button")\n- OR a Figma link (e.g., https://figma.com/design/...)',
29
+ },
30
+ },
31
+ ],
32
+ };
33
+ }
34
+ // Auto-detect Figma links (must be actual Figma domain with file ID)
35
+ // Valid format: https://figma.com/{type}/{fileId}/...
36
+ // File ID must be non-empty alphanumeric string
37
+ const isFigmaLink = /^https?:\/\/(www\.)?figma\.com\/(design|file|board|make)\/[A-Za-z0-9]+/.test(trimmed);
38
+ if (isFigmaLink) {
39
+ const prompt = BUILD_FIGMA_DESIGN_PROMPT.replaceAll('{{figmaLink}}', trimmed);
40
+ return {
41
+ description: `Splunk UI build workflow — Figma design: ${trimmed}`,
42
+ messages: [
43
+ {
44
+ role: 'user',
45
+ content: { type: 'text', text: prompt },
46
+ },
47
+ ],
48
+ };
49
+ }
50
+ const prompt = BUILD_UI_PROMPT.replaceAll('{{description}}', trimmed);
51
+ return {
52
+ description: 'Splunk UI build workflow — text description',
53
+ messages: [
54
+ {
55
+ role: 'user',
56
+ content: { type: 'text', text: prompt },
57
+ },
58
+ ],
59
+ };
60
+ },
61
+ };
62
+ export default buildUiPrompt;
@@ -0,0 +1 @@
1
+ export { default } from './build-ui.ts';
@@ -0,0 +1 @@
1
+ export { default } from "./build-ui.js";
@@ -0,0 +1,2 @@
1
+ declare const STANDALONE_PROMPT = "Scaffold a new Splunk UI standalone app named \"{{appName}}\".\n\nBEFORE running any commands, check if the current directory is empty:\n- If the directory is NOT empty, STOP and tell the user: \"The current directory must be empty. Please run this in an empty directory or create a new one.\"\n- If the directory IS empty, proceed with the commands below.\n\nRun these commands ONE AT A TIME in the foreground. Wait for FULL completion before the next:\n\n```sh\nnpx --yes @splunk/create@latest --mode=standalone {{appName}}\nyarn install\n```\n\nCRITICAL RULES:\n- Check directory is empty FIRST before running any commands\n- Use the Bash tool for EACH command separately\n- Set timeout to 300000ms (5 minutes) for npx and yarn install commands\n- NEVER use run_in_background parameter\n- NEVER add & to background commands\n- Wait for exit code 0 before proceeding to next command\n- Do NOT add any additional flags beyond what's shown\n- Do NOT pipe input with printf or echo\n\nAfter ALL commands complete successfully, output ONLY this message:\n\n---\nYour app {{appName}} is ready!\n\nNext steps:\n1. Open a new terminal tab\n2. Run: `yarn dev`\n3. A browser window will open with the app\n---";
2
+ export default STANDALONE_PROMPT;
@@ -0,0 +1,34 @@
1
+ const STANDALONE_PROMPT = `Scaffold a new Splunk UI standalone app named "{{appName}}".
2
+
3
+ BEFORE running any commands, check if the current directory is empty:
4
+ - If the directory is NOT empty, STOP and tell the user: "The current directory must be empty. Please run this in an empty directory or create a new one."
5
+ - If the directory IS empty, proceed with the commands below.
6
+
7
+ Run these commands ONE AT A TIME in the foreground. Wait for FULL completion before the next:
8
+
9
+ \`\`\`sh
10
+ npx --yes @splunk/create@latest --mode=standalone {{appName}}
11
+ yarn install
12
+ \`\`\`
13
+
14
+ CRITICAL RULES:
15
+ - Check directory is empty FIRST before running any commands
16
+ - Use the Bash tool for EACH command separately
17
+ - Set timeout to 300000ms (5 minutes) for npx and yarn install commands
18
+ - NEVER use run_in_background parameter
19
+ - NEVER add & to background commands
20
+ - Wait for exit code 0 before proceeding to next command
21
+ - Do NOT add any additional flags beyond what's shown
22
+ - Do NOT pipe input with printf or echo
23
+
24
+ After ALL commands complete successfully, output ONLY this message:
25
+
26
+ ---
27
+ Your app {{appName}} is ready!
28
+
29
+ Next steps:
30
+ 1. Open a new terminal tab
31
+ 2. Run: \`yarn dev\`
32
+ 3. A browser window will open with the app
33
+ ---`;
34
+ export default STANDALONE_PROMPT;
@@ -0,0 +1,16 @@
1
+ import { GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import { z } from 'zod';
3
+ declare const createScaffoldPrompt: {
4
+ name: string;
5
+ config: {
6
+ title: string;
7
+ description: string;
8
+ argsSchema: {
9
+ appName: z.ZodString;
10
+ };
11
+ };
12
+ handler: ({ appName }: {
13
+ appName?: string;
14
+ }) => GetPromptResult;
15
+ };
16
+ export default createScaffoldPrompt;
@@ -0,0 +1,60 @@
1
+ import { z } from 'zod';
2
+ import STANDALONE_PROMPT from "./create-scaffold-prompt.js";
3
+ const createScaffoldPrompt = {
4
+ name: 'create_scaffold',
5
+ config: {
6
+ title: 'Create Splunk UI App',
7
+ description: 'Returns a step-by-step workflow for scaffolding a new Splunk UI app (standalone Vite-based app).',
8
+ argsSchema: {
9
+ appName: z
10
+ .string()
11
+ .describe('Name for the new app (e.g., "MyApp"). Letters only - no numbers, no spaces, no special characters.'),
12
+ },
13
+ },
14
+ handler: ({ appName }) => {
15
+ const trimmed = appName?.trim();
16
+ if (!trimmed) {
17
+ return {
18
+ description: 'Splunk UI scaffold workflow — missing app name',
19
+ messages: [
20
+ {
21
+ role: 'user',
22
+ content: {
23
+ type: 'text',
24
+ text: 'ERROR: appName parameter is required but was empty. This prompt cannot be invoked without a valid app name.',
25
+ },
26
+ },
27
+ ],
28
+ };
29
+ }
30
+ // Enforce letters only - no numbers, spaces, or special characters.
31
+ // appName is interpolated directly into shell commands in the scaffold template,
32
+ // so invalid characters must be rejected here.
33
+ if (!/^[a-zA-Z]+$/.test(trimmed)) {
34
+ const validationError = 'Use only letters - no numbers, no spaces, no special characters.';
35
+ return {
36
+ description: 'Splunk UI scaffold workflow — invalid app name',
37
+ messages: [
38
+ {
39
+ role: 'user',
40
+ content: {
41
+ type: 'text',
42
+ text: `"${trimmed}" is not a valid app name. ${validationError} (e.g., "MyApp")`,
43
+ },
44
+ },
45
+ ],
46
+ };
47
+ }
48
+ const prompt = STANDALONE_PROMPT.replaceAll('{{appName}}', trimmed);
49
+ return {
50
+ description: `Splunk UI scaffold workflow — standalone app "${trimmed}"`,
51
+ messages: [
52
+ {
53
+ role: 'user',
54
+ content: { type: 'text', text: prompt },
55
+ },
56
+ ],
57
+ };
58
+ },
59
+ };
60
+ export default createScaffoldPrompt;
@@ -0,0 +1 @@
1
+ export { default } from './create-scaffold.ts';
@@ -0,0 +1 @@
1
+ export { default } from "./create-scaffold.js";
@@ -0,0 +1 @@
1
+ export { default } from './session-feedback.ts';
@@ -0,0 +1 @@
1
+ export { default } from "./session-feedback.js";
@@ -0,0 +1,2 @@
1
+ declare const SESSION_FEEDBACK_PROMPT = "# Splunk UI MCP Feedback Report\n\nYou are providing feedback to the Splunk UI MCP team about the tools, prompts, and resources used in this session.\n\n## Your Task\n\nReview this session and report on the **quality and effectiveness of MCP tools, prompts, and resources**. Focus on what worked well and what needs improvement from the MCP team's perspective.\n\n**Important:** Only report on what was actually used. If everything worked well, say so - don't invent issues.\n\n## Report Structure\n\n### 1. Session Overview\n\n**User's Goal:**\n[Brief description of what they wanted to accomplish]\n\n**What Was Used:**\nReview your conversation history and list ONLY the MCP tools, prompts, and resources you actually used:\n\n- **Tools:** [List with call counts - e.g., \"find_component (3 calls: Button, Card, Modal)\"]\n- **Prompts:** [List which ones - e.g., \"audit_code, build_ui, create_scaffold\"]\n- **Resources:** [List what docs you accessed - e.g., \"Button component docs, spacing tokens\"]\n\n### 2. Issues Encountered\n\nFor each issue you encountered, report:\n\n**Issue: [Brief title]**\n- **Category:** [Tool / Prompt / Resource]\n- **Specific item:** [Which tool/prompt/component/token]\n- **What happened:** [Detailed description with evidence]\n- **Expected behavior:** [What should have happened]\n- **Impact:** [Blocked / Slowed / Minor inconvenience]\n- **Suggested fix:** [What the MCP team should change]\n\n**\uD83D\uDD04 Inefficiency Patterns:**\nIf you called the same tool multiple times or had to retry operations, explain:\n- Which tool/resource and how many times\n- Why multiple attempts were needed\n- What could prevent this pattern\n\n**If no issues:** State \"No significant issues encountered in this session.\"\n\n### 3. What Worked Well\n\nHighlight MCP features that were particularly helpful:\n- Tools that provided complete, accurate information on first try\n- Prompts with clear, effective guidance\n- Documentation that was comprehensive and easy to use\n- Features that saved time or effort\n\nBe specific with examples.\n\n### 4. Top Recommendations (Prioritized)\n\nList your top 2-5 recommendations in priority order:\n\n**1. [Recommendation title]**\n- **Priority:** [Critical / Important / Enhancement]\n - Critical = Blocked progress or caused significant delays\n - Important = Slowed progress or required workarounds\n - Enhancement = Would improve experience but not blocking\n- **Issue:** [What needs to be fixed/added]\n- **Benefit:** [How this would help users]\n\n**2. [Next recommendation]**\n[Same structure]\n\n### 5. Missing Capabilities\n\nIf there were tools, prompts, or resources that would have helped but don't exist:\n- **What's missing:** [Description]\n- **Use case:** [When/why it's needed]\n- **Current workaround:** [What you do instead, if anything]\n\n---\n\n## Guidelines\n\n**Before writing the report:**\n1. Scroll back through this entire conversation\n2. Count each tool call (find_component, find_icon, find_design_token, list_splunk_ui_requirements)\n3. Note specific components/tokens/icons you looked up\n4. Identify which prompts were invoked\n5. List which documentation you actually read\n\n**Focus on MCP quality, not AI behavior:**\n- \u2705 \"find_component returned incomplete prop documentation for Button\"\n- \u274C \"I should have read the Button docs more carefully\"\n\n**Be specific and actionable:**\n- \u2705 \"Button component docs missing 'size' prop - shows 'variant' but not size options\"\n- \u274C \"Documentation could be better\"\n\n**Include evidence:**\n- Reference specific tool calls that had issues\n- Quote confusing or incorrect information\n- Note which documentation sections were incomplete\n\n**Be honest:**\n- If everything worked great, say so\n- Don't invent problems to fill the template\n- It's OK to have a short report for a smooth session\n\n**The goal:** Help the MCP team improve their tools, prompts, and resources. Usage data provides context, but quality feedback is the primary objective.\n\n---\n\n## Begin Your Feedback Report\n\nReview this session and generate the report following the structure above.";
2
+ export default SESSION_FEEDBACK_PROMPT;
@@ -0,0 +1,113 @@
1
+ const SESSION_FEEDBACK_PROMPT = `# Splunk UI MCP Feedback Report
2
+
3
+ You are providing feedback to the Splunk UI MCP team about the tools, prompts, and resources used in this session.
4
+
5
+ ## Your Task
6
+
7
+ Review this session and report on the **quality and effectiveness of MCP tools, prompts, and resources**. Focus on what worked well and what needs improvement from the MCP team's perspective.
8
+
9
+ **Important:** Only report on what was actually used. If everything worked well, say so - don't invent issues.
10
+
11
+ ## Report Structure
12
+
13
+ ### 1. Session Overview
14
+
15
+ **User's Goal:**
16
+ [Brief description of what they wanted to accomplish]
17
+
18
+ **What Was Used:**
19
+ Review your conversation history and list ONLY the MCP tools, prompts, and resources you actually used:
20
+
21
+ - **Tools:** [List with call counts - e.g., "find_component (3 calls: Button, Card, Modal)"]
22
+ - **Prompts:** [List which ones - e.g., "audit_code, build_ui, create_scaffold"]
23
+ - **Resources:** [List what docs you accessed - e.g., "Button component docs, spacing tokens"]
24
+
25
+ ### 2. Issues Encountered
26
+
27
+ For each issue you encountered, report:
28
+
29
+ **Issue: [Brief title]**
30
+ - **Category:** [Tool / Prompt / Resource]
31
+ - **Specific item:** [Which tool/prompt/component/token]
32
+ - **What happened:** [Detailed description with evidence]
33
+ - **Expected behavior:** [What should have happened]
34
+ - **Impact:** [Blocked / Slowed / Minor inconvenience]
35
+ - **Suggested fix:** [What the MCP team should change]
36
+
37
+ **🔄 Inefficiency Patterns:**
38
+ If you called the same tool multiple times or had to retry operations, explain:
39
+ - Which tool/resource and how many times
40
+ - Why multiple attempts were needed
41
+ - What could prevent this pattern
42
+
43
+ **If no issues:** State "No significant issues encountered in this session."
44
+
45
+ ### 3. What Worked Well
46
+
47
+ Highlight MCP features that were particularly helpful:
48
+ - Tools that provided complete, accurate information on first try
49
+ - Prompts with clear, effective guidance
50
+ - Documentation that was comprehensive and easy to use
51
+ - Features that saved time or effort
52
+
53
+ Be specific with examples.
54
+
55
+ ### 4. Top Recommendations (Prioritized)
56
+
57
+ List your top 2-5 recommendations in priority order:
58
+
59
+ **1. [Recommendation title]**
60
+ - **Priority:** [Critical / Important / Enhancement]
61
+ - Critical = Blocked progress or caused significant delays
62
+ - Important = Slowed progress or required workarounds
63
+ - Enhancement = Would improve experience but not blocking
64
+ - **Issue:** [What needs to be fixed/added]
65
+ - **Benefit:** [How this would help users]
66
+
67
+ **2. [Next recommendation]**
68
+ [Same structure]
69
+
70
+ ### 5. Missing Capabilities
71
+
72
+ If there were tools, prompts, or resources that would have helped but don't exist:
73
+ - **What's missing:** [Description]
74
+ - **Use case:** [When/why it's needed]
75
+ - **Current workaround:** [What you do instead, if anything]
76
+
77
+ ---
78
+
79
+ ## Guidelines
80
+
81
+ **Before writing the report:**
82
+ 1. Scroll back through this entire conversation
83
+ 2. Count each tool call (find_component, find_icon, find_design_token, list_splunk_ui_requirements)
84
+ 3. Note specific components/tokens/icons you looked up
85
+ 4. Identify which prompts were invoked
86
+ 5. List which documentation you actually read
87
+
88
+ **Focus on MCP quality, not AI behavior:**
89
+ - ✅ "find_component returned incomplete prop documentation for Button"
90
+ - ❌ "I should have read the Button docs more carefully"
91
+
92
+ **Be specific and actionable:**
93
+ - ✅ "Button component docs missing 'size' prop - shows 'variant' but not size options"
94
+ - ❌ "Documentation could be better"
95
+
96
+ **Include evidence:**
97
+ - Reference specific tool calls that had issues
98
+ - Quote confusing or incorrect information
99
+ - Note which documentation sections were incomplete
100
+
101
+ **Be honest:**
102
+ - If everything worked great, say so
103
+ - Don't invent problems to fill the template
104
+ - It's OK to have a short report for a smooth session
105
+
106
+ **The goal:** Help the MCP team improve their tools, prompts, and resources. Usage data provides context, but quality feedback is the primary objective.
107
+
108
+ ---
109
+
110
+ ## Begin Your Feedback Report
111
+
112
+ Review this session and generate the report following the structure above.`;
113
+ export default SESSION_FEEDBACK_PROMPT;
@@ -0,0 +1,11 @@
1
+ import { GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ declare const sessionFeedbackPrompt: {
3
+ name: string;
4
+ config: {
5
+ title: string;
6
+ description: string;
7
+ argsSchema: {};
8
+ };
9
+ handler: () => GetPromptResult;
10
+ };
11
+ export default sessionFeedbackPrompt;
@@ -0,0 +1,22 @@
1
+ import SESSION_FEEDBACK_PROMPT from "./session-feedback-prompt.js";
2
+ const sessionFeedbackPrompt = {
3
+ name: 'session_feedback',
4
+ config: {
5
+ title: 'Generate MCP Session Feedback Report',
6
+ description: 'Prompts the AI to provide feedback about the quality and effectiveness of MCP tools, ' +
7
+ 'prompts, and resources used in the current session, with actionable recommendations for the MCP team.',
8
+ argsSchema: {},
9
+ },
10
+ handler: () => {
11
+ return {
12
+ description: 'Splunk UI MCP session feedback report',
13
+ messages: [
14
+ {
15
+ role: 'user',
16
+ content: { type: 'text', text: SESSION_FEEDBACK_PROMPT },
17
+ },
18
+ ],
19
+ };
20
+ },
21
+ };
22
+ export default sessionFeedbackPrompt;
@@ -0,0 +1,8 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ type RegisterPromptArgs = Parameters<McpServer['registerPrompt']>;
3
+ export type PromptDefinition = {
4
+ name: RegisterPromptArgs[0];
5
+ config: RegisterPromptArgs[1];
6
+ handler: RegisterPromptArgs[2];
7
+ };
8
+ export {};
@@ -1,8 +1,8 @@
1
1
  import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { filterByKeywords } from '@splunk/ui-utils/filter.js';
3
- import { getComponentList, getComponentDocs, getComponentInfo, } from "../utils/component-catalog.js";
2
+ import { getComponentList, getComponentNames, getComponentDocs, getComponentInfo, searchComponents, } from "../utils/component-catalog.js";
4
3
  export const COMPONENT_RESOURCE_NAME = 'splunk-ui-components';
5
4
  export const COMPONENT_RESOURCE_URI_BASE = 'mcp://splunk-ui/components';
5
+ const CATEGORY_SEARCH_MIN_QUERY_LENGTH = 3;
6
6
  /**
7
7
  * Creates an MCP resource URI for a component
8
8
  */
@@ -76,12 +76,13 @@ const componentResourceTemplate = new ResourceTemplate(`${COMPONENT_RESOURCE_URI
76
76
  complete: {
77
77
  componentName: async (value) => {
78
78
  const input = value?.toString() ?? '';
79
+ const componentNames = getComponentNames();
80
+ const includeCategory = input.trim().length >= CATEGORY_SEARCH_MIN_QUERY_LENGTH;
79
81
  // Return all component names if no input is provided
80
82
  if (!input) {
81
- return getComponentList().map((component) => component.name);
83
+ return componentNames;
82
84
  }
83
- const componentNames = getComponentList().map((component) => component.name);
84
- return filterByKeywords(componentNames, input);
85
+ return searchComponents(input, { includeCategory });
85
86
  },
86
87
  },
87
88
  });
@@ -101,7 +102,12 @@ const componentResource = {
101
102
  // Prefer the componentName param, but fall back to extracting from the path.
102
103
  let componentName;
103
104
  if (typeof componentNameParam === 'string' && componentNameParam.length > 0) {
104
- componentName = componentNameParam;
105
+ try {
106
+ componentName = decodeURIComponent(componentNameParam);
107
+ }
108
+ catch {
109
+ throw new Error(`Invalid component name in resource params: ${componentNameParam}`);
110
+ }
105
111
  }
106
112
  else {
107
113
  // Extract from path, but exclude 'components' itself