Microsoft Workloads on AWS

Introducing Kiro and MCP Tools for SQL Server professionals

SQL Server professionals manage critical database systems that power enterprise applications, from financial platforms to ecommerce systems. Their responsibilities include optimizing query performance, managing schemas, ensuring high availability, and troubleshooting complex issues. With the advancement of Artificial Intelligence (AI), businesses are redesigning their workflows, enabling AI to independently complete tasks and achieve business goals. Customers managing SQL Server workloads can now use Kiro to automate routine tasks and streamline database operations using natural language commands. Unlike traditional processes, which often follow rigid, predefined workflows, agentic AI introduces autonomous systems capable of reasoning, planning, and adapting to complex, real-world tasks. These intelligent agents are transforming industries by automating critical processes, and database administration is no exception.

For customers, agentic AI offers a powerful opportunity to streamline routine tasks, enhance productivity, and focus on strategic initiatives. However, with this transformation comes the need to understand emerging protocols like the Model Context Protocol (MCP), which standardizes how AI agents connect to data sources and tools, enabling seamless integration and contextual intelligence. The industry is moving toward agentic systems that can handle multi-step workflows, interact with enterprise systems, and maintain contextual awareness across operations. This shift is about automation and about creating intelligent systems that can reason like humans, making decisions based on real-time data and organizational needs.

Amazon Web Services (AWS) released AWS MCP Servers as an open-source project. Customers can use AWS MCP Servers to build lightweight servers that expose data and tools to AI agents. This helps to customize agentic workflows to their specific needs while using the scalable infrastructure of AWS.

In this blog post, we show you how SQL Server users can boost productivity using AWS AI tools, particularly Kiro CLI with MCP integration. We also show how natural language commands and context-aware automation simplify database management tasks, making database maintenance and optimization more efficient for database professionals at all skill levels.

Kiro

Kiro is an AI-powered conversational assistant designed to assist developers and IT professionals, including DBAs, with tasks ranging from coding to troubleshooting. On platforms such as the command-line interface (CLI), Visual Studio Code, JetBrains IDEs, and mobile apps, it supports natural language queries to generate code, optimize resources, and interact with AWS services. For database professionals, Kiro can:

MCP

The Model Context Protocol (MCP) developed by Anthropic is an open protocol that standardizes how applications provide context to large language models (LLMs). This enables Kiro to connect to external data sources and tools through lightweight MCP servers. The MCP servers provide context-aware responses by accessing databases, allowing for more precise automation and task execution. It enables AI assistants, like Kiro, to interact with external tools and data sources such as SQL Server databases through MCP servers. These servers expose tools and resources that allow LLMs to perform tasks like querying database schemas, executing SQL commands, or generating reports, as shown in Figure 1. The Kiro CLI acts as an MCP client, facilitating communication between the LLM and the MCP server to automate database tasks.

MCP Overview

Figure 1: MCP Overview

MCP architecture and relevance to Database Administration

With MCP, you can integrate Kiro with database environments, enabling automated tasks through natural language interactions for database administration tasks. MCP standardizes how LLMs connect to external systems, reducing the need for custom integrations. It consists of:

  • MCP Host: The AI application (for example, Kiro CLI) that interacts with the user.
  • MCP Client: A component within the host that communicates with MCP servers (for example, the CLI).
  • MCP Server: A lightweight program that exposes tools or resources, such as SQL Server schema access or query execution.
  • MCP tools: MCP tools are designed to be model-controlled, meaning the language model can automatically discover and invoke them based on the context of a conversation.
  • Relevance for SQL Server users: By combining Kiro with MCP tools, users can interact with SQL Server in natural language, automate repetitive tasks, and integrate with other systems without writing complex integration code.

Prerequisites

Before you begin, make sure you have the following:

uv python install 3.10

Basic knowledge:

  • Familiarity with database administration tasks such as deadlocks, index rebuilds, statistics, and SQL agent jobs
  • Basic familiarity with MCP use-cases. For more information, see MCP overview

IAM permissions:

Configuring MCP Servers

AWS MCP Server to Kiro CLI configuration

  1. Set up AWS profile in your environment

aws configure --profile [Profile Name]
AWS Access Key ID: [Your access key]
AWS Secret Access Key: [Your secret key]
Default region name: [your-region]
Default output format: json

  1. Make sure the Kiro CLI version is 1.9.x or later to use MCP features. You can check the Kiro CLI version by executing kiro-cli --version in your terminal.
  2. Configure MCP server Kiro CLI supports two levels of MCP configuration:
  3. Global configuration~/.kiro/settings/mcp.jsonapplies across all your projects.
  4. Local configuration.kiro/settings/mcp.jsonis specific to the current project.
  5. Choose your preferred configuration level and add the below CloudWatch MCP server configuration to the corresponding mcp.json file. Replace the AWS_PROFILE and AWS_REGION placeholders with your specific AWS profile and region.

In the JSON configuration, you need to replace the AWS_PROFILE with an AWS profile having permissions to access AWS services.

{
   "mcpServers": {
      "awslabs.cloudwatch-mcp-server": {
          "autoApprove": [],
          "disabled": false,
          "command": "uvx",
          "args": [
             "awslabs.cloudwatch-mcp-server@latest"
          ],
          "env": {
             "AWS_PROFILE": "[The AWS Profile Name you used in step1 to use for AWS access]",
             "AWS_REGION": "Add your AWS Region",
             "FASTMCP_LOG_LEVEL": "ERROR"
          },
          "transportType": "stdio"
      }
    }
}
  1. Start the conversation with command kiro-cli For more information, see Using chat on the command line .Note: You might encounter the error 0 of 1 mcp servers initialized. Servers still loading. The errors indicates that Kiro CLI could not properly initialize the MCP server at the time of loading related to path issues with uvx command. You can run which uvx command to find the full path and use it in the configuration until the path issue is resolved.
  2. Use /tools command to view available tools and capabilities as shown in Figure 2.

