MCP
Learn how to use the Model Context Protocol with AxionJS components.
AxionJS now has an official MCP server π.
MCP is an open protocol that standardizes how applications provide context to LLMs. This is useful for AxionJS because you can now give your AI-assisted IDE direct access to all AxionJS components and documentation so that it can generate code with minimal errors.
Installation
Add MCP Server Configuration
Add the following configuration to your IDEβs MCP config file:
Cursor AI - Add to .cursor/mcp_servers.json
:
Restart Your IDE
After adding the configuration, restart your IDE to enable the MCP server.
Usage Examples
The MCP server provides access to AxionJS documentation, component templates, and best practices directly in your IDE.
The MCP server provides 23 powerful tools for AxionJS development:
- Project Management: Initialize new projects and manage component installations
- Component Discovery: Search, browse, and explore thousands of AxionJS components
- Code Generation: Generate customized component code with themes and styling options
- Page Creation: Build complete pages using multiple components with automatic dependency resolution
- Documentation lookup: Look up AxionJS documentation directly in your IDE
Configuration Options
Make sure to set the AXIONJS_REGISTRY_URL
environment variable to access the latest AxionJS components and documentation.
Environment Variables
Variable | Description | Default |
---|---|---|
AXIONJS_REGISTRY_URL | URL to the AxionJS registry | https://www.axionjs.com/ |
IDE-Specific Setup
Cursor AI Setup
- Open Cursor AI settings
- Navigate to Extensions β MCP Servers
- Add the configuration JSON above
- Restart Cursor AI
In agent mode, Cursor AI will automatically use the AxionJS MCP server for component suggestions and code generation.
Troubleshooting
If the MCP server fails to start, ensure you have Node.js installed and the npx
command is available in your PATH.
Common Issues
Issue | Solution |
---|---|
Server not starting | Check Node.js installation and network connectivity |
Components not loading | Verify the AXIONJS_REGISTRY_URL environment variable |
IDE not recognizing server | Restart your IDE after configuration changes |
Permission errors | Ensure npx has proper permissions to install packages |
Getting Help
If you continue to experience issues:
- Check the AxionJS GitHub
- Review the MCP documentation