Connect AnyCap through MCP
AnyCap’s local MCP server lets Claude Code, Codex, Cursor, and other compatible hosts discover tools for image and video generation, media understanding, and web research. The host launches anycap mcp as a local process and communicates over stdio; media and web requests run through the AnyCap service.
The server runs inside the CLI binary and shares its login and model discovery. Install the CLI first, then configure a host below. The MCP tool reference describes the tool surface and read/write boundaries.
Verify support
Section titled “Verify support”anycap mcp --helpIf the command is missing, run anycap update.
Configure a host
Section titled “Configure a host”Store the machine-specific absolute root in Claude’s local project scope:
claude mcp add --scope local anycap -- anycap mcp --allow-root "$PWD"The Codex CLI command installs a global server definition. Omit a fixed root and let each project session advertise its root or use the server working directory fallback:
codex mcp add anycap -- anycap mcp{ "mcpServers": { "anycap": { "type": "stdio", "command": "anycap", "args": ["mcp", "--allow-root", "/absolute/path/to/media"] } }}Authenticate inside MCP
Section titled “Authenticate inside MCP”MCP startup never opens a browser. Existing CLI login is loaded automatically and credentials are refreshed on every tool call.
- Call
anycap_auth_status. - If unauthenticated, call
anycap_loginand show its verification URL and user code. - After the human completes login, call
anycap_login_pollwith the returned session ID. - Call
anycap_statusto verify the server and account.
Authorize local files
Section titled “Authorize local files”Effective local file access is the union of:
- repeatable
--allow-rootflags - the platform path list in
ANYCAP_MCP_FILE_ROOTS - roots advertised by the MCP client
- the process working directory when no other roots are configured
Canonical checks reject path traversal, sibling-prefix confusion, and symlink escape. Keep roots as narrow as possible. HTTP(S) URLs and existing AnyCap upload references do not require local access.
Explore the tools
Section titled “Explore the tools”After authentication, ask the host to list the available image models with anycap_list_models, then inspect a selected model with anycap_model_schema. This verifies discovery and shows the inputs before you request generation.
For a first task, ask: “Use AnyCap to generate a product image. Check the current image models and the selected model’s schema first.” The host can then use anycap_image_generate. For a local reference image, authorize its directory before asking the host to read or edit it.
See the MCP tool reference for individual tools. Use the CLI reference for operations that the MCP surface does not expose, such as Drive uploads and Page deployments.
Troubleshoot the connection
Section titled “Troubleshoot the connection”| Symptom | What to check |
|---|---|
The host cannot start anycap |
Run anycap --version in a terminal. If that works, use the executable’s absolute path in the host configuration or restart the host after updating PATH. |
mcp is an unknown command |
Run anycap update, then verify anycap mcp --help again. |
| Tools are present but authentication fails | Call anycap_auth_status and complete the login sequence above. A running server does not by itself confirm account access. |
| A local image or video is rejected | Check that its resolved path is inside an authorized root, including where a symlink points. See local file security. |
| A wrapper breaks the stdio connection | Keep stdout reserved for MCP protocol messages. Send wrapper logs to stderr. |