Skip to content

Commit fabb3bd

Browse files
rwestMSFTcroblesm
andauthored
Adding agent mode, local container and server groups (#34453)
Co-authored-by: Carlos Robles <[email protected]>
1 parent 753bd21 commit fabb3bd

20 files changed

+303
-9
lines changed

docs/toc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8935,6 +8935,8 @@ items:
89358935
href: tools/visual-studio-code-extensions/github-copilot/limitations-and-known-issues.md
89368936
- name: Quickstarts
89378937
items:
8938+
- name: Use Agent mode tools
8939+
href: tools/visual-studio-code-extensions/github-copilot/agent-mode.md
89388940
- name: Generate data for testing and mocking
89398941
href: tools/visual-studio-code-extensions/github-copilot/test-and-mocking-data-generator.md
89408942
- name: Use the business logic explainer
@@ -8953,6 +8955,10 @@ items:
89538955
href: tools/visual-studio-code-extensions/github-copilot/security-analyzer.md
89548956
- name: Use smart query builder
89558957
href: tools/visual-studio-code-extensions/github-copilot/smart-query-builder.md
8958+
- name: Local SQL Server container
8959+
items:
8960+
- name: Overview
8961+
href: tools/visual-studio-code-extensions/mssql/mssql-local-container.md
89568962
- name: Schema compare
89578963
items:
89588964
- name: Overview
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: "Quickstart: Use GitHub Copilot Agent Mode (Preview)"
3+
description: Learn how to use GitHub Copilot Agent Mode with the MSSQL extension to connect to databases, explore schemas, and run SQL queries directly from the GitHub Copilot chat in Visual Studio Code.
4+
author: croblesm
5+
ms.author: roblescarlos
6+
ms.reviewer: randolphwest
7+
ms.date: 06/18/2025
8+
ms.service: sql
9+
ms.subservice: vs-code-sql-extensions
10+
ms.topic: quickstart
11+
ms.collection:
12+
- data-tools
13+
- ce-skilling-ai-copilot
14+
ms.custom:
15+
- build-2025
16+
ai-usage: ai-assisted
17+
---
18+
19+
# Quickstart: Use GitHub Copilot Agent Mode (Preview)
20+
21+
GitHub Copilot Agent Mode brings a contextual, action-driven chat experience into the MSSQL extension for Visual Studio Code. With Agent Mode, GitHub Copilot can go beyond suggesting code—it can securely execute real database tasks using natural language prompts or built-in tools. You can list all your connections, connect to specific server/databases and explore schemas without leaving your editor.
22+
23+
> [!TIP]
24+
> You don't need to mention a participant like `@mssql` to use SQL tools in Agent Mode. Once the MSSQL extension is active, its tools are automatically available in the Agent Mode interface. For more information, see [Agent Mode Tools](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode#_agent-mode-tools).
25+
26+
These actions are powered by tools contributed by the MSSQL extension and surfaced directly within GitHub Copilot's Agent Mode. For more information on how Agent Mode works, see the [Visual Studio Code documentation on Agent Mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode#_use-agent-mode).
27+
28+
## What is Agent Mode?
29+
30+
Agent Mode enables GitHub Copilot to go beyond suggesting code. It can now perform secure, confirmed actions inside your SQL development environment, using either chat variables like `#mssql_connect` or natural phrases like "*Connect to my Library database using my LocalDev profile.*"
31+
32+
:::image type="content" source="media/agent-mode/agent-tool-chat.png" alt-text="Screenshot of GitHub Copilot Agent Mode chat interface." lightbox="media/agent-mode/agent-tool-chat.png":::
33+
34+
## MSSQL Agent Mode tool reference
35+
36+
This section provides a detailed reference for the SQL-specific tools available in GitHub Copilot Agent Mode. The MSSQL extension contributes these tools, enabling GitHub Copilot to execute actions through chat variables or natural language prompts. All tools require user confirmation before execution.
37+
38+
:::image type="content" source="media/agent-mode/agent-tools.png" alt-text="Screenshot of list of SQL-specific tools contributed by the MSSQL extension in Copilot Agent Mode." lightbox="media/agent-mode/agent-tools.png":::
39+
40+
> [!TIP]
41+
> You can also use chat variables like `#mssql_connect` to invoke these tools directly, or write prompts in natural language such as "Connect to my development database." GitHub Copilot handles tool selection automatically.
42+
43+
### Connection management
44+
45+
| Tool name | Description |
46+
| --- | --- |
47+
| connect_server | Establishes a database connection using a saved connection profile or a specified server/database pair. |
48+
| disconnect_server | Terminates the current active connection session. |
49+
| list_servers | Lists all saved SQL Server connection profiles in your environment. |
50+
51+
#### Examples
52+
53+
- Connect to my LocalDev environment
54+
- Disconnect from my current database
55+
- List my available connection profiles
56+
57+
:::image type="content" source="media/agent-mode/agent-tool-connect.png" alt-text="Screenshot of example using an agent tool to connect to a database in the GitHub Copilot chat." lightbox="media/agent-mode/agent-tool-connect.png":::
58+
59+
#### How connection logic works
60+
61+
GitHub Copilot Agent Mode supports flexible ways to connect to your SQL database, either by referencing saved profiles or by specifying a server and database directly. Here's how the connection logic works:
62+
63+
##### Connect via saved profile
64+
65+
- A user can connect by referencing the name of a saved connection profile.
66+
- GitHub Copilot uses the `mssql_list_servers` tool to verify the profile exists.
67+
- The `mssql_connect` tool then uses the saved `profileId` and its parameters to establish the connection.
68+
69+
##### Connect via server/database specification
70+
71+
- If a saved profile matches both the specified server and database:
72+
- GitHub Copilot uses `mssql_list_servers` to find the match.
73+
- It then calls `mssql_connect` using the full profile.
74+
75+
- If a saved profile matches only the server:
76+
- GitHub Copilot finds the matching server profile.
77+
- It attempts to connect by substituting the user-requested database into that profile.
78+
- If the connection fails, an error is shown.
79+
80+
- If no profile matches the specified server:
81+
- GitHub Copilot reports an error.
82+
83+
This flexible matching system allows GitHub Copilot to handle a range of connection scenarios, minimizing user effort while ensuring secure, confirmable actions.
84+
85+
### Schema exploration
86+
87+
| Tool name | Description |
88+
| --- | --- |
89+
| show_schema | Displays a high-level diagram of your connected database schema, including tables and relationships. |
90+
91+
#### Examples
92+
93+
- Show me the schema for this database
94+
95+
:::image type="content" source="media/agent-mode/agent-tool-schema.gif" alt-text="Screenshot of animation showing the database schema visualizer tool in Copilot Agent Mode." lightbox="media/agent-mode/agent-tool-schema.gif":::
96+
97+
## How tools are managed in Agent Mode
98+
99+
GitHub Copilot can invoke MSSQL-specific tools and other extension-contributed tools while processing your request. These tools are visible in the Agent Mode interface under the Tools menu, where you can enable or disable specific tools.
100+
101+
When a tool is invoked—especially if it interacts with your machine or database—GitHub Copilot prompts for confirmation to ensure secure execution. You can allow the tool for just the current session, the workspace, or approve it permanently.
102+
103+
For more on tool visibility and approvals, visit [Manage tool approvals](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode#_manage-tool-approvals).
104+
105+
### Agent Mode confirmation workflow
106+
107+
When GitHub Copilot selects a tool, it prompts you with a confirmation dialog showing details about the requested action. You must explicitly approve the request before it can execute any commands that interact with your machine or database:
108+
109+
- **Allow in this session**
110+
- **Allow in this workspace**
111+
- **Always allow**
112+
113+
This confirmation step helps ensure secure, intentional interactions with your development environment.
114+
115+
> [!NOTE]
116+
> For more information on how confirmation works across all tools in Agent Mode, see the [official VS Code documentation on tool approvals](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode#_manage-tool-approvals).
117+
118+
## Related content
119+
120+
- [Quickstart: Use Chat and inline GitHub Copilot suggestions (Preview)](inline-copilot-suggestions.md)
121+
- [Quickstart: Generate code (Preview)](code-generation.md)
122+
- [Quickstart: Use the Schema Explorer and designer (Preview)](schema-explorer-designer.md)
123+
- [Quickstart: Use the Smart Query Builder (Preview)](smart-query-builder.md)
124+
- [Quickstart: Query Optimizer Assistant (Preview)](query-optimizer-assistant.md)
125+
- [Quickstart: Use the Business Logic Explainer (Preview)](business-logic-explainer.md)
126+
- [Quickstart: Security Analyzer (Preview)](security-analyzer.md)
127+
- [Quickstart: Localization & Formatting Helper (Preview)](localization-formatting-helper.md)
128+
- [Quickstart: Generate data for testing and mocking (Preview)](test-and-mocking-data-generator.md)
129+
- [Limitations and known issues](limitations-and-known-issues.md)
13.8 KB
Loading
64.2 KB
Loading
2.27 MB
Loading
22.3 KB
Loading

docs/tools/visual-studio-code-extensions/mssql/connect-database-visual-studio-code.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to connect to a database using the MSSQL extension for Vi
44
author: croblesm
55
ms.author: roblescarlos
66
ms.reviewer: maghan, randolphwest
7-
ms.date: 11/20/2024
7+
ms.date: 06/18/2025
88
ms.service: sql
99
ms.subservice: vs-code-sql-extensions
1010
ms.topic: quickstart
@@ -54,6 +54,7 @@ To complete this quickstart, you must have:
5454
| Connection property | Value | Description |
5555
| --- | --- | --- |
5656
| **Profile Name** (optional) | Leave this field blank. | Type a name for the connection profile. such as *localhost profile*. |
57+
| **Connection Group** (optional) | Leave this field blank or select an existing group. | Organize this connection under a group folder for easier management. |
5758
| **Server name** | Enter the server name here. Ex: localhost | Specify the SQL Server instance name. Use *localhost* to connect to a SQL Server instance on your local machine. To connect to a remote SQL Server, enter the name of the target SQL Server, or its IP address. To connect to a SQL Server container, specify the IP address of the container's host machine. If you need to specify a port, use a comma to separate it from the name. For example, for a server listening on port 1401, enter `<servername or IP>,1401`.<br /><br />By default, the connection string uses port 1433. A default instance of SQL Server uses 1433 unless modified. If your instance is listening on 1433, you don't need to specify the port.<br />As an alternative, you can enter the ADO connection string for your database here. |
5859
| **Trust Server Certificate** | Check this field. | Select this option to trust the server certificate. |
5960
| **Input type** | Parameter. | Choose from **Parameter**, **Connection String**, or **Browse Azure**. |
Loading
Loading
35.5 KB
Loading

0 commit comments

Comments
 (0)