Skip to main content

MCP Server, Typer CLI and vscode tasks in one, provides an easy way to configure your own DevTools and python scripts in a project.

Project description

Toolit

Model Context Protocol (MCP) Server, Typer CLI and Visual Studio Code tasks in one, provides an easy way to configure your own DevTools in a project.

Installation

To get started with Toolit, install the package via pip:

pip install toolit

If you want mcp server support, you can install the optional dependency:

pip install toolit[mcp]

Note: MCP support is not available on python 3.9, since it is not supported by the mcp package.

Usage

Add a folder called devtools to your project root. Create python modules, you decide the name, in this folder. Add the tool decorator to functions you want to expose as commands.

# devtools/my_commands.py
from toolit import tool
@tool
def my_command(to_print: str = "Hello, World!") -> None:
    """This is a command that can be run from the CLI."""
    print(to_print)

Toolit will automatically discover these modules and make them available as commands.

Now you can run your command from the command line:

toolit --help  # To see available commands
toolit my-command --to_print "Hello, Toolit!"  # To run your command

Create the VS code tasks.json file

You can automatically create a tasks.json file for Visual Studio Code to run your ToolIt commands directly from the editor. This is useful for integrating your development tools into your workflow.

To create the .vscode/tasks.json file, run the following command in your terminal:

toolit create-vscode-tasks-json

NOTE: THIS WILL OVERWRITE YOUR EXISTING .vscode/tasks.json FILE IF IT EXISTS!

Chaining Commands

You can chain multiple using the @sequential_group_of_tools and @parallel_group_of_tools decorators to create more complex workflows. Functions decorated with these decorators should always return a list of callable functions.

from toolit import tool, sequential_group_of_tools, parallel_group_of_tools
from typing import Callable

@tool
def first_command() -> None:
    print("First command executed.")

@tool
def second_command() -> None:
    print("Second command executed.")

@sequential_group_of_tools
def my_sequential_commands() -> list[Callable]:
    return [first_command, second_command]

@parallel_group_of_tools
def my_parallel_commands() -> list[Callable]:
    return [first_command, second_command]

This will create a group of commands in the tasks.json file that can be executed sequentially or in parallel.

Creating Plugins

Toolit supports a plugin system that allows you to create and share your own tools as separate packages. This makes it easy to reuse tools across different projects, without needing to copy and update tools across multiple codebases.

To create a plugin, follow these steps:

  1. Create a new Python package for your plugin. You can use tools like setuptools, poetry or uv to set up your package structure.
  2. In your package, create a module where you define your tools using the @tool decorator.
  3. Make sure to include toolit as a dependency in your package's setup.py or pyproject.toml.
  4. Register your plugin with Toolit by adding an entry point in your setup.py or pyproject.toml, so Toolit can discover your tools when the package is installed. The entry point is called toolit_plugins.
  5. Publish your package to PyPI or install it from a git repository where you need it.

Contributing

We welcome contributions to Toolit! If you have ideas for new features, improvements, or bug fixes, please open an issue or submit a pull request on our GitHub repository. We appreciate your feedback and support in making Toolit even better for the community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolit-0.3.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolit-0.3.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file toolit-0.3.0.tar.gz.

File metadata

  • Download URL: toolit-0.3.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for toolit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4441e465fecebee5c9c519ae095c2c74dcc75a331efbba30254de19f975f5052
MD5 02d89926c2b699ff29bfa867bef4010d
BLAKE2b-256 925d46ff3bd97bb84626339f2e72f6852c5a62135178485455278961e81061e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolit-0.3.0.tar.gz:

Publisher: release.yaml on martinmoldrup/toolit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file toolit-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: toolit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for toolit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af8316c6f677bc0ebdb389f524f7b860fb0277128fb94ac58534268d9229c71b
MD5 96b6a67295a9cc5a03ded4ad3c977d38
BLAKE2b-256 538be87310e20f5e87e95807a15e667dac2803708d2956b5471a5c7fea2d2b39

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolit-0.3.0-py3-none-any.whl:

Publisher: release.yaml on martinmoldrup/toolit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page