home / mcp / char-index mcp server

Char-index MCP Server

A Model Context Protocol server for character-level index-based string manipulation

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "agent-hanju-char-index-mcp": {
      "command": "uvx",
      "args": [
        "char-index-mcp"
      ]
    }
  }
}

You have an MCP server that provides character-level, index-based string manipulation tools. It helps you perform precise edits, extractions, and analyses at exact character positions, which is especially useful when coordinating with test code generation or validation tasks that require strict length and position handling.

How to use

You interact with the Char-Index MCP Server through an MCP client or a runtime command provided in your environment. Start the server using one of the available runtime options, then send requests for exact character positioning, insertion, deletion, replacement, and extraction at specified indices. You can combine multiple tools in sequences to build precise text processing pipelines, which is ideal for testing and validating code or data that relies on strict character counts.

How to install

# Option 1: Using uvx (Recommended)
# Test it works
uvx char-index-mcp --help
# Option 2: From PyPI
pip install char-index-mcp
# Option 3: From Source
git clone https://github.com/agent-hanju/char-index-mcp.git
cd char-index-mcp
pip install -e .

Configuration and quickstart snippets

{
  "mcpServers": {
    "char-index": {
      "command": "uvx",
      "args": ["char-index-mcp"]
    }
  }
}
{
  "mcpServers": {
    "char-index": {
      "command": "char-index-mcp"
    }
  }
}

Additional configuration methods

If you prefer configuring via environment or a launcher, you can add the server in other contexts as well. For example, you can configure a launcher profile to run the same runtime command with uvx or directly call the Python entry point after installation, depending on how you manage processes in your environment.

Available tools

find_nth_char

Find the nth occurrence of a character within a string, returning its position.

find_all_char_indices

Return a list of all indices where a given character occurs in the string.

find_nth_substring

Find the position of the nth occurrence of a substring.

find_all_substring_indices

List all start indices where a substring appears in the string.

split_at_indices

Split a string at specified character indices and return the resulting segments.

insert_at_index

Insert text at a specific position in a string.

delete_range

Delete a range of characters defined by start and end indices.

replace_range

Replace a substring defined by a range with new text.

find_regex_matches

Find all regex pattern matches with their start and end positions.

extract_between_markers

Extract text between two markers, optionally by occurrence.

count_chars

Compute character statistics such as total characters, letters, digits, and more.

extract_substrings

Extract one or more substrings based on provided start/end ranges in a batch.

Char-index MCP Server - agent-hanju/char-index-mcp