A few lines of code to make any existing website agent-friendly.
This package provides the official CLI scaffolding tool for Endpoint Context Protocol. It allows you to implement ECP in your project in seconds, without installing heavy runtime dependencies into your production bundle.
Right now, when an AI agent (like Claude, ChatGPT, Cursor, or an automated script) visits your website, it receives a wall of HTML, CSS, and JavaScript noise. The agent has to guess your site's structure, wasting tokens and scraping fragile layouts.
In 1999, HTTP content negotiation infrastructure became standard, however for years with the onslaught of SPAs and specialty frameworks, it fell into the shadows. It's simple request routing; Browsers identify themselves by requesting text/html. Agents, through the baked-in tools most harnesses provide (built on fetch, cURL, etc), do not.
ECP is a simple method for acting on this distinction. It intercepts requests at the network edge:
- Browsers get your existing site, completely unchanged.
- Agents get clean, structured Markdown built specifically for them.
Humans get the visual web. Agents get the semantic web. Same URL, same authority, negotiated at runtime.
- Give agents everything they need, nothing they don't: When agents read your raw HTML, they get confused by navigation links and footers and other syntax in the way. ECP lets you hand them a deterministic, structured map of your site's capabilities.
- Zero New Infrastructure: No subdomains required. No special agent training required. It uses the URL you already have. One canonical destination. No intermediaries. You control the content agents see from your own site.
- Coexists with MCP: The Model Context Protocol (MCP) is for tool actions. ECP is for world navigation and discovery. ECP makes your main URL legible before an agent even knows your tools exist. You can provide your MCP server data inside your AgentWelcome.md, making the only address you need your own root URL.
At the heart of the protocol is the ecp.json configuration file. This universal manifesto lives in the root of your repository. It explicitly maps how AI traffic should be routed, allowing modern frameworks, AI scrapers, and automated builders to understand your site natively.
{
"$schema": "https://endpointcontextprotocol.io/schema/v1.json",
"version": "1.0",
"instructions": [
"- Welcome to Endpoint Context Protocol (ECP).",
"- This file tells AI agents where to find your site's Markdown context.",
"- Routes explicitly map a URL path to a Markdown file or external URL.",
"- Because ECP is strictly opt-in, unlisted routes are automatically safe."
],
"routes": {
"/": "https://your-domain.com/AgentWelcome.md"
}
}This tool does not install extra runtime dependencies into your package.json. It acts purely as a protocol scaffolder.
When you run the CLI, it analyzes your tech stack and generates a stack-specific handoff for your coding assistant. Your assistant then adds the native request-handling code for that environment, such as Next.js Middleware, Cloudflare Pages _worker.js, Vercel Routing Middleware, or Netlify Edge Functions. The generated guide tells the assistant to preserve normal browser behavior and fail open if AgentWelcome.md is unavailable.
Run the CLI in the root directory of your project:
npx endpointcontext- Auto-Detection: The CLI scans your project to detect your hosting platform or framework (Next.js, Vercel, Cloudflare, Netlify, Firebase, Apache/cPanel, or static/proxy).
- Confirmation: You confirm the detected architecture or override it.
- Artifact Generation: The CLI drops two files into your workspace:
ecp.json: The protocol manifest that maps your public route to AgentWelcome.md for providers, frameworks, AI scrapers, and automated builders.ECP_Install_Guide.md: A platform-specific implementation handoff for your coding agent.
- AI Handoff: Copy the contents of the guide and paste it into Cursor, Copilot, Claude, Codex, etc. The AI will implement the correct routing logic.
For use in automated workflows, boilerplate generators, or CI pipelines, you can bypass the interactive prompts by providing arguments directly:
npx endpointcontext@latest --domain example.com --agent-url https://example.com/AgentWelcome.mdTo learn more about the protocol, view the exact routing specifications, or see reference architectures for all major frameworks, visit the official site: endpointcontextprotocol.io