Skip to main content

普通话水平测试报名查询工具

Project description

PSC MCP 服务器

License Python Version PyPI

基于 FastMCP 框架开发的普通话水平测试(PSC)考试报名查询系统,提供全国各省份测试站点的报名信息查询服务。

目录

功能特性

  • 🌍 省份列表获取 - 获取支持的所有省份列表
  • 📅 报名信息查询 - 实时查询各省份开放报名的测试站点
  • ⏱️ 即将开考查询 - 查看即将举行考试的测试站点信息
  • 🚀 高性能架构 - 基于 FastMCP 框架,提供高效的 API 服务
  • 🐳 容器化部署 - 支持 Docker 快速部署

安装

作为包安装

pip install pscmcp

开发环境安装

推荐使用 uv 管理依赖:

uv sync

或者使用 pip 安装依赖:

pip install -r requirements.txt

作为包使用

安装后,您可以直接在 Python 代码中使用该包:

from pscmcp import get_provinces, get_open_stations, get_next_stations

# 获取省份列表
provinces = get_provinces()
print(provinces)

# 获取宁夏开放报名的测试站点
ningxia_stations = get_open_stations("ningxia")
print(ningxia_stations)

# 获取宁夏即将开考的测试站点
next_stations = get_next_stations("ningxia")
print(next_stations)

作为MCP服务运行

默认方式(stdio)

默认情况下,服务以 stdio 方式运行,适合与支持 MCP 协议的客户端集成:

pscmcp

HTTP 服务模式

支持多种 HTTP 传输方式:

标准 HTTP 模式

pscmcp --transport http --host 127.0.0.1 --port 8000 --path /mcp

SSE 模式(Server-Sent Events):

pscmcp --transport sse --host 127.0.0.1 --port 8000 --path /mcp

Streamable HTTP 模式

pscmcp --transport streamable-http --port 8000

服务器将在 http://localhost:8000/mcp 启动。

开发环境安装

推荐使用 uv 管理依赖:

uv sync

或者使用 pip 安装依赖:

pip install -r requirements.txt

Docker 部署

构建 Docker 镜像:

docker build -t pscmcp .

运行容器:

docker run -p 8000:8000 pscmcp

API 接口

方法 路径 描述
GET /provinces 获取省份列表
GET /open-stations/{province_id} 获取指定省份开放报名的测试站点
GET /next-stations/{province_id} 获取指定省份即将开考的测试站点

示例请求

  1. 获取省份列表:

    curl http://localhost:8000/provinces
    
  2. 查询宁夏开放报名的测试站点:

    curl http://localhost:8000/open-stations/ningxia
    
  3. 查询宁夏即将开考的测试站点:

    curl http://localhost:8000/next-stations/ningxia
    

项目结构

pscmcp/
├── src/
│   ├── __init__.py
│   ├── __main__.py
│   └── psc.py              # 主应用文件
├── Dockerfile              # Docker 配置文件
├── pyproject.toml          # 项目配置和依赖声明
├── README.md               # 项目说明文档
└── LICENSE                 # 许可证文件

许可证

本项目采用 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

pscmcp-0.2.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

pscmcp-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pscmcp-0.2.0.tar.gz.

File metadata

  • Download URL: pscmcp-0.2.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pscmcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b18bc0f65e9c3c8ea8d940794ce722c9955db264a1c5158298972c54c56af845
MD5 ba67778380238c3e1782a91c9ba102b9
BLAKE2b-256 c73ce7b09fc523d0913b472cdbaa502394898e021df920778ca5e312e0c8a2b5

See more details on using hashes here.

File details

Details for the file pscmcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pscmcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pscmcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08cf8170a9e10c3489a466b97a90fc2a8a0c6181f5d6bbcee3a354d50e10465d
MD5 2c3c0b6b93ab1ab1518158de1a4c0fd6
BLAKE2b-256 cc6b097b11264c1251747154b38f10ffe4157a2122b9c348fc9c16acfc8cd73c

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