laszlopere/mcp-bytesmith

GitHub: laszlopere/mcp-bytesmith

一个纯 Python 实现的 MCP 服务器,为 AI 客户端提供本地字节处理、编码转换、哈希计算及 Ethereum 链上原语等实用工具集。

Stars: 0 | Forks: 0

# mcp-bytesmith [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/f5ac120459100933.svg)](https://github.com/laszlopere/mcp-bytesmith/actions/workflows/ci.yml) [![PyPI](https://img.shields.io/pypi/v/mcp-bytesmith.svg)](https://pypi.org/project/mcp-bytesmith/) [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/) [![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE) [![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-db61a2.svg)](https://github.com/sponsors/laszlopere) [![mcp-bytesmith MCP server](https://glama.ai/mcp/servers/laszlopere/mcp-bytesmith/badges/score.svg)](https://glama.ai/mcp/servers/laszlopere/mcp-bytesmith) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/) [![Last commit](https://img.shields.io/github/last-commit/laszlopere/mcp-bytesmith.svg)](https://github.com/laszlopere/mcp-bytesmith/commits) 一个纯 Python 的 [Model Context Protocol](https://modelcontextprotocol.io) 服务器, 基于官方 MCP SDK (FastMCP) 构建,提供了一组用于字节处理的实用工具——包括编码、哈希、数值计算以及 Ethereum 原语——所有计算均在本地真实执行,不进行任何网络调用或使用远程 API。 分发名称:`mcp-bytesmith` · 导入包名:`mcp_bytesmith`。 ## 工具 mcp-bytesmith 提供了一个始终启用的**核心工具集**,完全基于 Python 标准库构建,因此开箱即用,无需任何额外依赖。这涵盖了日常的基础原语:`encode` 和 `decode` 用于在多种方案之间转换数据(hex、Base64/Base32 系列、Base58/Base58check、Base45 等),`hash` 用于计算加密、CRC 和快速非加密摘要,`hash_file` 用于对磁盘上的文件进行校验和计算,并根据预期的摘要进行软验证,`hmac` 用于计算和验证基于密钥的哈希认证标签,`num_convert` 用于在不同进制之间转换整数。核心工具集还包括 `bytes_edit`(用于字节的填充/修剪/切片/拼接)、`data_uri`(构建和解析 `data:` URI)、用于文本和字符集处理的 `unicode_normalize` 和 `charset_transcode`、用于 JSON/JS/Python/C 转义的 `string_escape`/`string_unescape`、用于按标量进行 Unicode 检查的 `codepoints`,以及用于生成由 CSPRNG 支持的随机字节、token 和密码短语的 `random`。 一个可选的 **Ethereum/EVM 工具集**(通过 `ethereum` 扩展启用)增加了在处理链上数据时常用的原语:用于 keccak-256、EIP-191 和 EIP-712 类型化数据哈希的 `eth_hash`,用于 ABI 和 RLP 编码/解码的 `abi_codec` 和 `rlp_codec`,用于函数和事件选择器的 `eth_selector`,用于交易的 `eth_tx_codec`,用于存储布局的 `eth_storage_slot`,用于 EIP-55 校验和的 `eth_address_case`,以及用于 EIP-137 ENS namehash/labelhash 的 `ens_namehash`。一个始终可用的 `info` 工具会报告当前处于活动状态的工具集以及版本信息。 一个可选的**序列化工具集**(通过 `serialize` 扩展启用)增加了 `serialize_codec`,这是一个用于跨 CBOR、MessagePack 和 bencode 编码及解码无 schema 结构化数据的单一工具,并且可以解码原始的 protobuf wire 格式(protobuf 仅支持解码——在没有 `.proto` schema 的情况下,它会显示字段编号、wire type 和值,而不是字段名)。 更多工具集(加密、ID、验证)已列入路线图——参见 [`TODO`](./TODO)。 ## 开发 ``` uv sync # create venv + install (incl. dev extras) uv run mcp-bytesmith # start the server over stdio uv run pytest # run the test suite ``` ## 许可证 GPLv3 — 详见 [`LICENSE`](./LICENSE)。 内置的密码短语词表 ([`src/mcp_bytesmith/wordlists/eff_large.txt`](./src/mcp_bytesmith/wordlists/eff_large.txt), 由 `random` 工具的 `passphrase` 类型使用)是 [Electronic Frontier Foundation](https://www.eff.org/dice) 提供的 EFF “large”词表,采用 [CC BY 3.0 US](https://creativecommons.org/licenses/by/3.0/us/) 许可。
标签:MCP, Python, SOC Prime, 以太坊, 加密原语, 哈希计算, 安全规则引擎, 开发工具, 数据编码, 无后门, 逆向工具