From b6761993446a279c50d77bf272b732724f1725c1 Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 11 Aug 2026 10:06:58 +0300 Subject: [PATCH 1/4] Revert "Merge pull request #25518 from abpframework/docs/studio-mcp-doc-sync" This reverts commit ffc7b829b5d67c0e4f3921ef027f495c5b69edf0, reversing changes made to 186b2d28235f0e060c2c8604f87195abbd7281fb. --- docs/en/cli/index.md | 30 +++++ docs/en/docs-nav.json | 4 + docs/en/studio/model-context-protocol.md | 133 ++++++++++++++++++++++ docs/en/studio/monitoring-applications.md | 4 +- docs/en/studio/overview.md | 2 + 5 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 docs/en/studio/model-context-protocol.md diff --git a/docs/en/cli/index.md b/docs/en/cli/index.md index 88b6457d46..aaeacc82fe 100644 --- a/docs/en/cli/index.md +++ b/docs/en/cli/index.md @@ -76,6 +76,7 @@ Here is the list of all available commands before explaining their details: - [clear-download-cache](../cli#clear-download-cache): Clears the templates download cache. - [check-extensions](../cli#check-extensions): Checks the latest version of the ABP CLI extensions. - [install-old-cli](../cli#install-old-cli): Installs old ABP CLI. +- [mcp-studio](../cli#mcp-studio): Starts ABP Studio MCP bridge for AI tools (requires ABP Studio running). - [generate-razor-page](../cli#generate-razor-page): Generates a page class that you can use it in the ASP NET Core pipeline to return an HTML page. - [generate-jwks](../cli#generate-jwks): Generates an RSA key pair (JWKS public key + PEM private key) for OpenIddict `private_key_jwt` client authentication. @@ -1102,6 +1103,35 @@ Usage: abp install-old-cli [options] ``` +### mcp-studio + +Starts an MCP stdio bridge for AI tools (Cursor, Claude Desktop, VS Code, etc.) that connects to the local ABP Studio instance. ABP Studio must be running for this command to work. + +> You do not need to run this command manually. It is invoked automatically by your AI tool once you add the MCP configuration to your IDE. See the [Configuration](#configuration) examples below. + +> This command connects to the **local ABP Studio** instance. It is separate from the `abp mcp` command, which connects to the ABP.IO cloud MCP service and requires an active license. + +Usage: + +```bash +abp mcp-studio [options] +``` + +Options: + +- `--endpoint` or `-e`: Overrides ABP Studio MCP endpoint. Default value is `http://localhost:38280/mcp/`. + +Example: + +```bash +abp mcp-studio +abp mcp-studio --endpoint http://localhost:38280/mcp/ +``` + +For detailed configuration examples (Cursor, Claude Desktop, VS Code) and the full list of available MCP tools, see the [Model Context Protocol (MCP)](../studio/model-context-protocol.md) documentation. + +> You can also run `abp help mcp-studio` to see available options and example IDE configuration snippets directly in your terminal. + ### generate-razor-page `generate-razor-page` command to generate a page class and then use it in the ASP NET Core pipeline to return an HTML page. diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 1a6d0b0493..3cdde03a9d 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -340,6 +340,10 @@ "text": "Monitoring Applications", "path": "studio/monitoring-applications.md" }, + { + "text": "Model Context Protocol (MCP)", + "path": "studio/model-context-protocol.md" + }, { "text": "Working with Kubernetes", "path": "studio/kubernetes.md" diff --git a/docs/en/studio/model-context-protocol.md b/docs/en/studio/model-context-protocol.md new file mode 100644 index 0000000000..7be6557df9 --- /dev/null +++ b/docs/en/studio/model-context-protocol.md @@ -0,0 +1,133 @@ +```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)." +} +``` + +# ABP Studio: Model Context Protocol (MCP) + +````json +//[doc-nav] +{ + "Next": { + "Name": "Working with Kubernetes", + "Path": "studio/kubernetes" + } +} +```` + +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. + +## How It Works + +ABP Studio runs a local MCP server in the background. The `abp mcp-studio` CLI command acts as a stdio bridge that AI clients connect to. The bridge forwards requests to ABP Studio and returns responses. + +```text +MCP Client (Cursor / Claude Desktop / VS Code) + ──stdio──▶ abp mcp-studio ──HTTP──▶ ABP Studio +``` + +> 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. + +## Configuration + +### Cursor (`.cursor/mcp.json`) + +```json +{ + "mcpServers": { + "abp-studio": { + "command": "abp", + "args": ["mcp-studio"] + } + } +} +``` + +### Claude Desktop (`claude_desktop_config.json`) + +```json +{ + "mcpServers": { + "abp-studio": { + "command": "abp", + "args": ["mcp-studio"] + } + } +} +``` + +Claude Desktop config file locations: + +- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` +- Windows: `%APPDATA%\Claude\claude_desktop_config.json` +- Linux: `~/.config/Claude/claude_desktop_config.json` + +### VS Code (`.vscode/mcp.json`) + +```json +{ + "servers": { + "abp-studio": { + "command": "abp", + "args": ["mcp-studio"] + } + } +} +``` + +### 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. + +### Generating Config Files from ABP Studio + +When creating a new solution, ABP Studio can generate MCP configuration files for Cursor and VS Code automatically. + +## 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. + +### 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_events` | Gets distributed events for debugging inter-service communication. | +| `clear_monitor` | Clears collected monitor data. | + +### Application Control + +| 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`. | + +### Container Control + +| 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). | + +### Solution Structure + +| 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. | + +## Notes + +- Monitor data (exceptions, logs, requests, events) is kept in memory and is cleared when the solution is closed. +- 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. diff --git a/docs/en/studio/monitoring-applications.md b/docs/en/studio/monitoring-applications.md index d994f6206c..e06d387146 100644 --- a/docs/en/studio/monitoring-applications.md +++ b/docs/en/studio/monitoring-applications.md @@ -11,8 +11,8 @@ //[doc-nav] { "Next": { - "Name": "AI Agent", - "Path": "studio/ai-agent" + "Name": "Model Context Protocol (MCP)", + "Path": "studio/model-context-protocol" } } ```` diff --git a/docs/en/studio/overview.md b/docs/en/studio/overview.md index bf30d40694..6c80c584cf 100644 --- a/docs/en/studio/overview.md +++ b/docs/en/studio/overview.md @@ -103,6 +103,8 @@ This pane is dedicated to managing Kubernetes services. It simplifies the proces The AI Agent is an integrated coding agent in ABP Studio. It can answer ABP-related questions, create implementation plans, and work on the current solution with controlled access to files, Studio tools, workflows, Git context, and configured MCP tools. +For external AI tool integrations through MCP, see the [Model Context Protocol (MCP)](./model-context-protocol.md) documentation. + ![ai-agent](./images/ai-agent/ai-agent-panel.png) Key features of the AI Agent include: From ea521da5ef4d05236289f707a72714fd01604d63 Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 11 Aug 2026 10:31:50 +0300 Subject: [PATCH 2/4] docs: fix MCP configuration link --- docs/en/cli/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/cli/index.md b/docs/en/cli/index.md index aaeacc82fe..2fa422bdb6 100644 --- a/docs/en/cli/index.md +++ b/docs/en/cli/index.md @@ -1107,7 +1107,7 @@ abp install-old-cli [options] Starts an MCP stdio bridge for AI tools (Cursor, Claude Desktop, VS Code, etc.) that connects to the local ABP Studio instance. ABP Studio must be running for this command to work. -> You do not need to run this command manually. It is invoked automatically by your AI tool once you add the MCP configuration to your IDE. See the [Configuration](#configuration) examples below. +> You do not need to run this command manually. It is invoked automatically by your AI tool once you add the MCP configuration to your IDE. See the [Configuration](../studio/model-context-protocol.md#configuration) examples. > This command connects to the **local ABP Studio** instance. It is separate from the `abp mcp` command, which connects to the ABP.IO cloud MCP service and requires an active license. From ac8d740cedfc684a8453c63d883d16aa11c328cf Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 11 Aug 2026 16:35:17 +0800 Subject: [PATCH 3/4] Update the MCP tool list and prerequisites to match the current tools --- docs/en/studio/ai-agent-configuration.md | 2 +- docs/en/studio/model-context-protocol.md | 36 +++++++++++++++--------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/docs/en/studio/ai-agent-configuration.md b/docs/en/studio/ai-agent-configuration.md index e0db4b9e6b..51ec4fbe16 100644 --- a/docs/en/studio/ai-agent-configuration.md +++ b/docs/en/studio/ai-agent-configuration.md @@ -102,7 +102,7 @@ Permission choices include allow once, allow always, and skip. "Allow always" pe ## MCP Tool Connections -ABP Studio can connect to user-configured Model Context Protocol (MCP) servers and expose their tools to Agent mode. This is an MCP client integration for the AI Agent. ABP Studio AI Agent does not expose itself as an MCP server for external AI clients. +ABP Studio can connect to user-configured Model Context Protocol (MCP) servers and expose their tools to Agent mode. This section is about that MCP client integration. For the other direction, where external AI clients connect to ABP Studio and use its own tools, see the [Model Context Protocol (MCP)](model-context-protocol.md) documentation. ### Adding an Integration diff --git a/docs/en/studio/model-context-protocol.md b/docs/en/studio/model-context-protocol.md index 7be6557df9..c74e09d3e0 100644 --- a/docs/en/studio/model-context-protocol.md +++ b/docs/en/studio/model-context-protocol.md @@ -79,44 +79,53 @@ 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 the Cursor and Claude Desktop 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. +The `app`, `app-nolayers` and `microservice` templates already contain a `.vscode/mcp.json` file, so a solution created from one of them works with VS Code without any extra configuration. + +> The endpoint is not authenticated. It only listens on `localhost`, but any local process can call it, and a connected client can read the monitoring data, build the solution, run the configured tasks and start or stop applications and containers. Only configure MCP clients you trust, and do not forward or expose the endpoint. ## 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. The monitoring tools work on their own. The build and solution tools need a solution to be open. The application, container and task tools also need a run profile to be selected. ### 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_events` | Gets distributed events for debugging inter-service communication. | -| `clear_monitor` | Clears collected monitor data. | ### Application Control | 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 applications of the selected run profile. A running application is stopped and started again. | +| `stop_applications` | Stops running applications. | ### Container Control | 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). | +| `start_containers` | Starts Docker containers of the selected run profile. | +| `stop_containers` | Stops Docker containers of the selected run profile. | + +### Tasks + +| Tool | Description | +|------|-------------| +| `run_task` | Runs a task of the selected run profile. It waits for the task, and on timeout it returns while the task keeps running in the background. | + +### Build + +| Tool | Description | +|------|-------------| +| `dotnet_build` | Builds the solution, a module or a package using `dotnet build`. | +| `install_libs` | Runs `abp install-libs` at the solution root. | ### Solution Structure @@ -125,7 +134,6 @@ ABP Studio exposes the following tools to MCP clients. All tools operate on the | `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. | ## Notes From 7d0ee56db1ee8e09598fda98f1db219a4902d245 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 11 Aug 2026 17:07:14 +0800 Subject: [PATCH 4/4] Add the default condition to the generated VS Code configuration --- docs/en/studio/model-context-protocol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/studio/model-context-protocol.md b/docs/en/studio/model-context-protocol.md index c74e09d3e0..17a25ccb2c 100644 --- a/docs/en/studio/model-context-protocol.md +++ b/docs/en/studio/model-context-protocol.md @@ -83,7 +83,7 @@ You can run `abp help mcp-studio` at any time to see the available options and t ### Generating Config Files from ABP Studio -The `app`, `app-nolayers` and `microservice` templates already contain a `.vscode/mcp.json` file, so a solution created from one of them works with VS Code without any extra configuration. +By default, the `app`, `app-nolayers` and `microservice` templates create a `.vscode/mcp.json` file, so a solution created from one of them works with VS Code without any extra configuration. > The endpoint is not authenticated. It only listens on `localhost`, but any local process can call it, and a connected client can read the monitoring data, build the solution, run the configured tasks and start or stop applications and containers. Only configure MCP clients you trust, and do not forward or expose the endpoint.