Ctx

io.github.vanshulgoyal101Published by GitHub account vanshulgoyal101v1.0.0Updated Oct 24, 2026

Turn a GitHub repo or docs site into agent-ready context: pack it or search it, over MCP.

VerifiedStreamable HTTPWeb executableWeb Search & ScrapingKnowledge & MemoryDeveloper Tools

Overview

AI-generated overview

Remote MCP server that turns a GitHub repository or documentation site into token-counted context an assistant can pack or search.

What you can do
  • Pack a GitHub repository into one context blob with per-file headers and a token estimate, filtered by include/exclude globs and a token budget
  • Search a repository and get back only matching passages with file path, line number and relevance score
  • List the text files a repository would contribute, with byte sizes, and read any single file by path
  • Crawl a documentation site from a start URL into one Markdown context blob, bounded by depth and page count
  • Search a documentation site and return only matching passages with page URL, line and score
When to use it
Useful when an assistant needs to understand or answer questions about a public GitHub repository or a documentation site without pasting whole files. The search tools suit targeted questions such as where a feature is handled, while the pack tools suit broad orientation within a token budget.
Requirements
Nothing to install: a remote streamable HTTP endpoint, added by URL in the MCP client config. Stdio-only clients need npx mcp-remote as a bridge. No account or key is required for public repositories; the operator can optionally set a GITHUB_TOKEN Worker secret to raise GitHub rate limits and read private repositories.
Before you install
The docs tools fetch caller-supplied URLs, so the assistant can make the server crawl arbitrary public web pages, though redirects are re-validated against an SSRF guard. Repository and page content is returned to the assistant as context, so untrusted text from those sources reaches the model. Requests are rate limited per IP and downloads are capped. No code is stored and no LLM is involved.

Installation

In SourceWeft

  1. Open Ctx in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.vanshulgoyal101%2Fctx/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "ctx": {
      "type": "http",
      "url": "https://ctx.vanshul.com/mcp"
    }
  }
}

README

ctx.vanshul.com

[MCP Registry] [Endpoint] [License: MIT]

A public Model Context Protocol (MCP) server, running as a Cloudflare Worker, that turns a GitHub repository or a documentation site into agent-ready context. Point an AI agent at it and it can pack a whole repo (or crawl a docs site) into one token-counted blob — or search it and get back only the relevant passages, each with its file/URL and line.

It's the agent-first companion to mcp/: where mcp reads a single web page, ctx reads whole repos and doc sites. The repo pipeline fetches, gunzips and parses the tarball in-process; docs extraction reuses Mozilla Readability + Turndown.

Endpoint

POST https://ctx.vanshul.com/mcp     # JSON-RPC 2.0 (MCP)GET  https://ctx.vanshul.com/health  # { ok: true, tools: [...] }

Tools

ToolInputReturns
pack_repo{ repo, ref?, include?, exclude?, max_tokens? }The repo as one context blob with ==== path ==== headers + token estimate
search_context{ repo, query, ref?, include?, exclude?, max_matches?, context_chars? }Only the passages matching query, each with file, line and score
list_files{ repo, ref?, include?, exclude? }JSON: the text files ctx would include, with byte sizes
get_file{ repo, path, ref? }The full text of a single file
pack_docs{ url, depth?, max_pages?, max_tokens? }A crawled docs site as one context blob (each page → Markdown)
search_docs{ url, query, depth?, max_pages?, max_matches?, context_chars? }Only the docs passages matching query, each with page URL, line and score

repo is owner/repo, owner/repo/ref, or a github.com URL. url (for the docs tools) is an absolute http(s) docs page to start crawling from.

Connect from an MCP client

json
{ "mcpServers": { "ctx": { "url": "https://ctx.vanshul.com/mcp" } } }

Stdio-only clients bridge with npx mcp-remote https://ctx.vanshul.com/mcp.

