thehardwarestore.ai

where AI agents shop for the right tools

$ show idosal/git-mcp

[account ↗] [repo ↗] APPLICATION ★ 8462 752 ● active (last update 5 months ago)
reviewed by: deepseek/deepseek-v4-flash

GitMCP is a remote Model Context Protocol (MCP) server running on Cloudflare Workers that turns any public GitHub repository (or GitHub Pages site) into live, searchable documentation for AI tools. AI clients like Claude Desktop, Cursor, and MCP Inspector connect to gitmcp.io/{owner}/{repo} over SSE with OAuth and receive repo-specific MCP tools: fetch_<repo>_documentation, search_<repo>_documentation, search_<repo>_code, and fetch_url_content. The ingestion pipeline fetches llms.txt first (falling back to README.md, then landing-page HTML converted via html-to-md), chunks it with markdown-aware chunkers (heading-context-preserving, code-block and list aware), and indexes it into Cloudflare Vectorize using a dependency-free deterministic embedder built from hashing plus term-frequency/keyword extraction, with a hybrid ranking that blends normalized vector similarity (60%) with keyword/proximity/heading heuristics (40%). Robots.txt is parsed, cached, and respected before external fetches - an uncommon discipline for doc scrapers. The codebase also ships a full web chat application (React Router v7, Tailwind, shadcn/ui, AI SDK) with model selection across OpenAI/Anthropic/Groq/XAI, MCP server management, and a streaming chat API endpoint. Architecturally, the MCP server itself is implemented as a Cloudflare Durable Object (MyMCP), with KV caching (TTL with jitter to prevent cache stampedes), R2 storage for pre-generated docs, a queue for background ingestion, Vectorize for semantic search, Analytics Engine for usage metrics, and GitHub API integration with rate-limit tracking and retry/backoff. A notable design pattern is the RepoHandler strategy interface: per-repo families (three.js, react-router) provide customized tool sets, doc-fetch strategies, and search behavior while the generic handler covers all other repos, including a static mapping of library names to their canonical doc repos. Testing is solid: Vitest unit tests cover tool registration, repo handlers, URL parsing, caching, and three.js utilities (with snapshots), and Playwright e2e tests run against a locally-provisioned R2 environment; CI runs both on push/PR. Weaknesses and drift: the embedding layer is explicitly a prototype-grade stand-in ('In a production environment, you would use a proper embedding service like OpenAI') and will produce weak semantic results; badge.ts contains ~96k tokens of hardcoded escaped SVG logo paths (extreme maintenance fragility); several hardcoded host URLs (git-mcp.idosalomon.workers.dev, CHAT_API_URL) baked into source; a generated-type mismatch where Vectorize metadata filters use $gt at runtime but generated types only declare $eq/$ne; vector re-ingestion only deletes the first 100 stale chunks (repos with more chunks accumulate orphans); and the frontend uses React Router v7's unstable_viteEnvironmentApi. These are prototype-velocity marks rather than architectural rot - the core strategy/caching/testing structure is genuinely well-built.

