Skip to main content

平行变量 Parallel Variable — Official MCP Server

平行变量(Parallel Variable)— 让世界,回应你的构想。
Let the real world respond to your ideas before you launch.

parallel-variable-mcp 是「平行变量」开放平台官方开源的 Model Context Protocol (MCP) 标准服务端(JSON-RPC 2.0 over stdio,零第三方依赖,仅需 Python 3.10+)。

通过它,你可以在 Cursor、Claude Desktop、Antigravity、魔搭(ModelScope)、扣子(Coze) 等任意支持 MCP 的 AI 客户端中,直接调用真实脱敏城市数字居民样本,在正式发布前对商业定价、门店选址、产品改版、品牌公关或社会公共政策进行低成本高保真前测。


核心特性 / Key Features

  • 零重依赖、开箱即用:100% Python 标准库实现,无笨重 SDK 依赖,启动即用。
  • 黑盒安全边界:仅调用公网 https://api.parallelvariable.com/api/open-platform/v1/* 公开接口;API Key 仅通过环境变量读取,绝不写入磁盘或打印到日志。
  • 防误扣费护栏:pv_run_simulation 在工具描述中强制约束 AI 助手在扣费启动前,先向用户展示样本量、步进周期与预估点数消耗并获得明确确认。
  • 异步不阻塞:启动推演后立即返回 pipeline_id 与排队位置,随时通过 pv_get_simulation_results 拉取进度、去重统计、舆情热搜潜质、分龄切片与脱敏居民真实原话。

典型场景示例 / Use Cases

  1. 商业定价与新店前测:「在朝阳区开一家精品咖啡店,首杯拿铁 19.9 元,抽 100 位 22–40 岁在职女性测 7 天自然到店与真实评价。」
  2. 产品改版与会员提价:「将内容 App 连续包月从 15 元调整至 22 元,对比不同收入与学历人群的续费与吐槽倾向。」
  3. 品牌公关与社会事件推演:「某新能源车企因电池续航缩水引发舆论争议,发布不同回应方案后 14 天内的公众态度与热搜潜质变化。」
  4. 公共政策前测(需政企/科研白名单):「博物馆取消预约制 / 地铁高峰票价微调,分青/中/银发三代人群观察支持率与行动意愿。」

快速安装 / Quick Start

方式一:本地可编辑安装(推荐)

cd integrations/parallel-variable-mcp
pip install -e .

安装后可直接运行命令 parallel-variable-mcp。

方式二:零安装直接以模块运行

PYTHONPATH=integrations/parallel-variable-mcp/src \
PARALLEL_VARIABLE_API_KEY="pv_sk_your_api_key" \
python3 -m parallel_variable_mcp

环境变量 / Environment Variables

变量名 必填 默认值 说明
PARALLEL_VARIABLE_API_KEY 是 无 在 控制台 生成的个人/企业 API Key
PARALLEL_VARIABLE_BASE_URL 否 https://api.parallelvariable.com 开放平台公开 API 基地址

客户端一键配置 / Client Configuration

1. Cursor (~/.cursor/mcp.json 或项目 .cursor/mcp.json)

{
  "mcpServers": {
    "parallel-variable": {
      "command": "parallel-variable-mcp",
      "env": {
        "PARALLEL_VARIABLE_API_KEY": "pv_sk_your_api_key"
      }
    }
  }
}

2. Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "parallel-variable": {
      "command": "python3",
      "args": ["-m", "parallel_variable_mcp"],
      "env": {
        "PARALLEL_VARIABLE_API_KEY": "pv_sk_your_api_key"
      }
    }
  }
}

3. Antigravity / 魔搭(ModelScope)MCP 配置

{
  "mcpServers": {
    "parallel-variable": {
      "command": "parallel-variable-mcp",
      "args": [],
      "env": {
        "PARALLEL_VARIABLE_API_KEY": "pv_sk_your_api_key",
        "PARALLEL_VARIABLE_BASE_URL": "https://api.parallelvariable.com"
      }
    }
  }
}

7 个标准工具清单 / Available MCP Tools

Tool 名称 是否免费 说明
pv_list_regions 免费 查询已开放的数字居民区域列表(如 110105 北京朝阳)
pv_get_targeting_options 免费 查询标准人群定向筛选字典(性别、人群标签、学历、婚姻、收入档位)
pv_get_account_status 免费 查询当前推演点数余额、年度点数包、套餐版本、样本/并发上限与政策白名单状态
pv_clarify_scenario 免费 拆解商业或社会构想,返回推荐步进单位/步数、观测目标、推荐最小年龄与能力边界
pv_estimate_population 免费 实时预估指定地区与筛选条件下覆盖的居民人数及防窄化提示
pv_run_simulation 扣费(需确认) 创建并启动推演流水线,立即返回 pipeline_id 与排队位置(不阻塞超时)
pv_get_simulation_results 免费 随时查询推演进度、去重统计、社会舆情/分龄切片汇总及精选脱敏居民真实原话

安全与开源协议 / Security & License

  • 开源协议:MIT License(见 LICENSE)。
  • 隐私与安全:本仓库仅作为公网 API 的开源黑盒客户端,不包含任何服务端内部逻辑、模型 Prompt 或私有密钥;所有居民反馈均已在平台侧完成三层脱敏,不包含任何真实个人身份信息(PII)。

Metadata

Release files for parallel-variable-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parallel-variable-mcp 0.1.0
File Size Uploaded Provenance Actions
parallel_variable_mcp-0.1.0.tar.gz 21.6 kB Without provenance Details for parallel_variable_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parallel-variable-mcp 0.1.0
File Interpreter ABI Platform Actions
parallel_variable_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for parallel_variable_mcp-0.1.0-py3-none-any.whl

Total release size: 38.0 kB

Release files / parallel_variable_mcp-0.1.0.tar.gz

Download URL parallel_variable_mcp-0.1.0.tar.gz
Size 21.6 kB
Tags Source
SHA-256 checksum
How to use checksums
126c15c188c214e11ea48520436119306a97ed6c83d62a27e393cf67a7fdd954
BLAKE2b-256 checksum
How to use checksums
74bbbf9b64855eafce7459a78648593d5356715b036fce7509f3703ba1c619a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0rc3

Release files / parallel_variable_mcp-0.1.0-py3-none-any.whl

Download URL parallel_variable_mcp-0.1.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1914444da4bfffbbe7b294203fe8f36ad9206806cde62cca227a05348bb4056a
BLAKE2b-256 checksum
How to use checksums
f309941c8d840f3cd58a126087d262e677d80c3ff8af0e948c429ea557081a31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0rc3

Security for parallel-variable-mcp 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page