MCP 验证码生成工具
项目概述
这是一个基于FastMCP构建的验证码生成工具包,提供多种类型的验证码生成功能,可以轻松集成到各种Python项目中。
功能特性
- 生成纯数字验证码
- 生成纯字母验证码(包含大小写)
- 生成字母和数字混合验证码
- 支持自定义验证码长度
安装方法
从PyPI安装(推荐)
# 使用pip安装(清华源)
pip install mcp-verification-code -i https://pypi.tuna.tsinghua.edu.cn/simple
# 或使用官方源
pip install mcp-verification-code
从源码安装
# 克隆代码库
git clone https://github.com/yourusername/mcp-verification-code.git
cd mcp-verification-code
# 安装依赖
pip install -e .
使用方法
作为MCP服务器
# 启动MCP服务器
from mcp_verification_code.verification_code import run_server
run_server()
直接在代码中使用
# 导入验证码生成函数
from mcp_verification_code import (
generate_numeric_verification_code,
generate_alphabetic_verification_code,
generate_mixed_verification_code
)
# 生成6位数字验证码
num_code = generate_numeric_verification_code()
print(f"数字验证码: {num_code}")
# 生成8位字母验证码
alpha_code = generate_alphabetic_verification_code(length=8)
print(f"字母验证码: {alpha_code}")
# 生成10位混合验证码
mixed_code = generate_mixed_verification_code(length=10)
print(f"混合验证码: {mixed_code}")
开发指南
安装开发依赖
pip install -e ".[dev]"
构建并上传到PyPI
# 使用提供的脚本
python build_and_upload.py
许可证
Metadata
Release files for mcp-verification-code 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_verification_code-0.1.3.tar.gz | 3.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_verification_code-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / mcp_verification_code-0.1.3.tar.gz
| Download URL | mcp_verification_code-0.1.3.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02ecce1b0a3be95faaabbc935839bb25ad33af5cbd83cbe552665056a13f22b5
|
|
BLAKE2b-256 checksum How to use checksums |
5d5b57c7c7bbd63d9238ae61606666fcd6a2d6ce560194eb7d5124295193e695
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.6
|
Release files / mcp_verification_code-0.1.3-py3-none-any.whl
| Download URL | mcp_verification_code-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8da370a03ea6088da932b9f3efcf61167d701daac3f21fa12d9b0e70bf500eaf
|
|
BLAKE2b-256 checksum How to use checksums |
9f3857f80a36163a85f3c089703b848aeca4134a60731737e40b2ea7caad8f7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.6
|
Security for mcp-verification-code 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.