home / mcp / power assist mcp server

Power Assist MCP Server

Provides access to Power Assist API via MCP using stdio with configurable API key and commands.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bach-ai-tools-bachai-power-assist": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You run a dedicated MCP server named Power Assist MCP Server to access the Power Assist API. It uses a stdio-based transport and can be launched via a lightweight runtime, enabling your applications to call a suite of string, array, and math helpers through a consistent MCP interface.

How to use

You will connect to this MCP server from an MCP client by starting the local stdio service and pointing your client to the provided command and environment. The server authenticates requests using an API key that you set in your environment. Use it in any client integration that needs access to the Power Assist endpoints.

How to install

Prerequisites: you need Python and a runtime to load the MCP server. You also need a compatible shell to run environment variables and the startup command.

Install from PyPI or from source.

From PyPI install the package with pip.

pip install bach-power_assist

From source install in editable mode.

pip install -e .

Run the server using the recommended runtime uvx (no local installation required). Use the provided start command to host bach_power_assist as an MCP service.

uvx --from bach-power_assist bach_power_assist

If you prefer to specify a version, you can target the latest release.

uvx --from bach-power_assist@latest bach_power_assist

Alternative: run in development mode directly with Python (for development purposes only). This starts the server from the source file named server.py.

python server.py

Environment and configuration

API access requires an API key. Set the API key in your environment before starting the server.

export API_KEY="your_api_key_here"

Connecting from MCP clients

Use the stdio-based startup so your MCP client can communicate with the server via standard input/output streams. The runtime command remains the key entry point.

uvx --from bach-power_assist bach_power_assist

Notes on usage

Keep your API key secure and do not expose it in client-side code or public repositories. You can implement key rotation and scoped credentials depending on your security requirements.

Available tools

regex

Validates that a String matches a given RegEx pattern. Include the leading and trailing '/' and optional flags.

median

Calculates the median from an Array of numbers. Strings convertible to numbers are accepted; commas are not supported.

countinstances

Counts the number of occurrences of a substring within a string.

regexreplace

Finds and replaces within a String using a RegEx pattern. Include leading/trailing '/'. Use /g to replace all and /i to ignore case.

every

Returns True if all items in an array satisfy a condition; otherwise False.

words

Splits a string by a delimiter or RegEx pattern; defaults to whitespace.

isarray

Checks whether a value is an Array.

reverse

Reverses the order of an Array.

findfirst

Returns the first item in an array that matches a condition; Null if none.

slugify

Converts text into an ASCII slug suitable for URLs.

trimend

Trims whitespace or specified characters from the end of a string.

replaceall

Replaces all occurrences of a substring in a string; case sensitive; does not support RegEx.

trimstart

Trims whitespace or specified characters from the start of a string.

trim

Trims leading and trailing whitespace or specified characters.

escapehtml

Converts HTML special characters to their entity equivalents.

wordcount

Counts words in a string by a delimiter; defaults to whitespace.

prepend

Adds a value as the first item of an array; if a value is an array, flattens and prepends.

groupby

Groups an Array of items by a specified criterion.

filter

Filters an Array by a condition; supports objects or simple types with the 'this' keyword.

sort

Performs a basic sort on an Array; returns the original empty array if provided.

floor

Rounds a number down; accepts numeric strings but not formatted numbers.

ceil

Rounds a number up; accepts numeric strings but not formatted numbers.

random

Generates a pseudo-random number within a defined range (0 to max).

average

Calculates the mean of an Array of numbers; numeric strings allowed.

mode

Finds the most frequent number in an Array; handles string/number equivalence.

round

Rounds a number to the nearest integer; accepts numeric strings.

objecttoarray

Converts an Object to an Array based on its keys for iteration.

clean_whitespace

Trims and collapses multiple spaces into a single space.

cleandiacritics

Replaces diacritics with ASCII equivalents.

striphtml

Removes all HTML and XML tags from a string.

unescapehtml

Converts HTML entities back to characters.

capitalize

Capitalizes the first letter and lowercases the rest.

chop

Chops a string into an Array based on a defined interval.

isnullorempty

Checks if a value is null or empty for strings, arrays, or objects.

sortbyproperty

Sorts an Array of Objects by a specified property, in ascending or descending order.

isstring

Validates that a value is a String.

isobject

Validates that a value is an Object.

isnumber

Validates that a value is a Number.

removefirst

Removes the first array item that matches a condition.

any

Returns True if any items in an array match a condition.

email

Validates that a String matches a common email format.