Introducing MCP Support in AI Shell Preview 6

Wait 5 sec.

AI Shell Preview 6 is here!We are super excited to announce the latest preview release of AI Shell. This release focuses onenhancing the user experience with new features, improved error handling, and better integrationwith Model Context Protocol (MCP) tools.What's new at a glance MCP client integration Built-in tools Resolve-Error command improvements Aliases and flows for staying in your terminalMCP IntegrationAI Shell now acts as an MCP client, which allows you to add any MCP server to your AI Shellexperience. Connecting to an MCP server massively improves the capability of your AI Shell givingyou the tools that provide more relevant data or carry out actions!Adding MCP ServersTo add an MCP server, create an mcp.json file in $HOME\.aish\ folder. The following exampleshows two MCP servers: everything and filesystem. You can add any MCP servers you want.{ "servers": { "everything":{ "type":"stdio", "command":"npx", "args":["-y", "@modelcontextprotocol/server-everything"] }, "filesystem": { "type": "stdio", "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "C:/Users/username/" ] } } }If it's a remote MCP server, change the type to https. You know that you have successfully addedan MCP server when you see it in the AI Shell UI. You can confirm that it's running by checking thestatus of the server through the /mcp command. Using /mcp also lists each MCP Server and thetools available.[alert type="note" heading="NOTE"]You must have Node.js or uv installed to use MCP servers thatuse those command lines tools.[/alert]Standalone experience with AI Shell and MCP ServersMCP servers enhance your standalone experience with AI Shell, allowing your command line to use MCPservers and AI to perform tasks. For example, @simonb97/server-win-cli is an MCP server thatallows you to run commands on your Windows machine, whether it be PowerShell, CMD, Git Bash, or anyconfigured shell you use! It also provides configuration settings to define which commands andoperations are allowed to run.[alert type="caution" heading="CAUTION"]Please note this is a community MCP server and not anofficial Microsoft MCP Server. We encourage you to do your own research and testing before usingit.[/alert]Additional MCP servers: DesktopCommander Other community MCP ServersBuilt-in Tools for AI ShellThis release introduces built-in tools that are now accessible to agents within AI Shell. Thesecommands are similar to MCP Server tools, but are exclusive to the AI Shell experience. These toolsare designed to enhance the AI Shell experience by providing context-aware capabilities andautomation features. They can be used in conjunction with the MCP servers to create a powerfulAI-driven shell environment.Tool NameDescriptionget_working_directoryGet the current working directory of the connected PowerShell session, including the provider name (e.g., FileSystem, Certificate) and the path (e.g., C:\\, cert:\\).get_command_historyGet up to 5 of the most recent commands executed in the connected PowerShell session.get_terminal_contentGet all output currently displayed in the terminal window of the connected PowerShell session.get_environment_variablesGet environment variables and their values from the connected PowerShell session. Values of potentially sensitive variables are redacted.copy_text_to_clipboardCopy the provided text or code to the system clipboard, making it available for pasting elsewhere.post_code_to_terminalInsert code into the prompt of the connected PowerShell session without executing it. The user can review and choose to run it manually by pressing Enter.run_command_in_terminalThis tool allows you to execute shell commands in a persistent PowerShell session, preserving environment variables, working directory, and other context across multiple commands.get_command_outputGet the output of a command previously started with run_command_in_terminal.[alert type="note" heading="Note"]The built-in tools rely on the side-car experience with aconnected PowerShell session and provide enhanced context awareness and automation capabilities.[/alert]Here is a simple demo showing how you can have AI Shell run commands on your behalf using therun_command_in_terminal tool:This example shows how additional context is provided to AI Shell to improve results:You can also use the get_terminal_content tool to get the content from the connected terminal andprovide it to AI Shell to help it understand what you are trying to do:Resolve-Error Command ImprovementsPreviously the Resolve-Error command was only able to run after an error occurred in the previouscommand. Now, Resolve-Error identifies which command the user wants to troubleshoot: If the last error's command matches the most recent command in history, it's assumed to be the onethe user is interested in. If the last error's command isn't the most recent and $LastErrorCode is null or zero, the errorlikely comes from an earlier command, not the very last one. If $LastErrorCode is non-zero and $? is false, the last command was a failing native command. If $LastErrorCode is non-zero but $? is true, it's unclear which command or failure the useris focused on, so the agent analyzes the terminal content to determine the relevant context.This logic allows AI Shell to better understand what the error the user is trying to resolve israther than requiring you to ask for AI's help immediately after an error occurs.Staying in your shellThe Invoke-AIShell and Resolve-Error commands allow you to stay in your working terminal tointeract with the AI Shell agent. To learn more about the parameters added, see theprevious blog post that details these features. For your convenience, these commands havealiases that make them quicker to use.Command NameAliasInvoke-AIShellaskaiResolve-ErrorfixitConclusionWe hope that these enhancements make your experience with AI Shell more powerful! We are alwayslooking for feedback and suggestions, so please submit issues or feature requests in ourGitHub repository.Thank you so much!AI Shell TeamSteven Bucher & Dongbo Wang