Skip to main content

一个基于FastMCP的验证码生成工具

Project description

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

许可证

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_verification_code-0.1.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_verification_code-0.1.1-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_verification_code-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_verification_code-0.1.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for mcp_verification_code-0.1.1.tar.gz
Algorithm Hash digest
SHA256 281a076bfbf1f2502c18e7262242594bef318ab5bac2292af60a99787c68aaf0
MD5 05bf270b98826c800ee662251480c5c6
BLAKE2b-256 84e8cc2ad37c88c2b67b1fedee690ac4c5a73e7602e714aa3e15ae5144b7629b

See more details on using hashes here.

File details

Details for the file mcp_verification_code-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_verification_code-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac9490a8568e0d8abb6cdc4ef67c77092ad3566836bd8a1eccb036df2e7b5243
MD5 b2b1214c5e8f976a5ac3eaac41fb5cfe
BLAKE2b-256 10672bce8313c9c4799a4ddbc11153b26b36e4f47999bd35f66803fba7162f25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page