Skip to main content

Web UI for managing Claude Code env and MCP configs

Project description

Claude Code 账号管理 Web UI(Flask)

一个轻量、便携的本地 Web UI,用于管理 Claude Code 使用账号(baseurl、apikey),并辅助 MCP 配置与版本维护。

功能

  • 环境变量管理:将 baseurl/apikey 写入 ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN
    • 同时写入 launchctl 用户环境(macOS)与生成 ~/.claude-code-envsource 即可生效)
  • MCP 配置编辑:优先项目级 ./.claude/mcp.json,否则用户级 ~/.claude/mcp.json
    • 支持用 ${ANTHROPIC_*} 在 MCP 配置中安全引用敏感信息
  • 版本检测与安装升级:
    • 当前版本优先 claude -v
    • 最新版本来自 npm @anthropic-ai/claude-code(后台定时拉取并缓存)
    • 一键安装/升级 VSCode 扩展或 CLI
  • ccui 一键启动脚本:ccui 会先加载 ~/.claude-code-env,再执行 claude
    • 首页“安装 ccui”会自动写 PATH 到 ~/.zprofile/~/.zshrc 并更新 launchctl PATH

快速开始

  1. 准备 Python 3.9+
  2. 可选:创建虚拟环境
python3 -m venv .venv
source .venv/bin/activate
  1. 安装依赖
pip install -r requirements.txt
  1. 启动服务
python app.py

访问 http://127.0.0.1:5000

使用提示

  • 在页面中新增账号后,点击“设为默认(写入环境变量)”,会生成/更新 ~/.claude-code-env
  • 新开一个终端后,直接执行:
ccui -v
ccui chat
  • MCP 配置编辑入口:页面“编辑 mcp.json”(路径优先级:项目级 → 用户级;亦可通过 CLAUDE_MCP_CONFIG 覆盖)

目录说明

  • app.py:主应用(Flask + SQLite)
  • templates/:前端模板
  • tests/:pytest + Playwright 测试
  • requirements.txt:依赖
  • ~/.claude-code-env:自动生成的环境变量文件
  • ./.claude/mcp.json~/.claude/mcp.json:MCP 配置

测试

pytest -q

包含:

  • 语义版本解析与比较
  • 状态聚合(VSCode 扩展 / CLI)
  • Playwright 功能测试(按钮显隐)

注意

  • accounts.db 仅存储你在页面输入的账号列表,便于切换;敏感值在本机使用,生产环境建议改为加密存储
  • 如需修改监听地址或端口,编辑 app.py 末尾 app.run(host, port) 或设置环境变量 HOST/PORT

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

ccui_web-0.1.2.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

ccui_web-0.1.2-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file ccui_web-0.1.2.tar.gz.

File metadata

  • Download URL: ccui_web-0.1.2.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for ccui_web-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7c2f4e8347f87bcc521a73d6a10c5d000f24076210b00ef07dea94fb7f842459
MD5 08c3eb04a90ae5e7628e5b70bf27abcb
BLAKE2b-256 4db4c2acd055c6e6c9c06ce3f9888ccb39934bb5721e42f9717d4613f338be49

See more details on using hashes here.

File details

Details for the file ccui_web-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ccui_web-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for ccui_web-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9f8c0aace3b1752987398661aba6b6530b620b0a8ba4d46df3ca6b63da6a753d
MD5 b4a197b412bf806213031177649cc9c9
BLAKE2b-256 cc88a47fc0e07bb9e4773ed5fec6eab1a66596cf60c124a05950ec2e3687a13b

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