mcp-current-repo
A proof-of-concept MCP server that scopes GitHub tools to the current repository without filesystem access, using MCP roots to carry the repo identity.
README
mcp-current-repo
Give an MCP server "current-project" focus — so it stops doing the "list every repo and guess" dance — without giving it filesystem access.
The host already knows what project you're in. The protocol can carry that. The server never needs to touch your disk.
A working proof of the path @SamMorrowDrums suggested on github/github-mcp-server#1683:
"I have often considered allowing for a repo-specific version… I think the host application would need to do it with a roots-like MCP protocol support. We don't have local folder access so unlike GH we cannot access files to determine current repo directly."
The problem (#1683 / #1308)
Ask a GitHub-connected agent to "show this project's issues" and it wanders: list_repositories → enumerate every repo → guess the current one → maybe ask you. Slow, scattered, and it burns context the model needs for the actual task.
The fix
current repo HOST (MCP client) SERVER
(derived by the ──▶ puts it in a root ──roots/list──▶ reads the root,
host) (protocol) auto-scopes the tool
— never reads a file
The host has the project context; it passes the repo identity over MCP roots; the server auto-scopes every tool. No exploration phase, no filesystem access on the server.
Before / after (actual output of npm run demo)
BEFORE — plain workspace root, no project context
· no owner/repo in the call → requesting roots/list from the host…
· host returned 1 root(s): workspace
⛔ No project scope available.
A real agent now does the 'search-first-then-locate' dance:
→ list_repositories (enumerate every repo) → guess the current one → maybe ask the user.
AFTER — host carries the current repo via the root name
· no owner/repo in the call → requesting roots/list from the host…
· host returned 1 root(s): faf:repo=github.com/octocat/Hello-World
✅ Scoped to octocat/Hello-World (no fs, no exploration)
No exploration phase. The server read NO files.
The finding worth knowing (a 20-min spike)
The MCP TypeScript SDK currently hard-enforces file:// on root URIs:
// @modelcontextprotocol/sdk — types.js
RootSchema = z.object({
uri: z.string().startsWith('file://'), // "This *must* start with file:// for now."
...
})
So you cannot pass https://github.com/owner/repo as a root URI today — it's rejected. This demo therefore carries the repo identity in the root name. That points at a small, concrete ask for the spec/SDK: relax the roots URI constraint (a typed repo:// / project-context root), so identity doesn't have to ride in a free-text name.
What a server would add (minimal)
- On a tool call without
owner/repo, callroots/list(the SDK already supports this). - Read the project root the host provides.
- Use it as the default scope. Done — no exploration, no fs access.
Where the current repo comes from
The host has to derive the repo somehow. This demo reads a project.faf — a typed, portable context file you own (IANA-registered as application/vnd.faf+yaml) — which already carries the project's identity in one field. It's a clean source because the file is the scope and travels with the repo.
But the mechanism is source-agnostic: derive the repo from .git, an env var, an IDE workspace setting — whatever the host knows. The roots path is the same; project.faf is just one tidy way to feed it.
Run it
npm install
npm run demo
MIT. A stub for discussion, not a fork.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。