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:
- Write and optimize SQL queries based on natural language prompts
- Analyze database schemas and generate documentation or diagrams
- Suggest performance optimizations by accessing execution plans and metrics
- Integrate with AWS services such as Amazon CloudWatch, Amazon Relational Database Service (Amazon RDS) for SQL Server, or Amazon Aurora.
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.
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:
- Create an AWS Account if you don’t already have one.
- Have access to an AWS account through the AWS Management Console and the AWS Command Line Interface (AWS CLI).
- Development environment: Visual Studio through code-server, hosted on an Amazon Elastic Compute Cloud (Amazon EC2) Instance. You can optionally choose to use your preferred generative AI integrated development environment (IDE) such as Cursor, Kiro, or Claude Code.
- Install Kiro CLI on your system.
- Install the uv utility from Astral or the GitHub README.
- Use the uv utility to install Python version 3.10.
uv python install 3.10
- A SQL Server database instance, such as an Amazon RDS for SQL Server instance or SQL Server on Amazon EC2, with SQL Server logs configured to stream to Amazon CloudWatch for monitoring and analysis.
- This solution works with multiple AI models available through Amazon Bedrock. For this blog we are using Anthropic’s models in Amazon Bedrock. For more information, see Add or remove access to Amazon Bedrock foundational models.
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:
- An AWS Identity and Access Management (IAM) user or role that has permissions to make the necessary AWS service calls, such as by Amazon CloudWatch in this example.
- When providing permissions to an IAM user, follow the principle of least privilege.
Configuring MCP Servers
AWS MCP Server to Kiro CLI configuration
- 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
- 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 --versionin your terminal. - Configure MCP server Kiro CLI supports two levels of MCP configuration:
- Global configuration:
~/.kiro/settings/mcp.jsonapplies across all your projects. - Local configuration:
.kiro/settings/mcp.jsonis specific to the current project. - 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.
- 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.
- Use /tools command to view available tools and capabilities as shown in Figure 2.
Figure 2: List of available tools
Solution Overview
Figure 3: Solution Overview
As shown in Figure 3:
- DBA (user) input to Kiro CLI.
- The Kiro CLI (MCP client) sends the natural language prompt to the LLM processing and tool selection.
- The LLM interprets the prompt and selects the appropriate tool from the AWS CloudWatch MCP Server (for example,
execute_log_insights_queryorget_logs_insight_query_results). - 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:
- Schema exploration: List all tables in my SQL Server database.
- Query optimization: Can you provide recommendations to optimize the stored procedure?
- Query generation: Write a query to find the top 10 customers by sales volume from the Orders table.
- One-time reporting queries: Write a query to analyze sales data from last month and project trends for the next six months.
- Security and compliance: What security concerns do you identify in this SQL Server instance?
- Maintenance tasks: Generate a script to rebuild indexes based on fragmentation levels and provide recommendations considering table size and activity patterns.
- Documentation: Create an ER diagram for my SQL Server database.
- Backup and recovery: Check for any failed backup attempts on my server.
- 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:
- Start with clear, specific instructions that precisely state your requirements.
- Provide relevant context about your environment or use case to help generate more accurate solutions.
- Include examples where applicable to illustrate the desired output format or approach.
- Incorporate error handling/guardrails by specifying how to manage potential issues or limitations.
- 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:
- Clear instructions: Show top 10 CPU-intensive queries and format results in a table with columns: QueryID, CPU Time, Execution Count.
- Provide context: Given our production database with 500 GB size and 1,000 concurrent users, identify optimal index maintenance window
- Output formatting: Present findings in bullet points and include SQL scripts in code blocks.
- 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.






