MCP 服务器

webforJ MCP Server

com.webforj/mcp
开发者工具 知识与文档 公开且可连接 MCP 2025-11-25

此 MCP 可以做什么

Supports webforJ development with project and theme generation, documentation search, version lookup, component styling inspection, and Java and CSS validation.

create_project
webforJ Project Generator
Returns the Maven archetype command that scaffolds a new webforJ project, plus the follow-up commands to change into the generated directory and start the dev server. Relay the Maven command to the user via the host shell tool without modifying its arguments. Set showOptions=true to list available archetypes and the startforJ web generator instead of producing a command.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['appName', 'reasoning'], 'properties': {'flavor': {'enum': ['webforj', 'webforj-spring'], 'type': 'string', 'description': 'Project flavor (default: webforj-spring)'}, 'appName': {'type': 'string', 'minLength': 1, 'description': 'webforJ application name'}, 'groupId': {'type': 'string', 'description': 'Maven group ID (default: com.<artifactId-without-hyphens>)'}, 'version': {'type': 'string', 'description': 'Project version (default: 1.0-SNAPSHOT)'}, 'archetype': {'enum': ['blank', 'hello-world', 'tabs', 'sidemenu'], 'type': 'string', 'description': 'Archetype template (default: hello-world)'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}, 'artifactId': {'type': 'string', 'description': 'Maven artifact ID (default: kebab-case of appName)'}, 'showOptions': {'type': 'boolean', 'description': 'If true, list archetypes and startforJ info instead of generating. Default: false.'}, 'archetypeVersion': {'type': 'string', 'description': 'webforJ archetype version (default: LATEST)'}}, 'additionalProperties': False}
create_theme
webforJ Theme Generator
Generate a webforJ theme from a primary HSL color. Returns two content blocks: a JSON summary with theme metadata, @AppTheme / @StyleSheet snippets, and recommended file paths, plus a second text block prefixed "CSS_CONTENT:" containing the full stylesheet.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['primaryColor', 'webforjVersion', 'reasoning'], 'properties': {'step': {'type': 'number', 'maximum': 20, 'minimum': 1, 'description': 'Step size for contrast calculations (pre-25.12 only, default: 5).'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}, 'themeName': {'type': 'string', 'description': 'Optional theme name for multi-theme applications. Omit for global CSS overrides.'}, 'infoDegree': {'type': 'number', 'maximum': 360, 'minimum': 0, 'description': 'Degree offset for info/secondary color (pre-25.12 only, default: 180).'}, 'primaryColor': {'type': 'array', 'items': [{'type': 'number', 'maximum': 360, 'minimum': 0, 'description': 'Hue (0-360)'}, {'type': 'number', 'maximum': 100, 'minimum': 0, 'description': 'Saturation (0-100)'}, {'type': 'number', 'maximum': 100, 'minimum': 0, 'description': 'Lightness (0-100)'}], 'maxItems': 3, 'minItems': 3, 'description': 'Primary color in HSL format: [hue, saturation, lightness]. Example: [220, 70, 50] for blue.'}, 'webforjVersion': {'type': 'string', 'pattern': '^\\d+\\.\\d+(-SNAPSHOT)?$', 'description': 'The webforJ version you are targeting, exactly as it appears in the project\'s pom.xml: a released major.minor like "25.12", or the current upcoming SNAPSHOT like "26.00-SNAPSHOT" (only the next unreleased version is published as SNAPSHOT; there is just one active SNAPSHOT at any time). Read it from pom.xml or ask the user.'}, 'tintScaleFactor': {'type': 'number', 'description': 'Scale factor for tint generation (pre-25.12 only, default: 0).'}, 'tintBaseSaturation': {'type': 'number', 'maximum': 100, 'minimum': 0, 'description': 'Base saturation for neutral grey tints (pre-25.12 only, default: 10).'}, 'contrastSensitiveLightness': {'type': 'boolean', 'description': 'Use contrast-sensitive lightness calculations (pre-25.12 only, default: false).'}, 'detectPrimaryColorCategory': {'type': 'boolean', 'description': 'Auto-detect color category for optimization (pre-25.12 only, default: true).'}}, 'additionalProperties': False}
fqcn_validate
webforJ FQCN Validator
Validate fully qualified class names against the catalog of types declared in webforJ source for the target version. Accepts either an explicit list of FQCNs or a Java snippet (the handler extracts its import statements). Returns unknown FQCNs with ranked similar-name suggestions. FQCNs outside the webforJ package family are not validated. Run this on any generated or edited Java before writing it to disk.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['webforjVersion', 'reasoning'], 'properties': {'content': {'type': 'string', 'minLength': 1, 'description': 'A Java source snippet or file. The handler extracts every `import X.Y.Z;` line it contains and validates each FQCN against the catalog. Static imports and wildcard imports are skipped. Provide either this field OR `imports`, never both in the same call.'}, 'imports': {'type': 'array', 'items': {'type': 'string', 'minLength': 1}, 'minItems': 1, 'description': 'A list of fully qualified class names to validate. Pass one or many; each entry is checked independently. Use this field when you already have the FQCN strings in hand. Provide either this field OR `content`, never both in the same call.'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}, 'webforjVersion': {'type': 'string', 'pattern': '^\\d+\\.\\d+(-SNAPSHOT)?$', 'description': 'The webforJ version you are targeting, exactly as it appears in the project\'s pom.xml: a released major.minor like "25.12", or the current upcoming SNAPSHOT like "26.00-SNAPSHOT" (only the next unreleased version is published as SNAPSHOT; there is just one active SNAPSHOT at any time). Read it from pom.xml or ask the user.'}}, 'additionalProperties': False}
get_document
webforJ Full Document Fetcher
Return the full content of an indexed webforJ documentation or sample file. Use this as a follow-up to search_knowledge_base when a search result excerpt is not enough and you need the complete page — migration guides, tutorials, long API docs. Pass the documentId from a search result.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['id', 'reasoning'], 'properties': {'id': {'type': 'string', 'minLength': 1, 'description': 'Document id. Take this from the `documentId` field of a search_knowledge_base result. Stable, unique per document.'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}}, 'additionalProperties': False}
get_versions
webforJ Version Catalog
Report the webforJ versions this server knows about. Returns the latest stable release, the current in-development SNAPSHOT (from the main-branch pom.xml), and an array of every major with its highest observed tag plus a `status` flag: "development" (the active SNAPSHOT line — actively changing), "stable" (the latest released major — may still receive minor/patch bugfixes), or "frozen" (older released majors — no new releases will be cut). Each major also carries `dataAvailable` indicating whether the DWC styling tools can answer questions about it. Call this FIRST when you do not know what version the user is on or which version to target — never guess.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['reasoning'], 'properties': {'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}}, 'additionalProperties': False}
search_knowledge_base
webforJ Knowledge Base Search
Search webforJ documentation, JavaDoc, and code samples for any class, method, annotation, or component, and for CSS styling concepts and rules (palette semantics, seed vs h/s, :not([theme]) pattern, dark mode, ::part limits, table styling). Returns matching snippets with titles, categories, and relevance scores. Call this before claiming any webforJ API exists. For exact --dwc-* custom property or ::part() names on a specific component, use styles_get_component instead; to verify tokens in generated CSS, use styles_validate_tokens. Pass category to narrow the search; if the category is unknown the tool errors with a ranked list of similar names plus the full set of valid categories, so you can retry. In a webforJ project the deliverable is Java (or the Kotlin DSL) using webforJ classes; search for the dedicated webforJ component before falling back to React, JSX, or hand-built HTML.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['query', 'reasoning'], 'properties': {'type': {'enum': ['documentation', 'java', 'sample', 'kotlin', 'all'], 'type': 'string', 'description': 'Restrict results to a single content type. "documentation" = markdown docs and guides, "java" = webforJ Java API signatures, "sample" = Java sample programs, "kotlin" = webforJ Kotlin DSL source. Default: "all".'}, 'limit': {'type': 'integer', 'maximum': 200, 'minimum': 1, 'description': 'Maximum number of search results to return (default: 25).'}, 'query': {'type': 'string', 'minLength': 1, 'description': 'Natural language query. Examples: "how to create buttons", "form validation", "data binding", "routing with @Route annotation".'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}, 'categories': {'type': 'array', 'items': {'type': 'string', 'minLength': 1}, 'description': 'Restrict results to one or more categories (any-of). Omit the field, pass an empty array, or include "all" to search every category. Prefer passing categories when the query is scoped (e.g. ["button"] for a button question, ["button","flexlayout"] for a button-inside-a-layout question). If any entry is not a known category the tool returns isError with ranked similar-name suggestions per bad entry and the full list of valid categories, so a corrected retry will succeed.'}}, 'additionalProperties': False}
styles_get_component
webforJ Component Styling Lookup
Return the real CSS styling surface of a DWC web component: CSS custom properties, shadow parts, reflected attributes, and slots. Accepts a DWC tag ("dwc-button") or a webforJ Java class name ("Button", "TextField"). Use mode="list" for every valid tag, mode="map" for Java -> tag mappings. Call this before writing CSS for a component so you never guess a var or part name. Prefer a typed Java setter on the component over CSS when both can produce the same result.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['webforjVersion', 'reasoning'], 'properties': {'mode': {'enum': ['lookup', 'list', 'map'], 'type': 'string', 'description': '"lookup" (default): return a single component\'s styling metadata. "list": return every valid DWC tag for the target webforJ version. "map": return the Java class -> DWC tag mapping.'}, 'name': {'type': 'string', 'description': 'The component to look up. Accepts a DWC tag ("dwc-button") or a webforJ Java class name ("Button", "TextField"). Omit when mode is "list" or "map".'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}, 'webforjVersion': {'type': 'string', 'pattern': '^\\d+\\.\\d+(-SNAPSHOT)?$', 'description': 'The webforJ version you are targeting, exactly as it appears in the project\'s pom.xml: a released major.minor like "25.12", or the current upcoming SNAPSHOT like "26.00-SNAPSHOT" (only the next unreleased version is published as SNAPSHOT; there is just one active SNAPSHOT at any time). Read it from pom.xml or ask the user.'}}, 'additionalProperties': False}
styles_list_tokens
webforJ Global DWC Token Catalog
Return the authoritative list of global --dwc-* tokens (palette seeds, color shades, surfaces, spacing, typography, borders, etc.). Use this for any "which tokens are available for X" question — DO NOT ask the knowledge base to list tokens; it returns prose and the answer will be hallucinated. Filter with "prefix" (e.g. "--dwc-color-primary-") or "contains" (e.g. "seed") to narrow the result. For component-scoped CSS vars like --dwc-button-* use styles_get_component instead. The returned list is verbatim and complete for the filter you passed — do not add, rename, complete, or explain "implied" tokens, and do not reference tokens from other webforJ versions. If a token you expect is missing from the response, it does not exist for that version. Tokens that share a description are returned in a single entry where "names" is the list of every token that has that description; treat each name as a real, independently usable token. When writing CSS, use a token instead of hardcoding colors, spacing, or font sizes.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['webforjVersion', 'reasoning'], 'properties': {'prefix': {'type': 'string', 'description': 'Return only tokens that start with this string. Examples: "--dwc-color-primary-" for every primary-palette shade, "--dwc-space-" for spacing, "--dwc-color-" for all color tokens.'}, 'contains': {'type': 'string', 'description': 'Return only tokens that contain this substring anywhere. Useful for cross-palette queries like "seed" (all palette seeds) or "text" (all text-contrast shades).'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}, 'webforjVersion': {'type': 'string', 'pattern': '^\\d+\\.\\d+(-SNAPSHOT)?$', 'description': 'The webforJ version you are targeting, exactly as it appears in the project\'s pom.xml: a released major.minor like "25.12", or the current upcoming SNAPSHOT like "26.00-SNAPSHOT" (only the next unreleased version is published as SNAPSHOT; there is just one active SNAPSHOT at any time). Read it from pom.xml or ask the user.'}}, 'additionalProperties': False}
styles_validate_tokens
webforJ DWC Token Validator
Validate every --dwc-* reference in CSS, Java, MDX, or Markdown text against the real DWC global tokens and component CSS variables. Returns the list of invalid tokens with line numbers and ranked similar-name suggestions. Run this on any generated or edited stylesheet before writing it to disk.
只读 幂等
输入模式
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['content', 'webforjVersion', 'reasoning'], 'properties': {'content': {'type': 'string', 'minLength': 1, 'description': 'The CSS, Java, Markdown, or MDX text to scan. Every --dwc-* reference is checked against the real DWC global tokens and the component CSS variables for the target webforJ version.'}, 'reasoning': {'type': 'string', 'minLength': 1, 'description': 'Your step-by-step reasoning for why you are calling this tool and what you expect it to return. Stating it explicitly before the call helps you pick the right arguments, avoid redundant calls, and stay on the documented routing path for this tool.'}, 'webforjVersion': {'type': 'string', 'pattern': '^\\d+\\.\\d+(-SNAPSHOT)?$', 'description': 'The webforJ version you are targeting, exactly as it appears in the project\'s pom.xml: a released major.minor like "25.12", or the current upcoming SNAPSHOT like "26.00-SNAPSHOT" (only the next unreleased version is published as SNAPSHOT; there is just one active SNAPSHOT at any time). Read it from pom.xml or ask the user.'}}, 'additionalProperties': False}
已添加
create_theme
2026年9月17日 12:38
已添加
fqcn_validate
2026年9月17日 12:38
已添加
styles_validate_tokens
2026年9月17日 12:38
已添加
styles_list_tokens
2026年9月17日 12:38
已添加
styles_get_component
2026年9月17日 12:38
已添加
search_knowledge_base
2026年9月17日 12:38
已添加
get_document
2026年9月17日 12:38
已添加
create_project
2026年9月17日 12:38
已添加
get_versions
2026年9月17日 12:38