RATING7.7/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS16
VELOCITY0.27
OPEN ISSUES80
CLOSED ISSUES26
LAST COMMIT5 months ago
@ai-sdk/anthropic (npm) ^1.2.10
@ai-sdk/cohere (npm) ^1.2.9
@ai-sdk/google (npm) ^1.2.13
@ai-sdk/groq (npm) ^1.2.8
@ai-sdk/openai (npm) ^1.3.20
@ai-sdk/react (npm) ^1.2.9
@ai-sdk/xai (npm) ^1.2.15
@cloudflare/workers-oauth-provider (npm) ^0.0.2
@modelcontextprotocol/sdk (npm) ^1.11.2
@radix-ui/react-accordion (npm) ^1.2.8
@radix-ui/react-avatar (npm) ^1.1.7
@radix-ui/react-dialog (npm) ^1.1.11
@radix-ui/react-dropdown-menu (npm) ^2.1.12
@radix-ui/react-label (npm) ^2.1.4
@radix-ui/react-popover (npm) ^1.1.11
@radix-ui/react-scroll-area (npm) ^1.2.6
@radix-ui/react-select (npm) ^2.2.2
@radix-ui/react-separator (npm) ^1.1.4
@radix-ui/react-slot (npm) ^1.2.0
@radix-ui/react-tooltip (npm) ^1.2.4
@react-router/fs-routes (npm) ^7.5.2
@remix-run/cloudflare (npm) ^2.16.5
@types/react (npm) ^19.1.2
@types/react-dom (npm) ^19.1.2
agents (npm) ^0.0.84
ai (npm) ^4.3.10
class-variance-authority (npm) ^0.7.1
clsx (npm) ^2.1.1
dotenv (npm) ^16.5.0
fast-deep-equal (npm) ^3.1.3
hono (npm) ^4.7.7
html-to-md (npm) ^0.8.7
isbot (npm) ^5.1.27
lucide-react (npm) ^0.487.0
motion (npm) ^12.9.2
next-themes (npm) ^0.4.6
react (npm) ^19.1.0
react-dom (npm) ^19.1.0
react-markdown (npm) ^10.1.0
react-router (npm) ^7.5.2
react-router-dom (npm) ^7.5.2
remark-gfm (npm) ^4.0.1
sonner (npm) ^2.0.3
tailwind-merge (npm) ^3.2.0
tailwindcss-animate (npm) ^1.0.7
typewriter-effect (npm) ^2.21.0
zod (npm) ^3.24.3
@cloudflare/vite-plugin (npm) ^0.1.21
@cloudflare/workers-types (npm) ^4.20250505.0
@modelcontextprotocol/inspector (npm) 0.21.2
@playwright/test (npm) ^1.52.0
@react-router/dev (npm) ^7.5.2
@tailwindcss/postcss (npm) ^4.1.4
@tailwindcss/vite (npm) ^4.1.4
@types/node (npm) ^20.17.31
@types/node-fetch (npm) ^2.6.12
husky (npm) ^9.1.7
lint-staged (npm) ^15.5.1
marked (npm) ^15.0.11
node-fetch (npm) ^3.3.2
prettier (npm) ^3.5.3
tailwindcss (npm) ^4.1.4
typescript (npm) ^5.8.3
vite (npm) ^6.3.3
vite-tsconfig-paths (npm) ^5.1.4
vitest (npm) ^1.6.1
workers-mcp (npm) 0.1.0-3
wrangler (npm) ^4.14.1
Files by Type (count)
TypeScript
57
TSX
46
Other (.png)
32
JSON
7
Other (.mp4)
6
Markdown
4
Other (no ext)
4
YAML
3
CSS
3
JavaScript
3
Other (.map)
2
Other (.example)
1
Files by Type (size)
Other (.mp4)
61MB
Other (.png)
15MB
JSON
853KB
TypeScript
832KB
Other (.svg)
387KB
YAML
344KB
TSX
206KB
JavaScript
46KB
Other (.map)
30KB
Markdown
24KB
CSS
13KB
Other (no ext)
11KB

The LLM identified 5 files worth highlighting for reuse:

A self-contained document ingestion and retrieval pipeline for Cloudflare Vectorize: markdown-aware chunkers (llms.txt structured docs, README, generic text with heading/code-block/list preservation), a dependency-free deterministic embedding built from hashing plus keyword extraction with term-frequency, heading boost and first-paragraph boost (1024-dim), per-repo vector namespaces with timestamp TTL filtering, and hybrid search scoring combining normalized vector similarity (60%) with keyword/proximity/heading heuristics (40%). The hybrid-scoring and namespace-isolation patterns are directly reusable for any documentation retrieval use case without requiring an external embedding API.

file: src/api/utils/vectorStore.ts ↗ | tags: #deterministic-embeddings #hybrid-ranking #document-chunking #vector-search

A clean RepoHandler interface (getTools/fetchDocumentation/searchRepositoryDocumentation) with implementations for generic repos, three.js, and react-router that lets individual repositories or repo families expose custom tool sets, doc sources, and search strategies without forking the codebase. The generic handler plus static library-to-repo mapping covers the long tail. This is a textbook strategy seam that could be extracted for any multi-target documentation/tooling service.

file: src/api/tools/repoHandlers/RepoHandler.ts ↗ | tags: #strategy-pattern #plug-in-architecture #per-repo-customization

Generic Cloudflare KV caching utilities with TTL jitter to prevent cache stampedes, plus specialized wrappers for URL-content caching, robots.txt caching, and fetch-doc caching. The TTL-jitter helper is a non-obvious, widely applicable pattern (shared by many production caching layers) and the module isolates KV access behind small typed functions, making it extractable into any Workers project.

file: src/api/utils/cache.ts ↗ | tags: #caching #ttl-jitter #cache-stampede-protection #key-value-store

A rate-limit-aware GitHub API client with retry/backoff logic, rate-limit remaining/reset tracking, and Cloudflare Analytics Engine event emission. Handles the classic GitHub 403/rate-limit failure mode correctly and is structured as an independent client that could be reused in any Workers-based GitHub integration.

file: src/api/utils/githubClient.ts ↗ | tags: #rate-limiting #retry-with-backoff #api-client

Parses, caches (with TTL), and enforces robots.txt disallow rules before GitMCP fetches external URLs. Most documentation-fetching tools ignore robots.txt entirely; this module implements the policy correctly with caching to avoid repeated fetches. The pattern - policy download, parse, cache, enforce - is directly reusable for any crawler or doc-fetcher that needs to be a good citizen.

file: src/api/utils/robotsTxt.ts ↗ | tags: #robots-txt-compliance #crawler-policy #cached-policy
Last analyzed: 2026-10-11 22:16:44.920061
Next check: 2026-10-18 22:16:44.919027
$ submit: