Skip to main content

把一个本地项目作为 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 不受影响。 Cloudflare quick tunnel 的 *.trycloudflare.com Host 会被默认允许,其他公网 Host 默认拒绝。

在 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_config
  • workspace_info
  • tree
  • search
  • read_file
  • write_file
  • edit_file
  • show_changes
  • run_check

--read-only 会隐藏 write_fileedit_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

project_mcp-0.1.2.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

project_mcp-0.1.2-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: project_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 14.2 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

Hashes for project_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c36b9771d698fcecd967eb967041758133c08efdf1561ed316e0db24dfe6a078
MD5 d3e59febef265efa2c0bd10195d610c0
BLAKE2b-256 02131fd791c7911e6e31d128987255f93c1b99c68b2ad06668f1d7e901e6ce82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: project_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.2 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

Hashes for project_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 64236840d18f293ea1a83e7f77321238fae411c8e7f62d1ddcc0f5a8821a8a04
MD5 a8088542bf57f7b23a8fc89b7c743c1e
BLAKE2b-256 d101d60cc0470f912e0277439a2445f5004fe129fe813030296c3b6d302783a1

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