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.1.tar.gz (17.0 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.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ccui_web-0.1.1.tar.gz
  • Upload date:
  • Size: 17.0 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.1.tar.gz
Algorithm Hash digest
SHA256 d61cab9d83e16b61a29e8b80404660176d456bc08226a208fc08660341d7fc72
MD5 acb4de0aa9b42dad51bd2c926c0011e0
BLAKE2b-256 94932098ee6560c2996c724f64b5f82547c01ed58e1022ff8ddd7d3c06bea75e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ccui_web-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0254efd06db66f915500569d8beb10119bb8a83ee84c93c6f14ac8f51c107c
MD5 7c8017ac3c1e590d09a09480bcdc37aa
BLAKE2b-256 7fe6edeeecc2d70aed30bff5f95e834b6557e6e601cf03c9f84a3903709fdf4b

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