把一个本地项目作为 token 保护的 MCP 服务暴露给 ChatGPT。
Project description
Project MCP
把一个本地项目作为 token 保护的 MCP 服务暴露给 ChatGPT。
Project MCP 故意保持很小:
- 一个本地项目根目录
- 一个固定项目 token
- 一个 Streamable HTTP MCP 端点:
/mcp - 通过 Cloudflare quick tunnel 暴露公网 HTTPS
- 不做登录、不做托管 relay、不做 ChatGPT 自定义 UI 卡片
快速开始
不安装,直接运行:
uvx project-mcp setup --root .
uvx project-mcp start
或安装成持久 CLI:
uv tool install project-mcp
project-mcp setup --root .
project-mcp start
start 会输出 ChatGPT 需要粘贴的 Server URL,例如:
https://example.trycloudflare.com/mcp?project_mcp_token=pmcp_...
如果保存的本地端口被占用,start 会自动换一个空闲端口继续启动;公网 tunnel URL 不受影响。
在 ChatGPT Developer Mode 里创建 app/connector:
Connection: Server URL
Authentication: None / No Authentication
命令
project-mcp setup --root . --port 8080
project-mcp start --root .
project-mcp start --read-only
project-mcp start --no-bash
project-mcp doctor
project-mcp token rotate
project-mcp settings show
项目配置保存在仓库外:
~/.project-mcp/workspaces/<sha256-realpath>.json
token 按“设备 + 项目根目录”固定保存,直到你显式轮换它。
MCP 工具
Project MCP 暴露:
server_configworkspace_infotreesearchread_filewrite_fileedit_fileshow_changesrun_check
--read-only 会隐藏 write_file 和 edit_file。--no-bash 会隐藏 run_check。
开发
uv sync
uv run ruff check .
uv run pytest
uv build
uv publish
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file project_mcp-0.1.1.tar.gz.
File metadata
- Download URL: project_mcp-0.1.1.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94daec5c51fc96f424736c347f8169b52a558c156545a62ba369325a30b2a07c
|
|
| MD5 |
19e76d7d5125716f850def6e94c4485a
|
|
| BLAKE2b-256 |
13bc79497af04e7d508d0eef0982a5c18813a9a0433f2114ff556f004b329d03
|
File details
Details for the file project_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: project_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95c8a5a7456990d1937215e5e262cdcdc797313a94fd09ea7cf5510fe5c4922f
|
|
| MD5 |
261e056685fce26ac03fbfff0cb1ca2b
|
|
| BLAKE2b-256 |
269f96f781e3fa0ae4ddc7042e4df7d85fdde142f7b7dfa5d9569d942383a5bf
|