List of available tools

Figure 2: List of available tools

Solution Overview

Solution Overview

Figure 3: Solution Overview

As shown in Figure 3:

  1. DBA (user) input to Kiro CLI.
  2. The Kiro CLI (MCP client) sends the natural language prompt to the LLM processing and tool selection.
  3. The LLM interprets the prompt and selects the appropriate tool from the AWS CloudWatch MCP Server (for example, execute_log_insights_query or get_logs_insight_query_results).
  4. Using appropriate tools will generate results and responses.

Real-world use case example interaction:

In this example, we will analyze the deadlock information that occurred on the EC2 instance named SQLServerDB.

Prompt: “Analyze the deadlock events of SQLServerDB EC2 instance and provide recommendations”

Response as shown in Figure 4:

Figure 4: Ask Kiro CLI to identify the cause of the issue

The MCP server connects to the Amazon CloudWatch APIs, executes and returns the results to the CLI, which the LLM formats into a human-readable response, such as in Figures 5, 6, and 7.

Figure 5: Output of the Kiro CLI showing the RCA and Remediation Steps

Figure 6: Output of the Kiro CLI showing the RCA and Remediation Steps-Continued

Figure 7: Output of the Kiro CLI showing the RCA and Remediation Steps – continued

As shown in Figures 5, 6, and 7, Kiro provides detailed deadlock analysis, recommendations, and next steps through a single prompt interaction. This MCP integration with your databases increases your team productivity. We discussed how you can use AWS MCP for CloudWatch; you can extend the capabilities by building or using custom-built MCP for your own requirements. Here are some potential use cases with example prompts that you may use:

  1. Schema exploration: List all tables in my SQL Server database.
  2. Query optimization: Can you provide recommendations to optimize the stored procedure?
  3. Query generation: Write a query to find the top 10 customers by sales volume from the Orders table.
  4. One-time reporting queries: Write a query to analyze sales data from last month and project trends for the next six months.
  5. Security and compliance: What security concerns do you identify in this SQL Server instance?
  6. Maintenance tasks: Generate a script to rebuild indexes based on fragmentation levels and provide recommendations considering table size and activity patterns.
  7. Documentation: Create an ER diagram for my SQL Server database.
  8. Backup and recovery: Check for any failed backup attempts on my server.
  9. Routine analysis: Create a daily report analyzing SQL Server error logs and agent logs and provide recommendations for any errors or potential issues identified.

Effective prompt usage for Kiro is critical to obtain optimal responses. This comprehensive approach to prompt design maximizes the utility of the responses from Kiro while minimizing potential misunderstandings or irrelevant outputs. Here are some great tips for prompt design:

  1. Start with clear, specific instructions that precisely state your requirements.
  2. Provide relevant context about your environment or use case to help generate more accurate solutions.
  3. Include examples where applicable to illustrate the desired output format or approach.
  4. Incorporate error handling/guardrails by specifying how to manage potential issues or limitations.
  5. Define your preferred output formatting structure, whether it’s tables, bullet points, or code blocks.

The following example shows how to structure prompts when working with Kiro:

  1. Clear instructions: Show top 10 CPU-intensive queries and format results in a table with columns: QueryID, CPU Time, Execution Count.
  2. Provide context: Given our production database with 500 GB size and 1,000 concurrent users, identify optimal index maintenance window
  3. Output formatting: Present findings in bullet points and include SQL scripts in code blocks.
  4. Error handling: If the query fails because of permissions, provide alternative approaches and required permissions.

To learn more, see Prompt engineering concepts.

Conclusion

In this post, we showed how Kiro, integrated with MCP server, offers your team powerful automation capabilities for essential tasks including schema exploration, query generation, and documentation management. This idea can be expanded to multiple database engines. We encourage you to begin your AI journey through pilot projects, which serve as effective demonstrations of generative AI’s potential value to your team. Use your pilot project to build generative AI capabilities, practicing Responsible AI . For more information about Kiro, see Agentic AI development from prototype to production and Generative AI Lens – AWS Well-Architected Framework


AWS has significantly more services, and more features within those services, than any other cloud provider, making it faster, easier, and more cost effective to move your existing applications to the cloud and build nearly anything you can imagine. Give your Microsoft applications the infrastructure they need to drive the business outcomes you want. Visit our .NET on AWS and AWS Database blogs for additional guidance and options for your Microsoft workloads. Contact us to start your migration and modernization journey today.


Vikas Babu Gali

Vikas Babu Gali

Vikas Babu Gali is a Senior Specialist Solutions Architect, focusing on Microsoft Workloads at Amazon Web Services. Vikas provides architectural guidance and technical assistance to customers across different industry verticals accelerating their cloud adoption.

Piyush Mattoo

Piyush Mattoo

Piyush Mattoo is a Solution Architect for enterprises at Amazon Web Services. He is a software technology leader with over 15 years of experience building scalable and distributed software systems that require a combination of broad T-shaped skills across multiple technologies. He has an educational background in Computer Science with a Masters degree in Computer and Information Science from University of Massachusetts. He is based out of Southern California and current interests include outdoor camping and nature walks.

Sudhir Amin

Sudhir Amin

Sudhir Amin is a Sr. Solutions Architect at Amazon Web Services. In his role based out of New York, he provides architectural guidance and technical assistance to enterprise customers across different industry verticals, accelerating their cloud adoption. He is a big fan of snooker, combat sports such as boxing and UFC, and loves traveling to countries with rich wildlife reserves where he gets to see world's most majestic animals up close.