diff --git a/docs/en/studio/model-context-protocol.md b/docs/en/studio/model-context-protocol.md index 7be6557df9..76e691e460 100644 --- a/docs/en/studio/model-context-protocol.md +++ b/docs/en/studio/model-context-protocol.md @@ -1,7 +1,7 @@ ```json //[doc-seo] { - "Description": "Learn how to connect AI tools like Cursor, Claude Desktop, and VS Code to ABP Studio using the Model Context Protocol (MCP)." + "Description": "Learn how to connect AI tools like Cursor, Claude Desktop, and VS Code to ABP Studio using the Model Context Protocol (MCP), and see the tools currently exposed by Studio." } ``` @@ -17,7 +17,7 @@ } ```` -ABP Studio includes built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) support so AI tools can query runtime telemetry and control solution runner operations. +ABP Studio includes built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) support so AI tools can inspect runtime telemetry, work with the Solution Runner, build projects, generate proxies, run custom commands, inspect Kubernetes-related data, and automate ABP Studio's embedded browser. ## How It Works @@ -30,6 +30,8 @@ MCP Client (Cursor / Claude Desktop / VS Code) > ABP Studio must be running while MCP is used. If ABP Studio is not running (or its MCP endpoint is unavailable), `abp mcp-studio` returns an error to the AI client. +By default, the bridge connects to `http://localhost:38280/mcp/`. You can override this with the `--endpoint` option. + ## Configuration ### Cursor (`.cursor/mcp.json`) @@ -79,55 +81,78 @@ Claude Desktop config file locations: ### Quick Reference -You can run `abp help mcp-studio` at any time to see the available options and example configuration snippets for each supported IDE directly in your terminal. +You can run `abp help mcp-studio` at any time to see the available options and example configuration snippets directly in your terminal. ### Generating Config Files from ABP Studio -When creating a new solution, ABP Studio can generate MCP configuration files for Cursor and VS Code automatically. +ABP Studio solution templates can generate the VS Code MCP configuration file (`.vscode/mcp.json`) during solution creation. Cursor and Claude Desktop can be configured with the snippets shown above. ## Available Tools -ABP Studio exposes the following tools to MCP clients. All tools operate on the currently open solution and selected run profile in ABP Studio. +ABP Studio exposes the following tools to MCP clients. All tools operate on the currently open solution. Tools that interact with Solution Runner also require a selected run profile. -### Monitoring +### Runtime Monitoring | Tool | Description | |------|-------------| -| `list_applications` | Lists all running ABP applications connected to ABP Studio. | | `get_exceptions` | Gets recent exceptions including stack traces and error messages. | -| `get_logs` | Gets log entries. Can be filtered by log level. | -| `get_requests` | Gets HTTP request information. Can be filtered by status code. | +| `get_logs` | Gets runtime log entries. Can be filtered by application name and minimum log level. | +| `get_requests` | Gets HTTP request information. Can be filtered by application name, status code, and URL substring. | | `get_events` | Gets distributed events for debugging inter-service communication. | -| `clear_monitor` | Clears collected monitor data. | -### Application Control +### Solution Runner | Tool | Description | |------|-------------| -| `list_runnable_applications` | Lists all applications in the current run profile with their state. | -| `start_application` | Starts a stopped application. | -| `stop_application` | Stops a running application. | -| `restart_application` | Restarts a running application. | -| `build_application` | Builds a .NET application using `dotnet build`. | +| `start_applications` | Starts or restarts one or more applications by name, folder, or the entire application tree. | +| `stop_applications` | Stops one or more running applications by name, folder, or the entire application tree. | +| `start_containers` | Starts Docker containers in the selected run profile. | +| `stop_containers` | Stops Docker containers in the selected run profile. | +| `run_task` | Runs a Solution Runner task and waits for it to finish. | -### Container Control +### Solution Structure | Tool | Description | |------|-------------| -| `list_containers` | Lists Docker containers in the current run profile with their state. | -| `start_containers` | Starts Docker containers (docker-compose up). | -| `stop_containers` | Stops Docker containers (docker-compose down). | +| `get_solution_info` | Gets solution name, path, template, module count, and run profile information. | +| `list_modules` | Lists all modules in the solution. | +| `list_packages` | Lists packages (projects) in the solution. Can be filtered by module. | -### Solution Structure +### Build and Generation | Tool | Description | |------|-------------| -| `get_solution_info` | Gets solution name, path, template, and run profile information. | -| `list_modules` | Lists all modules in the solution. | -| `list_packages` | Lists packages (projects) in the solution. Can be filtered by module. | -| `get_module_dependencies` | Gets module dependency/import information. | +| `dotnet_build` | Builds the whole solution, selected modules, or selected packages by using `dotnet build`. | +| `install_libs` | Runs `abp install-libs` at the solution root. | +| `generate_csharp_proxies` | Generates C# static client proxies from a running API application. | +| `generate_angular_proxies` | Generates Angular service proxies from a running API application. | + +### Custom Commands and Kubernetes + +| Tool | Description | +|------|-------------| +| `list_custom_commands` | Lists custom commands defined in the current solution. | +| `run_custom_command` | Runs a custom command for a supported target and waits for completion. | +| `list_kubernetes_charts` | Lists Helm charts defined in the solution. | +| `list_kubernetes_services` | Lists services from the selected Kubernetes profile. | + +### Embedded Browser + +| Tool | Description | +|------|-------------| +| `browser_list_tabs` | Lists open tabs in ABP Studio's embedded browser. | +| `browser_open` | Opens or navigates an embedded browser tab to a URL. | +| `browser_snapshot` | Returns the current page title, URL, visible text, and interactive elements. | +| `browser_wait_for` | Waits for time-based or text-based conditions in a browser tab. | +| `browser_screenshot` | Captures a PNG screenshot of the selected browser tab. | +| `browser_click` | Clicks an element in the embedded browser by CSS selector. | +| `browser_type` | Types into an editable element in the embedded browser by CSS selector. | +| `browser_evaluate` | Runs JavaScript in the selected embedded browser tab and returns the result. | +| `browser_console` | Reads captured console output from the selected embedded browser tab. | ## Notes -- Monitor data (exceptions, logs, requests, events) is kept in memory and is cleared when the solution is closed. +- Monitor data (exceptions, logs, requests, events) is kept in memory, capped at 100 entries per application for each data type, and is cleared when the solution is closed. +- A dedicated `clear_monitor` MCP tool is not currently exposed. Closing the solution in ABP Studio clears the collected monitor data. +- Some tools depend on the current Studio context. For example, Solution Runner tools need a selected run profile, and `list_kubernetes_services` uses the selected Kubernetes profile. - The `abp mcp-studio` command connects to the local ABP Studio instance. This is separate from the `abp mcp` command, which connects to the ABP.IO cloud MCP service and requires an active license.