Automating CLI/Bash Scripts for MCP and other settings with an LLM

In this article, we discuss ground-level automation for Bash scripts required when adding an MCP server and likes to the directory structure.

Right now, we have to get the app code from GitHub, run npm, and adjust the directory path to update the mcp.json and rules.json files.

A better way of getting this done should be in natural language processing.

Why not give the following natural-language command to the AI and let it install and set up the MCP for you?

“Generate automated CLI commands and execute to install the MCP server for the given app on the server named “xyz”, and automatically append the mcp.json and add the following rules provided in natural language to the rules.json file.”

Here is what I got from AI:

Why Bash, why not natural language commands? Coding has been automated; why not bash commands automation?

Yes, we need to talk to the operating system for Bash commands, but why not a wrapper for it? We are about to get AGI, and we are still using Bash? Make a wrapper app for Bash that takes natural language as input and converts it to Bash to talk to the operating system.

It should be as simple as telling AI prompt in natural language that we want these rules to be added to the rules.json file and updating the mcp.json file. Why can’t AI read the rules from natural language text files and convert them to a JSON file? It’s a simple file parsing taught to students in coding labs.

Why should a user who wants to use AI have to edit files, change directories, and run Bash commands?

Why?

Why not, in simple human language, tell it to add the following rules to rules.json? Why, even to tell the name rules.json, intelligent AI must know the steps, and must get the rules from the user in natural language and then append it on its own in the rules.json file.

This may require automating Bash commands and giving permission to execute them.

Rules can be given in natural language as simply as texting them; let AI figure out what we need and talk back to us. Tell AI to ask user to upload rules.txt and requirement.txt files on prompt.

What will that lead to? A simple use case.

What would that need? See below; these are instructions we have to execute right now.

This is not tough, but when we have automation of this level, why to write Bash scripts either? Why not a natural language command and a yes for permissions? See below for Claude MCP server setup.

Why not tell it as a command: Set up my app on the MCP server; here are the rules.

Why these command lines, why not natural language texts, as below?

How to automate Bash code: we need a wrapper app, or we need to train AI models on Bash code, with, say, synthetic data, telling AI how to do a change directory, how to edit a file, and append a data structure in rules.json, given the AI has figured out the JSON format for rules.json. The training data may not be available; we may need synthetic data and reinforcement learning to guide the LLM toward it. Bash code training may also require knowledge of directory structures, so we may need synthetic data for it.

Let’s move towards automation of bash commands; if AIs are that intelligent, then they should be able to figure out what the rules and what bash commands are in a natural language prompt.

Yes, security is an issue, but hackers can run bash commands too, so why not ask a wrapper of bash commands that takes natural language instructions to ask for permissions then?

Thank you for reading.

Subscribe for updates.

Published by Nidhika

In the Futuristic with AI and Tech blog, Nidhika Yadav covers topics of and related to Future of World with Artificial Intelligence. She primarily talks about AI applications for good. She also talks about how AI can become harmful. She manages two independent blogs here, and one is hobby blog you can subscribe one or all of them. 1. Blog on Artificial Intelligence and future. https://nidhikayadav.org 2. In Blog on Global Issues and future, she covers important international issues and their future implications. https://nidhikayadav.com/ 3. Blog on cooking. This is a hobby blog. Here she describes some delicious innovations and nutritious food. https://nidhikasrecipes.com/ Do subscribe to one or all of them.

Leave a comment