
Mcp Portal
io.github.apollion69由 GitHub 帳號 apollion69 發布v0.1.0更新於 Oct 24, 2026
Cursor CLI delegation for verified bulk reads and reference-driven code generation.
概覽
一個本機 stdio MCP 伺服器,把受限的檔案讀取與依參考檔案產生程式碼的工作交給 Cursor CLI,使用其獨立配額。
- 可以做什麼
- 讀取指定檔案並只依據這些檔案回答問題,回傳經驗證的引文、缺口與指標(bulk_read)。依規格與參考檔案產生程式碼,可選擇由伺服器寫入目標檔案(code_write)。查看 CLI 路徑、驗證提示、預設模型、策略摘要與快取位置(status)。
- 適用情境
- 適合希望把明確選定檔案的大量讀取或樣板程式碼產生,交由 Cursor 獨立配額處理的主機代理,並藉由雜湊清單與伺服器端引文驗證,避免整檔讀取。
- 執行需求
- 以 uvx(或 pipx/pip)執行的本機程序;需要 Python 3.10+,並安裝且已登入 Cursor CLI(cursor-agent)。選用環境變數 MCP_PORTAL_CLI(CLI 路徑)與 MCP_PORTAL_HOME(快取與證據目錄,預設 ~/.cache/mcp-portal)。Windows 上使用本機 CLI 或 WSL 橋接。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Portal,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-portal
mcp-portal is a stdio Model Context Protocol server that lets a frontier agent (Claude Code, Codex, Cursor, or any MCP host) delegate two jobs to the Cursor CLI on its own quota: bounded bulk_read (read explicitly selected files, answer with verified quotes) and code_write (generate boilerplate from a reference file + spec; the server writes the target file). Python stdlib only—no Node runtime and no MCP SDK dependency.
On 2026-09-08, composer-2.5-fast generated roughly 5× faster than a frontier model on the same brief (line-rate measurement). Cursor quota is separate from the host model's.
Quick start
Also available as pipx install mcp-portal / pip install mcp-portal, and listed in the
MCP Registry as io.github.apollion69/mcp-portal.
To run the development head instead of the release:
Requirements: Python 3.10+, the Cursor CLI (cursor-agent) installed and logged in.
Doctor (CLI inventory, no model call):
Configure per host
Claude Code
Codex (~/.codex/config.toml)
Cursor (~/.cursor/mcp.json)
VS Code (.vscode/mcp.json, servers key)
Generic mcpServers JSON
Environment (optional):
Tools
bulk_read
Returns status, run_id, answer.findings[] (file, start, end, quote, fact), gaps[], metrics, model_decision.
code_write
Returns generated code, optional bytes_written, run_id, metrics.
status
No arguments. Returns CLI path, auth hint, default model, policy summary, cache location, receipt counters.
Model policy
Shipped in model-policy.json (package data). Defaults:
- Prefer Cursor-native models (
composer-2.5, thencursor-grok-*) - Strip
-fastsuffixes (never auto-select fast variants) - Other vendors only when explicitly requested and listed by
cursor-agent --list-models
Override by editing model-policy.json in the installed package or setting policy fields via a custom file at MCP_PORTAL_HOME (future) — today, replace the package file or patch preferred in your fork. Each tool result includes model_decision.reason (default_preferred, fast_suffix_stripped, cursor_native_explicit, explicit_other_vendor, requested_unavailable_fallback).
How it works
- Authorize — Server reads only listed paths; blocks credential-like paths and secret patterns.
- Manifest — Request JSON includes per-file SHA-256 hashes.
- Isolate — Cursor CLI runs with fresh
CURSOR_CONFIG_DIR, deny-all permissions,--mode ask, sandbox enabled. - Verify — Every
quoteinbulk_readanswers must appear verbatim in the cited line range; bad citations are dropped or fail closed. - Evidence — Per-run directory under
MCP_PORTAL_HOME/runs/<run_id>/with manifest (hashes, metrics; not full source). - Budgets — 16 files, 128 KiB combined input, 90s timeout, bounded stdio frames.
Windows
On Windows, the delegate uses a local Cursor CLI run when either:
MCP_PORTAL_CLIpoints at an executable (including test stubs), orcursor-agent/agentis found onPATHand is a real file.
Otherwise it falls back to the wsl.exe bridge into Ubuntu/WSL (python3 -m mcp_portal.delegate --worker). Force either mode with MCP_PORTAL_BACKEND=local or MCP_PORTAL_BACKEND=wsl.
- MCP config can use native
uvx mcp-portalwhen the CLI is on PATH, orwsl.exe+uvx mcp-portalwhen it is not - Helpers in
clients/windows/(delegate.ps1,parse_read.ps1) MCP_PORTAL_WORKERoverrides the default WSL worker commandMCP_PORTAL_WSL_CDsets the WSL working directory (default~)
Optional Claude Code routing hook
Install read gate + skill (generic, transactional):
See docs/skills/cursor-bulk-reader/SKILL.md for agent-facing guidance. The router blocks or warns on large full-file reads (>350 lines or >128 KiB) and points agents at bulk_read.
Repo-level MCP registration helper:
Security
See SECURITY.md. Summary: you choose which files leave the machine; the CLI runs read-only with tools denied; quotes are verified server-side. Not a substitute for secret hygiene.
Related projects
Several Node-based bridges expose Cursor via MCP (different tradeoffs: SDK/Node stack, varying isolation and verification):
- lipey1/cursor-agent-mcp
- andreilungeanu/cursor-delegate-mcp
- sailay1996/cursor-agent-mcp
- ai-nuke/cursor-agent-mcp
- JaimeJunr/cursor-mcp-bridge
mcp-portal focuses on stdlib Python, hash-pinned manifests, quote verification, server-side writes for code_write, model policy, and WSL-first Windows support.
License
MIT — see LICENSE.
來源:README.md,提交 b07466a
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分