1.0.0 • Published 9 months ago
mcp-leftpad v1.0.0
mcp-leftpad
An MCP server that exposes a left-pad tool using the Model Context Protocol.
Installation
npm install -g mcp-leftpadUsage
Start the MCP server:
mcp-leftpadThe server exposes the following tool:
left-pad
Pads the start of a string to a specified length with a specified string.
Parameters:
str(string, required): The string to padlength(number, required): The target length of the padded stringpadStr(string, optional, default: ' '): The string to pad with
Example:
{
"name": "left-pad",
"arguments": {
"str": "hello",
"length": 10,
"padStr": "-"
}
}This will return:
{
"content": [
{
"type": "text",
"text": "-----hello"
}
]
}Development
# Clone the repository
git clone https://github.com/yourusername/mcp-leftpad.git
cd mcp-leftpad
# Install dependencies
npm install
# Start the server locally
npm startImplementation
This MCP server is built using the @modelcontextprotocol/sdk library and uses:
- The
McpServerclass for creating a compliant MCP server - The
StdioServerTransportfor communicating over standard input/output - Zod schemas for parameter validation
License
MIT
1.0.0
9 months ago