The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Saagarpatel.dev Portfolio listing page.
The agent-native layer of saagarpatel.dev: a Model Context Protocol server that lets any AI agent query Saagar's writing, projects, public-safe repo profiles, and benchmark results directly, instead of scraping HTML.
Read-only. Stateless. Public. No auth, no tracking, no database, no runtime egress.
The website stays a pure static site. This server is a sibling, not a backend bolted onto it:
portfolio-index repo): the build emits a static machine
corpus — corpus-index.json, per-document corpus/<id>.json, and
.well-known/mcp.json — plus public-safe repo profile artifacts when present,
served alongside the HTML. Already public.src/index.ts): a stateless Cloudflare Worker that bakes
the Layer 0 corpus into its bundle and serves it over MCP (streamable HTTP, the
WebStandardStreamableHTTPServerTransport). Zero runtime fetches.src/stdio.ts): the same server over stdio, for running
locally via npx saagar-portfolio-mcp. Identical tool/resource/prompt surface.The shared core (src/server.ts) is transport-agnostic; both layers wrap it.
All read-only (readOnlyHint: true). No tool takes a URL or filesystem path (no
SSRF / exfil surface).
| Tool | Purpose |
|---|---|
search | BM25 over the whole corpus; optional section filter, limit |
get_document | Full Markdown of one document by id |
list_corpus | The table of contents; optional type filter |
get_profile | The "who is this" card (about / now / uses) |
list_projects | Curated public-safe projects + anonymized aggregates |
list_repo_profiles | Public-safe repo profile index with freshness and proof counts |
get_repo_profile | One repo answering profile by repo_id |
get_operant_results | Public, sanitized OPERANT calibration results (per-model OCS) |
Documents are also exposed as Resources (portfolio://essays/{slug}, book/{slug},
notes/{slug}, portfolio://profile), and there are two Prompts:
introduce_saagar and summarize_writing_on (grounded in a live search).
BM25 over a baked index (no embeddings in v1 — the corpus is ~50 small docs and the calling LLM supplies the semantics). Titles are boosted. Embeddings are a measured Phase 3 upgrade, added only if retrieval quality proves insufficient.
Inspect either transport with the MCP inspector:
Operator-gated (needs Cloudflare auth). v1 still deploys to the default
portfolio-mcp.<account>.workers.dev URL, and npm run probe:mcp uses that stable
Worker URL by default. Public discovery now advertises the verified custom endpoint
https://mcp.saagarpatel.dev/mcp; after any deploy, verify both the Worker and the
website manifest/readback path before changing .well-known/mcp.json.
wrangler.jsonc pins workers_dev: true so the public Worker URL stays live during any
future custom-domain experiments; do not remove it unless the website manifest has already
moved to a verified replacement endpoint.
Once published, anyone can run it locally with npx saagar-portfolio-mcp (no install).
Ed25519-sign .well-known/mcp.json so an agent or registry can verify it authentically
comes from Saagar (via saagar-mcp-kit's signing CLI, Node built-in crypto):
Override paths with --manifest=/--key=/--pub=/--sig=.
Commit the .sig + mcp-ed25519.pub (never the private key) into portfolio-index next to the manifest, then
redeploy the site. Re-run sign whenever the manifest changes (it signs the exact served bytes).
Designed to pass MCPAudit / mcp-trust (Saagar's own tools): only the inbound MCP
transport, no shell_execution / file_access / destructive / exfiltration, and no
caller-controlled egress (the corpus is baked). All tools are annotated read-only with
plain, non-injectable descriptions. bash scripts/audit-mcp.sh runs a connected scan.
Dogfooding this server surfaced a substring-matching false-positive bug in MCPAudit (it
matched port inside portfolio://); that fix lives in the MCPAudit repo and cut this
server's findings 62 → 14. The genuine tool surface scans clean (high_risk_servers: 0).
get_operant_results. typecheck clean; test suite passes (incl. full MCP protocol via the
fetch handler). Live Worker probe and deploy remain operator-gated. Public discovery
advertises mcp.saagarpatel.dev with a valid Ed25519-signed manifest.npm publish, after removing
"private": true by explicit operator approval only), glama.ai registry listing, and
continued signed-manifest readback checks after website manifest changes.