diff --git a/src/docs/src/mcp.md b/src/docs/src/mcp.md new file mode 100644 index 000000000..3ebcb63db --- /dev/null +++ b/src/docs/src/mcp.md @@ -0,0 +1,98 @@ +--- +title: MCP Server +description: Connect your AI tools to Puter with the Puter MCP server, and let them act on your Puter resources on your behalf. +--- + +[MCP (Model Context Protocol)](https://modelcontextprotocol.io) is the standard for connecting LLMs to platforms like Puter. With the Puter MCP server, you can let your AI tools (Claude Code, Codex, or any other MCP-compatible client) interact with your Puter resources on your behalf: managing files, publishing websites, deploying workers, and more. + +## Installation + +The Puter MCP server is hosted at [mcp.puter.com](https://mcp.puter.com). There's nothing to install or run yourself. Just point your AI tool at it and authenticate with your Puter account. + +
+
Claude Code
+
Codex
+
+ +
+ +Run this command in your terminal: + +```bash +claude mcp add --transport http --scope user puter https://mcp.puter.com/ +``` + +Then run `/mcp` inside Claude Code to authenticate with Puter. + +
+ +
+ +Run this command in your terminal: + +```bash +codex mcp add puter --url https://mcp.puter.com/ +``` + +You'll be sent to authenticate with Puter automatically. + +
+ +
Using a different MCP client? Point it at the HTTP endpoint https://mcp.puter.com/. The server uses OAuth, so your client will guide you through signing in to Puter.
+ +## Usage + +Once connected, just ask your LLM to interact with your Puter account in plain language. For example: + +- "List the files in my Puter home directory." +- "Publish the `dist` folder as a website." +- "Deploy this script as a Puter worker and give me the URL." + +Your AI tool picks the right Puter tools to carry out the request, acting as you. + +## Tools + +The Puter MCP server exposes the following tools, grouped by category. Each one mirrors the equivalent [Puter.js](/) SDK call. + +### Filesystem + +- `fs_write_file`: Create or overwrite a file in your Puter filesystem. +- `fs_read_file`: Read a file's contents (UTF-8 text, or base64 for binary). +- `fs_readdir`: List the files and subdirectories in a directory. +- `fs_mkdir`: Create a directory, optionally creating missing parents. +- `fs_stat`: Get metadata (name, size, type, timestamps) for a file or directory. +- `fs_delete`: Delete a file or directory. + +### Hosting + +- `hosting_create`: Publish a static website, served at `.puter.site`. +- `hosting_list`: List the websites you've published. +- `hosting_get`: Get a single published website and the directory it serves. +- `hosting_update`: Re-point a website at a different directory. +- `hosting_delete`: Unpublish a website. + +### Workers + +- `workers_create`: Deploy a serverless [Worker](/Workers/) from a JavaScript file and get its public URL. +- `workers_exec`: Call a deployed worker over HTTP, authenticated as you. +- `workers_list`: List your deployed workers. +- `workers_get`: Get a single worker's public URL and source file. +- `workers_delete`: Undeploy a worker. + +### Apps + +- `apps_create`: Register a launchable Puter app pointing at a URL. +- `apps_check_name`: Check whether an app name is available before creating it. +- `apps_list`: List the apps you own. +- `apps_get`: Get a single app, including its usage stats. +- `apps_update`: Update or rename an existing app. +- `apps_delete`: Unregister an app. + +### Documentation + +- `puter_docs_index`: Load the index of Puter.js documentation to discover available topics. +- `puter_docs_get`: Fetch a specific documentation page as Markdown. + +### Account + +- `whoami`: Get your account info, including username and home directory. diff --git a/src/docs/src/sidebar.js b/src/docs/src/sidebar.js index d2cb43b8e..05239c11d 100755 --- a/src/docs/src/sidebar.js +++ b/src/docs/src/sidebar.js @@ -28,6 +28,11 @@ let sidebar = [ source: '/frameworks.md', path: '/frameworks', }, + { + title: 'MCP Server', + source: '/mcp.md', + path: '/mcp', + }, { title: 'Deployments', source: '/deployments.md',