tiktoken-mcp

GenAICPA/tiktoken-mcp

3.2

If you are the rightful owner of tiktoken-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This is a Model Context Protocol (MCP) server for the `tiktoken` library, providing encoding and decoding functionalities as tools for AI assistants.

Tools
2
Resources
0
Prompts
0

Tiktoken MCP Server

This is a Model Context Protocol (MCP) server for the tiktoken library. It exposes tiktoken's encoding and decoding functionality as tools that can be used by AI assistants.

Installation

  1. Install the dependencies:
    pip install -r requirements.txt
    

Usage

To run the server, execute the following command:

python main.py

The server will start and be available for MCP clients to connect to.

Tools

encode

Encodes a string into a list of tokens.

  • Inputs:
    • text (str): The string to encode.
    • encoding_name (str, optional): The name of the encoding to use. Defaults to "cl100k_base".
  • Output:
    • list[int]: A list of tokens.

decode

Decodes a list of tokens into a string.

  • Inputs:
    • tokens (list[int]): The list of tokens to decode.
    • encoding_name (str, optional): The name of the encoding to use. Defaults to "cl100k_base".
  • Output:
    • str: The decoded string.