> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/intelligence/built-in-mcp-tools.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# Built In MCP Tools

Use PowerShell Universal built-in MCP tools to inspect and manage resources, repository files, notifications, jobs, and portal controls.

PowerShell Universal includes built-in MCP tools at `/api/v1/mcp`. They help MCP clients inspect the PowerShell Universal configuration repository, discover cmdlets, read job output and notifications, and apply supported repository changes.

Built-in tools are separate from custom AI Tools. Connect an MCP client to `/api/v1/mcp` and authenticate with a PowerShell Universal app token.

## Connect from Visual Studio Code

GitHub Copilot can call the built-in tools when Visual Studio Code is connected to the PowerShell Universal MCP server.

Press `Ctrl+Shift+P`, run **MCP: Add Server...**, select **HTTP**, and enter the MCP endpoint URL. By default, the URL is `http://localhost:5000/api/v1/mcp`.

The resulting `settings.json` configuration looks like this:

```json
"mcp": {
  "servers": {
    "PSU": {
      "url": "http://localhost:5000/api/v1/mcp"
    }
  }
}
```

To authenticate with a PowerShell Universal app token, include it as a bearer token in the `Authorization` header:

```json
"mcp": {
  "servers": {
    "PSU": {
      "url": "http://localhost:5000/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer <your-app-token>"
      }
    }
  }
}
```

Replace `<your-app-token>` with a token for the PowerShell Universal user and roles the client should use. Do not commit a configuration containing a real app token to source control.

If the connection succeeds, GitHub Copilot displays the available PowerShell Universal tools.

## Access control

Most built-in tools require the **Administrator** or **Operator** role. `search_ant_design_controls` also supports the **App Editor** role. `get_job_output_by_id` requires an authenticated user and verifies that user has permission to read the requested job or its configured read permission.

Use a dedicated app token with only the role required by the MCP client. Repository write tools can create, update, move, and delete configuration files, so do not grant Administrator or Operator access to an untrusted MCP client.

Every built-in tool call is recorded in the audit log with the tool name, the user, the parameters, and whether the call completed or failed. For `set_file_content`, the audit log records the length of the new content, not the content itself.

## Server name

The MCP server reports its name as `Universal.Server` by default. To change it, set the `Mcp:ServerName` key in `appsettings.json` or the equivalent environment variable.

```json
{
  "Mcp": {
    "ServerName": "PSU Production"
  }
}
```

## Typical flow

1. Call `list_resource_types` and `list_resources` to identify the configuration resource.
2. Use the repository and command tools to inspect the relevant files and cmdlets.
3. Apply a deliberate repository change with a write tool when authorized.
4. Call `reload_resource` to reload the affected resource.
5. Use `get_notifications` or `get_job_output_by_id` to verify the result.

## Resource and command tools

| Tool                  | Description                                                           | Parameters                                                                                                                                                                                                                                                                      |
| --------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list_resource_types` | Lists available PowerShell Universal resource types.                  | None.                                                                                                                                                                                                                                                                           |
| `list_resources`      | Lists resources of a selected type, with wildcard filtering.          | `type` (string): a resource type returned by `list_resource_types`. `filter` (string): matches the name or description of the resource; wildcards are supported.                                                                                                                |
| `reload_resource`     | Reloads a selected resource type after a configuration change.        | `resourceType` (string): the resource type to reload. Returns `Resource reloaded`.                                                                                                                                                                                              |
| `list_commands`       | Lists commands from a PowerShell module.                              | `module` (string): the module to list commands from. `name` (string): a command name; wildcards are supported.                                                                                                                                                                  |
| `command_help`        | Returns focused or full help for a command, parameters, and examples. | `module` (string). `command` (string). `parameter` (string): returns help only for the matching parameters; wildcards are supported, and `*` returns the general help. `full` (boolean): adds examples, all parameters, and related links. `examples` (boolean): adds examples. |
| `list_app_commands`   | Lists Universal App-development cmdlets.                              | `filter` (string): matches the command name; wildcards are supported. Only commands of the `Universal` module whose name contains `-UD` are returned.                                                                                                                           |

## Repository and operational tools

### Repository tools

The following tools inspect and manage repository-relative files and directories:

| Tool                      | Description                             | Parameters                                                                                                                                                                                                                                                |
| ------------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list_files`              | Lists files and directories.            | `path` (string): leave empty to list the repository root.                                                                                                                                                                                                 |
| `search_files`            | Searches file and directory names.      | `searchTerm` (string): plain text behaves like a contains search; wildcards are supported. `path` (string): the folder to search under; leave empty for the repository root. `maxResults` (integer, default `100`).                                       |
| `search_file_content`     | Searches repository file contents.      | `searchTerm` (string): plain text behaves like a contains search; wildcards are supported. `path` (string): the folder to search under; leave empty for the repository root. `maxResults` (integer, default `100`): the maximum number of matching lines. |
| `get_file_content`        | Reads a repository file.                | `path` (string).                                                                                                                                                                                                                                          |
| `set_file_content`        | Replaces a repository file's content.   | `path` (string). `content` (string): the full new content of the file. Returns `File updated`.                                                                                                                                                            |
| `new_file_system_item`    | Creates a repository file or directory. | `path` (string). `isFile` (boolean): `true` creates a file, `false` creates a directory. Returns `Item created`.                                                                                                                                          |
| `move_file_system_item`   | Moves or renames a repository item.     | `sourcePath` (string). `destinationPath` (string). `overwrite` (boolean, default `false`): overwrites an existing destination. Returns `Item moved`.                                                                                                      |
| `delete_file_system_item` | Deletes a repository item.              | `path` (string). Returns `Item deleted`.                                                                                                                                                                                                                  |

