ctx
Turn a GitHub repo or docs site into agent-ready context: pack it or search it, over MCP.
我該用這個嗎
品質與安全性
根據工具定義與協定合規性的自動化分析。
上下文成本
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"ctx": {
"url": "https://ctx.vanshul.com/mcp"
}
}
}遠端端點
https://ctx.vanshul.com/mcpstreamable-http它能做什麼
工具清單
工具(6)
🔴pack_repo(repo, ref, include, exclude, max_tokens)
Fetch a GitHub repository and return it as one agent-ready context blob: text files concatenated with clear "==== path ====" headers, binaries/lockfiles/build dirs stripped, with a token estimate. Use include/exclude globs to focus, and max_tokens to fit a budget.
輸入結構描述
{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "A GitHub repo as \"owner/repo\" or a github.com URL."
},
"ref": {
"type": "string",
"description": "Optional branch, tag or commit SHA (defaults to the default branch)."
},
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional glob patterns (support **, *, ?)."
},
"exclude": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional glob patterns (support **, *, ?)."
},
"max_tokens": {
"type": "number",
"description": "Stop adding files once the estimate exceeds this many tokens."
}
},
"required": [
"repo"
]
}🟢search_context(repo, query, ref, include, exclude, ...)
Search a GitHub repository and return only the passages that match a query — each with its file path, line number and a relevance score. Far more token-efficient than pack_repo when you need a specific detail (e.g. "where is auth handled?").
輸入結構描述
{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "A GitHub repo as \"owner/repo\" or a github.com URL."
},
"query": {
"type": "string",
"description": "Space-separated search terms; matching is case-insensitive."
},
"ref": {
"type": "string",
"description": "Optional branch, tag or commit SHA (defaults to the default branch)."
},
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional glob patterns (support **, *, ?)."
},
"exclude": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional glob patterns (support **, *, ?)."
},
"max_matches": {
"type": "number",
"description": "Max passages to return (1–50, default 5)."
},
"context_chars": {
"type": "number",
"description": "Per-passage character budget (80–4000, default 500)."
}
},
"required": [
"repo",
"query"
]
}🟢list_files(repo, ref, include, exclude)
List the text files ctx would include for a repository (after stripping binaries, lockfiles and build dirs), with their byte sizes. Cheap way for an agent to see the layout before packing.
輸入結構描述
{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "A GitHub repo as \"owner/repo\" or a github.com URL."
},
"ref": {
"type": "string",
"description": "Optional branch, tag or commit SHA (defaults to the default branch)."
},
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional glob patterns (support **, *, ?)."
},
"exclude": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional glob patterns (support **, *, ?)."
}
},
"required": [
"repo"
]
}🟢get_file(repo, path, ref)
Return the full text of a single file in a repository, by path. Use after list_files or search_context to drill in.
輸入結構描述
{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "A GitHub repo as \"owner/repo\" or a github.com URL."
},
"path": {
"type": "string",
"description": "File path within the repo."
},
"ref": {
"type": "string",
"description": "Optional branch, tag or commit SHA (defaults to the default branch)."
}
},
"required": [
"repo",
"path"
]
}⚪pack_docs(url, depth, max_pages, max_tokens)
Crawl a documentation site from a start URL and return it as one agent-ready context blob: each page extracted to clean Markdown, concatenated with its URL. Stays within the same site section; bounded by depth and page count. Use max_tokens to fit a budget.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The absolute http(s) URL to start crawling from (e.g. a docs index)."
},
"depth": {
"type": "number",
"description": "How many link hops to follow (0–3, default 1)."
},
"max_pages": {
"type": "number",
"description": "Max pages to fetch (1–30, default 10)."
},
"max_tokens": {
"type": "number",
"description": "Stop adding pages once the estimate exceeds this many tokens."
}
},
"required": [
"url"
]
}🟢search_docs(url, query, depth, max_pages, max_matches, ...)
Crawl a documentation site and return only the passages that match a query — each with its page URL, line and a relevance score. Token-efficient way to answer a question from docs without packing the whole site.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The absolute http(s) URL to start crawling from."
},
"query": {
"type": "string",
"description": "Space-separated search terms; matching is case-insensitive."
},
"depth": {
"type": "number",
"description": "How many link hops to follow (0–3, default 1)."
},
"max_pages": {
"type": "number",
"description": "Max pages to fetch (1–30, default 10)."
},
"max_matches": {
"type": "number",
"description": "Max passages to return (1–50, default 5)."
},
"context_chars": {
"type": "number",
"description": "Per-passage character budget (80–4000, default 500)."
}
},
"required": [
"url",
"query"
]
}社群
證據