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