MCP
Model Context Protocol server for AI-assisted development with apx
apx includes a built-in MCP (Model Context Protocol) server that enables AI assistants like Cursor, Claude, VSCode, and Codex to interact with your development environment.
Overview
The MCP server provides tools for:
- Development Server Management - Start, stop, restart, and monitor dev servers
- Code Quality - Check project code for errors
- Component Management - Search and add UI components (with scoring boost for project-configured registries)
- SDK Documentation - Search Databricks SDK documentation
- API Routes - Get route information and code examples
- Deployment Logs - Fetch logs from deployed Databricks Apps
- Feedback - Submit feedback as GitHub issues
- Project Context - Rich project metadata including routes, dependencies, backend files, and configured registries
Starting the MCP Server
apx mcpThe MCP server runs over stdio and integrates with AI assistants that support the Model Context Protocol.
Configuration
Choose your AI assistant to see the configuration:
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"shadcn": {
"command": "bun",
"args": ["x", "--bun", "shadcn@latest", "mcp"]
},
"apx": {
"command": "apx",
"args": ["mcp"]
}
}
}Or apply the Cursor addon (also installs skill files to .claude/skills/apx/, .mcp.json, and hooks):
apx dev apply cursorCreate .vscode/mcp.json in your project root:
{
"mcpServers": {
"shadcn": {
"command": "bun",
"args": ["x", "--bun", "shadcn@latest", "mcp"]
},
"apx": {
"command": "apx",
"args": ["mcp"]
},
"playwright": {
"command": "apx",
"args": ["bun", "x", "--bun", "@playwright/mcp@latest"]
}
}
}Or apply the VSCode addon (also installs skill files to .claude/skills/apx/, .mcp.json, and hooks):
apx dev apply vscodeCreate .mcp.json in your project root:
{
"mcpServers": {
"shadcn": {
"command": "bun",
"args": ["x", "--bun", "shadcn@latest", "mcp"]
},
"apx": {
"command": "apx",
"args": ["mcp"]
},
"playwright": {
"command": "apx",
"args": ["bun", "x", "--bun", "@playwright/mcp@latest"]
}
}
}Or apply the Claude addon (also installs skill files, CLAUDE.md, and hooks):
apx dev apply claudeApply the Codex addon:
apx dev apply codexThis creates AGENTS.md with project instructions and installs skill files to .agents/skills/apx/, .mcp.json, and hooks.
All assistant addons automatically install apx skill files (quick reference +
backend/frontend patterns) during apx init. Each addon uses its configured
skill path — most use .claude/skills/apx/, while Codex uses
.agents/skills/apx/.
Available Tools
Development Server Tools
| Tool | Description |
|---|---|
start | Start development server and return the URL |
stop | Stop the development server |
restart | Restart the development server (preserves port if possible) |
logs | Fetch recent dev server logs |
check | Check project code for errors (runs tsc and ty checks in parallel) |
refresh_openapi | Regenerate OpenAPI schema and API client |
Component Tools
| Tool | Description |
|---|---|
search_registry_components | Semantic search across all registries. Results from project-configured registries are boosted in scoring. |
list_registry_components | List all available components in a registry. Pass registry param (e.g. @ai-elements) for custom registries. |
add_component | Add a component to the project. Accepts component-name or @registry-name/component-name. |
Project Tools
| Tool | Description |
|---|---|
routes | List all API routes from the OpenAPI schema |
Documentation Tools
| Tool | Description |
|---|---|
docs | Search Databricks SDK documentation for code examples and API references |
get_route_info | Get code example for using a specific API route |
Deployment Tools
| Tool | Description |
|---|---|
databricks_apps_logs | Fetch Databricks Apps logs from a deployed app |
Feedback Tools
| Tool | Description |
|---|---|
feedback_prepare | Prepare a feedback issue for review. Returns formatted title, body, and browser URL. |
feedback_submit | Submit a prepared feedback issue as a public GitHub issue (requires gh CLI). |
Tool Details
start
Start the development server in detached mode.
Returns: Server URL (e.g., http://localhost:8000)
stop
Stop all running development servers.
Returns: Confirmation message
restart
Restart development servers, attempting to reuse the same port.
Returns: New server URL
logs
Fetch recent dev server logs.
Parameters:
duration(optional): Time period for logs (default:60s)
Returns: Log output from backend, frontend, and OpenAPI watcher
check
Check project code for errors using TypeScript compiler and Python type checker in parallel.
Returns: Check results or error messages
refresh_openapi
Regenerate the OpenAPI schema and TypeScript API client from your Python models.
Returns: Confirmation message
search_registry_components
Search for UI components using semantic search across all cached registries.
Components from registries configured in [tool.apx.ui.registries] (pyproject.toml) receive a scoring boost, improving discoverability of project-relevant components.
Parameters:
query: Search query (e.g., "button", "data table", "chat message")limit(optional): Maximum results (default:10)
Returns: List of matching components with registry, relevance score, and the project's configured registries
list_registry_components
List all available components in a registry.
Parameters:
app_path: Absolute path to the project directoryregistry(optional): Registry name (e.g.,@animate-ui). Omit for default shadcn registry.
Returns: List of component names in the registry
add_component
Add a UI component to your project.
Parameters:
component_id: Component identifier- Simple:
button(from default registry) - With registry:
@animate-ui/accordion
- Simple:
force(optional): Overwrite existing files (default:false)
Returns: Confirmation message
routes
List all API routes from the OpenAPI schema.
Parameters:
app_path: Absolute path to the project directory
Returns: List of API routes with methods, paths, and operation IDs
docs
Search Databricks SDK documentation for relevant code examples.
Parameters:
source: Documentation source (databricks-sdk-python)query: Search query (e.g., "create cluster", "list jobs")num_results(optional): Maximum results (default:5)
Returns: Matching documentation with code examples and source files
get_route_info
Get TypeScript code example for using a specific API route.
Parameters:
operation_id: Operation ID from OpenAPI schema (e.g.,listItems,createItem)
Returns: React hook usage example with types
databricks_apps_logs
Fetch logs from a deployed Databricks App.
Parameters:
app_name(optional): App name (auto-detected fromdatabricks.ymlif not provided)tail_lines(optional): Number of lines to fetch (default:200)search(optional): Filter logs by search termsource(optional): Filter by log sourceprofile(optional): Databricks CLI profiletarget(optional): Deployment targettimeout_seconds(optional): Command timeout (default:60)
Returns: Log output with metadata
feedback_prepare
Prepare a feedback issue for review before submission.
Parameters:
title: Issue titlebody: Issue description (markdown)labels(optional): Issue labels
Returns: Formatted title, body, and browser URL for review
feedback_submit
Submit a previously prepared feedback issue as a public GitHub issue.
Parameters:
title: Issue title (fromfeedback_prepare)body: Issue body (fromfeedback_prepare)
Returns: GitHub issue URL or browser fallback URL
Resources
The MCP server exposes resources that provide project context:
| Resource | Description |
|---|---|
apx://info | Information about the apx toolkit, patterns, and workflow |
apx://project/{app_path} | Project context: routes, components, Python dependencies, backend files, SDK version, registries |
AI Assistant Integration
Workflow Example
Use apx mcp server to start development server, then create a nice
application for order management. Use shadcn mcp to add new components,
make sure style is consistent and data is properly fetched from the backend.The AI assistant will:
- Call
startto launch the development servers - Use
search_registry_componentsto find relevant UI components - Call
add_componentto install components - Use
get_route_infoto understand API usage - Use
checkto verify code quality
Best Practices
- Let the AI manage servers - AI assistants can start/stop servers as needed
- Check configured registries first - Components from project-configured registries (in
pyproject.toml) are boosted in search results. Uselist_registry_componentsto browse specific registries before building custom components. - Leverage SDK docs - Always use the
docstool to verify Databricks SDK method signatures before writingws.*calls - Use SDK methods, not raw HTTP - Prefer
ws.jobs.list()overws.api_client.do(). SDK methods handle pagination, retries, and type safety. - Check code regularly - Use the
checktool to catch errors early - Use
get_route_infofor frontend - Get ready-to-use Suspense + ErrorBoundary scaffolding for any API route