All paths are repository-relative. Use the discovery tools before changing a file, and call `reload_resource` after an authorized configuration change.

### Operational tools

| Tool                         | Description                                                                              | Parameters                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `get_notifications`          | Returns recent notifications, optionally filtered by read state, level, time, or cursor. | `maxResults` (integer, default `10`; values outside 1-100 are clamped). `unreadOnly` (boolean, default `true`). `levels` (string): comma-separated levels among `Information`, `Warning`, and `Error`. `since` (string): an ISO 8601 date or date-time; only notifications created on or after it are returned. `afterId` (integer): only notifications with a greater ID are returned. |
| `get_job_output_by_id`       | Returns pipeline or job-stream output when the caller is allowed to read that job.       | `jobId` (integer).                                                                                                                                                                                                                                                                                                                                                                      |
| `search_ant_design_controls` | Searches available Ant Design and PSBlazor portal controls and returns their parameters. | `searchTerm` (string): matches control names, component type names, and property names; leave empty to list controls. `maxResults` (integer, default `20`; values outside 1-50 are clamped). `includeProperties` (boolean, default `true`): set to `false` to return only control names and component types.                                                                            |

`get_notifications` returns the newest notifications first, each with its ID, title, description, target URL, creation time, creator, level, read state, and stack trace. An invalid level returns `Invalid notification level '<value>'. Expected one or more of: Information, Warning, Error.` An invalid `since` value returns `The since value must be a valid ISO 8601 date or date-time.`

`get_job_output_by_id` returns the job's pipeline output as JSON when the job has pipeline output; otherwise, it returns each job-stream message as `<type> - <message>`. The caller can read the output when it has read access to automation jobs, or when it is authorized for the read permission configured on the job. Otherwise, the tool returns one of these messages:

* `Job '<id>' was not found.`
* `You are not authorized to read output for job '<id>'.`
* `Job '<id>' has no output.`

## Tool limits and run targets

PowerShell Universal supports optional per-minute MCP tool rate limiting and an optional concurrent-job limit for AI tool jobs. Configure these limits in the server settings to protect the instance from excessive tool activity.

Both limits are in **Settings** > **Automation**, under **Jobs**. They can also be set with `Set-PSUSetting`.

| Setting                          | `Set-PSUSetting` parameter   | Default | Description                                                                                                              |
| -------------------------------- | ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ |
| **MCP Tool Requests per Minute** | `-McpToolRateLimitPerMinute` | `0`     | The maximum number of MCP tool requests allowed per minute, across all MCP clients. Set to `0` to disable rate limiting. |
| **Concurrent MCP Tool Jobs**     | `-McpToolConcurrentJobLimit` | `0`     | The maximum number of MCP tool jobs that can run at once. Set to `0` for no limit.                                       |

The rate limit is checked when an MCP client calls a custom AI Tool. When the limit is reached, the call fails with `MCP tool requests are rate limited. Please try again in a minute.` The concurrent limit counts jobs started by custom AI Tools called through the MCP endpoint. When it is reached, new MCP tool jobs stay queued until a running one finishes. MCP tool jobs also count toward the general **Concurrent Job Limit**.

Custom AI Tools can also define **Run In** and **Run On** targets. These settings control the environment and computer or computer group used when a custom tool starts a job. They do not change the authorization requirements of the built-in MCP tools listed on this page.

## Examples

Use resource discovery before editing configuration:

```
list_resource_types
list_resources(type: "scripts", filter: "Inventory*")
get_file_content(path: "scripts/Inventory.ps1")
```

After an authorized update, reload and inspect notifications:

```
set_file_content(path: "scripts/Inventory.ps1", content: "<new script content>")
reload_resource(resourceType: "scripts")
get_notifications(unreadOnly: true, levels: "Warning,Error")
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/intelligence/built-in-mcp-tools.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
