MCP Server
The webforJ Model Context Protocol (MCP) server provides AI assistants with direct access to official webforJ documentation, verified code examples, and framework-specific patterns, allowing responses with more accurate answers, and automated project generation specifically for webforJ development.
What's an MCP?
Model Context Protocol is an open standard that enables AI assistants to connect with external tools and documentation. The webforJ MCP server implements this protocol to provide:
- Knowledge Search - Natural language search across webforJ documentation, code examples, and patterns
- Project Generation - Create webforJ applications from official templates with proper structure
- Theme Creation - Generate accessible CSS themes following webforJ design patterns
Why use MCP?
While AI coding assistants excel at answering basic questions, they struggle with complex webforJ-specific queries that span multiple documentation sections. Without direct access to official sources, they may:
- Generate methods that don't exist in webforJ
- Reference outdated or incorrect API patterns
- Provide code that won't compile
- Confuse webforJ syntax with other Java frameworks
- Misunderstand webforJ-specific patterns
With MCP integration, AI responses are anchored to actual webforJ documentation, code examples, and framework patterns, providing verifiable answers with direct links to official sources for deeper exploration.
While MCP significantly improves accuracy by providing access to official webforJ resources, it doesn't guarantee perfect code generation. AI assistants may still make mistakes in complex scenarios. Always verify generated code and test thoroughly before using in production.
Installation
The webforJ MCP server is hosted at https://mcp.webforj.com
with two endpoints:
- MCP endpoint (
/mcp
) - For Claude, VS Code, Cursor - SSE endpoint (
/sse
) - For legacy clients
- VS Code
- Cursor
- Claude Code
- Claude Desktop
- Windsurf
Add this configuration to your VS Code settings.json file:
"mcp": {
"servers": {
"webforj-mcp": {
"url": "https://mcp.webforj.com/mcp"
}
}
}
Add this configuration to your Cursor settings:
"mcpServers": {
"webforj-mcp": {
"url": "https://mcp.webforj.com/mcp"
}
}
Use the Claude CLI command to register the server:
claude mcp add webforj-mcp https://mcp.webforj.com/mcp -t http -s user
This will automatically configure the MCP server in your Claude Code environment.
Add this server using the Integrations panel in Claude Desktop settings:
- Open Claude Desktop and go to Settings
- Click on "Integrations" in the sidebar
- Click "Add Integration" and paste the URL:
https://mcp.webforj.com/mcp
- Follow the setup wizard to complete the configuration
For detailed instructions, see the official integration guide.
Add this server configuration to your Windsurf MCP settings:
{
"mcpServers": {
"webforj-mcp": {
"serverUrl": "https://mcp.webforj.com/sse"
}
}
}
Available tools
Tools are specialized functions that the MCP server provides to AI assistants. When you ask a question or make a request, the AI can call these tools to search documentation, generate projects, or create themes. Each tool accepts specific parameters and returns structured data that helps the AI provide accurate, context-aware assistance.
webforj-knowledge-base
- Search documentation and examples
This tool provides semantic search capabilities across the entire webforJ documentation ecosystem. It understands context and relationships between different framework concepts, returning relevant documentation sections, API references, and working code examples.
Example queries:
"Search webforJ documentation for Button component with icon examples"
"Find webforJ form validation patterns in the latest documentation"
"Show me current webforJ routing setup with @Route annotation"
"Search webforJ docs for FlexLayout responsive design patterns"
"Find webforJ web component integration in official documentation"
webforj-create-project
- Generate new webforJ projects
Scaffolds complete webforJ applications using official Maven archetypes. The tool creates a standardized project directory layout and includes starter code based on the selected template. Generated projects include a ready-to-use build system, resource folders, and configuration files for immediate development and deployment.
Example prompts:
"Create a webforJ project named CustomerPortal using the hello-world archetype"
"Generate a webforJ Spring Boot project with tabs layout named Dashboard"
"Create a new webforJ app with sidemenu archetype for AdminPanel project"
"Generate a webforJ blank project named TestApp with com.example groupId"
"Create webforJ project InventorySystem using sidemenu archetype with Spring Boot"
When using this tool, you can choose from several project templates:
Archetypes (project templates):
hello-world
- Basic app with sample components to demonstrate webforJ featuresblank
- Minimal project structure for starting from scratchtabs
- Pre-built tabbed interface layout for multi-view applicationssidemenu
- Side navigation menu layout for administrator panels or dashboards
Flavors (framework integration):
webforj
- Standard webforJ appwebforj-spring
- webforJ integrated with Spring Boot for dependency injection and enterprise features
webforJ comes with several predefined archetypes to help you get started quickly. For a complete list of available archetypes, see the archetypes catalog.
webforj-create-theme
- Create accessible CSS themes
Generates webforJ theme configurations using DWC HueCraft. The tool creates complete CSS custom property sets with primary, secondary, success, warning, danger, and neutral color variants.
Example requests:
"Generate a webforJ theme with HSL 220, 70, 50 as primary color for our corporate brand"
"Create webforJ accessible theme named 'ocean' with primary color #0066CC"
"Generate a webforJ theme using our brand color #FF5733"
"Create webforJ theme with HSL 30, 100, 50 named 'sunset' for our app"
"Generate accessible webforJ theme with primary RGB 44, 123, 229"
Available prompts
Prompts are pre-configured AI instructions that combine multiple tools and workflows for common tasks. They guide the AI through specific steps and parameters to deliver reliable, repeatable outcomes for each supported workflow.
create-app
- Create and run a webforJ app
Arguments:
appName
(required) - Application name (e.g., MyApp, TodoList, Dashboard)archetype
(required) - Choose from:blank
,hello-world
,tabs
,sidemenu
runServer
(optional) - Automatically run the development server (yes/no)
create-theme
- Generate a webforJ theme from a primary color
Arguments:
primaryColor
(required) - Color in hex (#FF5733), rgb (255,87,51), or hsl (9,100,60) format
search-webforj
- Advanced search with autonomous problem-solving
The prompt configures the AI to:
- Search the knowledge base extensively
- Write complete, production-ready code
- Compile the project using
mvn compile
to verify that there are no build errors - Fix errors iteratively until everything works
How to use prompts
- VS Code and Claude Code
- Claude Desktop
- Type / in the chat to see available prompts
- Select a prompt from the dropdown menu
- Fill in the required parameters when prompted
- Click the + (plus) icon in the prompt input area
- Select "Add from webforJ" from the menu
- Choose the desired prompt (e.g.,
create-app
,create-theme
,search-webforj
) - Claude will prompt you to enter the required arguments
- Fill in the parameters as requested
Look for the tools icon in the bottom corner of the input area to confirm the webforJ MCP server is connected.
Best practices
To get the most accurate and up-to-date webforJ assistance, follow these guidelines to make full use of the MCP server features.
Ensuring MCP server usage
AI models may skip the MCP server if they believe they already know the answer. To ensure the MCP server is actually used:
- Be explicit about webforJ: Always mention "webforJ" in your query to trigger framework-specific searches
- Request current information: Include phrases like "latest webforJ documentation" or "current webforJ patterns"
- Ask for verified examples: Request "working webforJ code examples" to force documentation lookup
- Reference specific versions: Mention your webforJ version (e.g., "webforJ
25.02
") to get accurate results
Writing specific prompts
Good examples:
"Search webforJ documentation for Button component event handling with examples"
"Create a webforJ project named InventorySystem using the sidemenu archetype with Spring Boot"
"Generate a webforJ theme with HSL 220, 70, 50 as primary color for corporate brand"
Poor examples:
"How do buttons work"
"Make an app"
"Make it blue"
Force MCP tool usage
If the AI provides generic answers without using the MCP server:
- Explicitly request: "Use the webforJ MCP server to search for
[query]
" - Ask for documentation references: "Find in webforJ docs how to
[query]
" - Request verification: "Verify this solution against webforJ documentation"
- Be framework-specific: Always include "webforJ" in your queries
AI customization
Configure your AI assistants to automatically use the MCP server and follow webforJ best practices. Add project-specific instructions so that your AI assistants always use the MCP server, follow webforJ documentation standards, and provide accurate, up-to-date answers that match your team's requirements.
Project configuration files
- For VS Code and Copilot, create
.github/copilot-instructions.md
- For Claude Code, create
CLAUDE.md
in your project root
Add the following to the created markdown file:
## Use the webforJ MCP server to answer any webforJ questions
- Always call the "webforj-knowledge-base" tool to fetch docs relevant to the question
- Verify all API signatures against the official documentation
- Never assume method names or parameters exist without checking
Always verify code compiles with `mvn compile` before suggesting.
FAQ
Why isn't the AI using the webforJ MCP server?
Most AI assistants require explicit instructions to use MCP servers. Configure your AI client with the instructions from the AI customization section. Without these instructions, AI assistants may default to their training data instead of querying the MCP server.
Quick fix:
Include "use webforJ MCP" in your prompt or create the appropriate configuration file (.github/copilot-instructions.md
or CLAUDE.md
).
How to verify the MCP connection is working
Use the MCP inspector to debug connections:
npx @modelcontextprotocol/inspector
Wait for the message: 🔍 MCP Inspector is up and running at http://127.0.0.1:6274
(port may vary)
Then in the inspector:
- Enter the MCP server URL:
https://mcp.webforj.com/mcp
- Click "Connect" to establish connection
- View available tools and test queries
- Monitor request/response logs for debugging
What's the difference between MCP and SSE endpoints?
The webforJ MCP server provides two endpoints:
- MCP endpoint (
/mcp
) - Modern protocol for Claude, VS Code, Cursor - SSE endpoint (
/sse
) - Server-Sent Events for legacy clients like Windsurf
Most users should use the MCP endpoint. Only use SSE if your client doesn't support the standard MCP protocol.
Is it possible to use the MCP server without configuration files?
Yes, but it's not recommended. Without configuration files, you must manually prompt the AI to use the MCP server in every conversation. Configuration files automatically instruct the AI to use the MCP server for every interaction, so you don't have to repeat instructions each time.
Manual approach: Start prompts with: "Use the webforJ MCP server to..."
Alternative: Use pre-configured prompts The MCP server provides prompts that work without configuration files:
/create-app
- Generate new webforJ applications/create-theme
- Create accessible CSS themes/search-webforj
- Advanced documentation search
See Available prompts for details.
How to contribute or report issues
Report issues: webforJ MCP Feedback
Common issues to report:
- Outdated documentation in search results
- Missing API methods or components
- Incorrect code examples
- Tool execution errors
Include your query, expected result, and actual result when reporting issues.