|
| 1 | +<!--suppress HtmlDeprecatedAttribute --> |
| 2 | +<div align="center"> |
| 3 | + <h1 align="center"> |
| 4 | + <br> |
| 5 | + <a href="#"><img src="assets/COVER.png" alt="MCPStack Tool" width="100%"></a> |
| 6 | + <br> |
| 7 | + MCPStack Tool Builder |
| 8 | + <br> |
| 9 | + </h1> |
| 10 | + <h4 align="center">A Template To Fasten The Creation of MCP-Stack MCP Tools</h4> |
| 11 | +</div> |
| 12 | + |
| 13 | +<div align="center"> |
| 14 | + |
| 15 | +<a href="https://pre-commit.com/"> |
| 16 | + <img alt="pre-commit" src="https://img.shields.io/badge/pre--commit-enabled-1f6feb?style=for-the-badge&logo=pre-commit"> |
| 17 | +</a> |
| 18 | +<img alt="ruff" src="https://img.shields.io/badge/Ruff-lint%2Fformat-9C27B0?style=for-the-badge&logo=ruff&logoColor=white"> |
| 19 | +<img alt="python" src="https://img.shields.io/badge/Python-3.9%2B-3776AB?style=for-the-badge&logo=python&logoColor=white"> |
| 20 | +<img alt="license" src="https://img.shields.io/badge/License-MIT-success?style=for-the-badge"> |
| 21 | + |
| 22 | +</div> |
| 23 | + |
| 24 | +> [!IMPORTANT] |
| 25 | +> If you have not been across the MCPStack main orchestrator repository, please start |
| 26 | +> there: [View Org](https://github.com/MCP-Pipeline) |
| 27 | +
|
| 28 | +## <a id="about-the-project"></a>💡 About The Project |
| 29 | + |
| 30 | +`MCPStack Tool Builder` is a template repository designed to streamline the creation of `MCPStack` MCP Tools. |
| 31 | +As in, you are using the `MCPStack` main orchestrator repository and wish to create a new MCP tool to pipeline with. |
| 32 | +You can always start from scratch, but certainly, our `MCPStack Tool Builder` will help you get started quickly with a |
| 33 | +solid foundational skeleton builder. |
| 34 | + |
| 35 | +**Wait, what is a Model Context Protocol (MCP) & `MCPStack` — In layman's terms ?** |
| 36 | + |
| 37 | +The Model Context Protocol (MCP) standardises interactions with machine learning (Large Language) models, |
| 38 | +enabling tools and libraries to communicate successfully with a uniform workflow. |
| 39 | + |
| 40 | +On the other hand, `MCPStack` is a framework that implements the protocol, and most importantly, allowing |
| 41 | +developers to create pipelines by stacking MCP tools of interest and launching them all in Claude Desktop. |
| 42 | +This allows the LLM to use all the tools stacked, and of course, if a tool is not of interest, do not include it in the |
| 43 | +pipeline and the LLM won't have access to it. |
| 44 | + |
| 45 | +## Installation |
| 46 | + |
| 47 | +> [!NOTE] |
| 48 | +> As this repository is a template, you can always create a new repository from this template. Use |
| 49 | +> the "Use this template" button on the top right of the GitHub UI to create a new repository based on this template. |
| 50 | +
|
| 51 | +Meanwhile, you may alos clone this repository and install it locally to start building your own `MStack` MCP tool. |
| 52 | + |
| 53 | +### Clone the repository |
| 54 | + |
| 55 | +```bash |
| 56 | +git clone https://github.com/MCP-Pipeline/MCPStack-Tool-Builder.git |
| 57 | +cd MCPStack-Tool-Builder |
| 58 | +``` |
| 59 | + |
| 60 | +### Install dependencies |
| 61 | + |
| 62 | +Using `UV` (recommended —— See official [UV documentation for installation of UV](https://uv.dev/docs/)): |
| 63 | + |
| 64 | +```bash |
| 65 | +uv sync |
| 66 | +``` |
| 67 | + |
| 68 | +Using `pip`: |
| 69 | + |
| 70 | +```bash |
| 71 | +pip install -e .[dev] |
| 72 | +``` |
| 73 | + |
| 74 | +### Install pre-commit hooks |
| 75 | + |
| 76 | +Via `UV`: |
| 77 | + |
| 78 | +```bash |
| 79 | +uv run pre-commit install |
| 80 | +``` |
| 81 | + |
| 82 | +Via `pip`: |
| 83 | + |
| 84 | +```bash |
| 85 | +pre-commit install |
| 86 | +``` |
| 87 | + |
| 88 | +## Create Your Tool's Skeleton |
| 89 | + |
| 90 | +Once dependencies are installed, you can use the `mcpstack_tool` CLI to bootstrap and customise your tool’s skeleton. |
| 91 | +Every commands is run with `uv run mcpstack_tool.py` or `python mcpstack_tool.py` if you are not using `UV`, followed by the command you want to run; as follows: |
| 92 | + |
| 93 | +<img src="assets/readme/help.gif" width="61.8%" align="left" style="border-radius: 10px;"/> |
| 94 | + |
| 95 | +### `Help` Banner |
| 96 | + |
| 97 | +Run with `--help` or `-h` to display the banner and see all available commands. |
| 98 | + |
| 99 | +```bash |
| 100 | +uv run mcpstack_tool.py --help |
| 101 | +``` |
| 102 | + |
| 103 | +<br clear="left"> |
| 104 | + |
| 105 | +<br /> |
| 106 | + |
| 107 | +<img src="assets/readme/init.gif" width="61.8%" align="right" style="border-radius: 10px;"/> |
| 108 | + |
| 109 | +### `Init` |
| 110 | + |
| 111 | +init starts an interactive prompt command-line-based process to generate your tool configuration. |
| 112 | +It will ask you for values like `tool_slug`, `class_name`, and `env_prefix`. |
| 113 | + |
| 114 | + |
| 115 | +<br clear="right"> |
| 116 | + |
| 117 | +<br /> |
| 118 | + |
| 119 | +<img src="assets/readme/preview.gif" width="61.8%" align="left" style="border-radius: 10px;"/> |
| 120 | + |
| 121 | +### `Preview` |
| 122 | + |
| 123 | +preview shows you the replacements that would be applied across the codebase and displays an example diff. |
| 124 | +Note this could be also run from the `init`. |
| 125 | + |
| 126 | +<br clear="left"> |
| 127 | + |
| 128 | +<br /> |
| 129 | + |
| 130 | +<img src="assets/readme/apply.gif" width="61.8%" align="right" style="border-radius: 10px;"/> |
| 131 | + |
| 132 | +### `Apply` |
| 133 | + |
| 134 | +Once happy, use apply to perform replacements and rename the package directory. Note this could be also run from the `init`. |
| 135 | + |
| 136 | +<br clear="right"> |
| 137 | + |
| 138 | +<br /> |
| 139 | + |
| 140 | +<img src="assets/readme/validate.gif" width="61.8%" align="left" style="border-radius: 10px;"/> |
| 141 | + |
| 142 | +### `Validate` |
| 143 | + |
| 144 | +Run validate to ensure placeholders were replaced correctly (or to check if any remain). |
| 145 | + |
| 146 | +<br clear="left"> |
| 147 | + |
| 148 | +<br /> |
| 149 | + |
| 150 | +<img src="assets/readme/reset.gif" width="61.8%" align="right" style="border-radius: 10px;"/> |
| 151 | + |
| 152 | +### `Reset` (Optional) |
| 153 | + |
| 154 | +Need to start fresh? Restore everything back from the scaffold with reset. |
| 155 | + |
| 156 | +> [!CAUTION] |
| 157 | +> ⚠️ Use --hard to overwrite files directly. |
| 158 | +
|
| 159 | +<br clear="right"> |
| 160 | + |
| 161 | +<br /> |
| 162 | + |
| 163 | +<img src="assets/readme/doctor.gif" width="61.8%" align="left" style="border-radius: 10px;"/> |
| 164 | + |
| 165 | +### `Doctor` |
| 166 | + |
| 167 | +Finally, check the health of your repository with doctor. |
| 168 | +It reports `package dirs`, `entry points`, and `placeholder` status. |
| 169 | + |
| 170 | +<br /> |
| 171 | +<br /> |
| 172 | +<br /> |
| 173 | + |
| 174 | +Here you go! 🎉 You now have a working `MCPStack` tool skeleton ready to customise. |
| 175 | +From here, edit `src/mcpstack_<your_tool_name>/tool.py` with the actions your MCP is aimed to be doing, |
| 176 | +and `cli.py` to implement your configurablity logic. Refer to the `MCPStack` documentation for more details on how to implement your tool logic. |
| 177 | + |
| 178 | +## 🔐 License |
| 179 | + |
| 180 | +MIT — see **[LICENSE](LICENSE)**. |
0 commit comments