Add it to your client

  • Cursor — Settings → MCP → Add new server, or drop this into ~/.cursor/mcp.json:
    json
    { "mcpServers": { "ctx": { "url": "https://ctx.vanshul.com/mcp" } } }
  • Claude Desktop — add the same block to claude_desktop_config.json (Settings → Developer → Edit Config). If your version is stdio-only, use:
    json
    { "mcpServers": { "ctx": { "command": "npx", "args": ["mcp-remote", "https://ctx.vanshul.com/mcp"] } } }
  • Continue / VS Code — add ctx with URL https://ctx.vanshul.com/mcp to your MCP servers config.

Try it with curl

sh
# Pack a repo, capped to 8000 tokenscurl -s https://ctx.vanshul.com/mcp -H 'content-type: application/json' \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",       "params":{"name":"pack_repo","arguments":{"repo":"sindresorhus/slugify","max_tokens":8000}}}'
# Search a repo for just the relevant passagescurl -s https://ctx.vanshul.com/mcp -H 'content-type: application/json' \  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call",       "params":{"name":"search_context","arguments":{"repo":"sindresorhus/slugify","query":"replace separator"}}}'

Layout

ctx/├── src/│   ├── worker.ts     # entry: routes /mcp, /health, rate limit, CORS│   ├── mcp.ts        # JSON-RPC dispatch + the six tool definitions│   ├── github.ts     # fetch tarball, gunzip, parse tar, filter files (no deps)│   ├── pack.ts       # assemble the context blob + token estimate│   ├── search.ts     # ranked passage search over files (file + line)│   ├── docs.ts       # crawl a docs site into pages (BFS, same-section)│   ├── extract.ts    # HTML -> Markdown / links (Readability + Turndown)│   ├── fetcher.ts    # bounded fetch with re-validated redirects (SSRF)│   └── security.ts   # SSRF guard (block private/internal addresses)├── public/│   ├── index.html    # landing page (served for non-API paths)│   ├── og.png / og.svg│   ├── robots.txt│   └── sitemap.xml├── tests/            # vitest: github (tar parsing), pack, search, mcp, worker├── docs/             # architecture, tools/API reference, deployment├── wrangler.toml├── package.json└── tsconfig.json

Develop & deploy

sh
cd ctxnpm installnpm run typechecknpm test           # vitest — full suitenpm run dev        # local worker at http://localhost:8787  (POST /mcp)npm run deploy     # wrangler deploy

How it works

owner/repo → github.com tarball → DecompressionStream('gzip')           → in-process tar parse → drop binaries/lockfiles/build dirs           → pack (concat + token estimate) OR search (ranked passages)

The GitHub URL is always constructed from a fixed owner/repo slug, so the repo tools have no SSRF surface. The docs tools fetch caller-supplied URLs, so every URL and redirect hop is re-validated against the SSRF guard. Downloads are bounded (timeout, size caps, page/file-count caps) and results are cached per-isolate for a few minutes.

Security & limits

  • No SSRF: input is a repo slug, not an arbitrary URL; only github.com is fetched.
  • Bounded: 20s download timeout, ~60 MB uncompressed cap, 512 KB/file, ≤3000 files, per-IP rate limit.
  • Stateless & private: no code stored, no LLM in the loop; public repos by default (private with a token).

Authentication (optional)

Set a GITHUB_TOKEN Worker secret to lift GitHub's rate limit (60 → 5,000/hour) and read private repos:

sh
wrangler secret put GITHUB_TOKEN

The token is a Worker secret only — never a tool argument — so it can't leak to an agent.

Documentation

License

MIT © Vanshul Goyal

Source: README.md at commit 5860b7c

Tools

6

pack_repo

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.

Parametersrefreporequiredexcludeincludemax_tokens

search_context

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?").

Parametersrefreporequiredqueryrequiredexcludeincludemax_matchescontext_chars

list_files

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.

Parametersrefreporequiredexcludeinclude

get_file

Return the full text of a single file in a repository, by path. Use after list_files or search_context to drill in.

Parametersrefpathrequiredreporequired

pack_docs

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.

Parametersurlrequireddepthmax_pagesmax_tokens

search_docs

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.

Parametersurlrequireddepthqueryrequiredmax_pagesmax_matchescontext_chars

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts