Connect an agent
Give a local, cloud, browser, or chat agent access to Filecoin storage through the filecoin plugin, agent skill, CLI, or MCP server.
Pick the way in that matches what your agent can do. In every case, a person owns the wallet and approves what the agent may do, and the agent never holds the wallet key.
Local agent, such as Claude Code, Codex, or Cursor
Run a shell, keep files, and open pages for you
Cloud agent, such as a coding agent in a hosted sandbox
Run a shell, but its files are gone when the session ends
Browser agent
Read and use web pages in the browser that holds your wallet
Dashboard links and PDP Explorer, read-only
Retrieve and verify compares what each way can store, retrieve, and check.
Local agents
In Claude Code and Codex, install the filecoin plugin. It adds the agent skill and the read-only MCP server in one step.
claude plugin marketplace add filecoin-project/agents
claude plugin install filecoin@filecoincodex plugin marketplace add filecoin-project/agents
codex plugin add filecoin@filecoinThe plugin follows the Agent Plugins format, so other agents that support it can load it from the repository's plugins/filecoin directory.
In other agents, install the agent skill. It tells the agent when to use filecoin, the workflow, and the rules, and points it to the CLI's own help, which always matches the installed version:
npx skills add filecoin-project/agentsThe agent runs the CLI with npx -y filecoin, which needs Node.js 24 or newer. To install it instead, run npm install -g filecoin. Then filecoin skills install installs the copy of the skill that matches the installed CLI.
The first filecoin login asks you to approve the agent's key.
Cloud agents
A cloud agent has a shell, so it uses the same skill and CLI as a local agent. It has no browser to open for you, and its disk is gone when the session ends. filecoin login saves the session key on that disk, so each session would ask you to approve a new key.
Give the agent a key that outlives the session instead:
On the filecoin-app dashboard's Session keys page, generate a session key, authorize it with at least
createDataSetandaddPieces, and copy its private key with Export key.In the agent's environment settings, add the session key's private key as the secret
FILECOIN_SESSION_KEY, and your wallet address asFILECOIN_ROOT_ADDRESS.
filecoin then skips filecoin login, and filecoin status confirms the key works. The key cannot move funds, and it expires. Revoke it on the same page to stop the agent.
filecoin ls and filecoin operations read a local database, which a new session starts without. Find stored content shows how to look it up by wallet.
Browser agents
A browser agent cannot run the CLI, so it cannot store content. It can open the dashboard links a wallet owner needs, look up data sets, providers, and pieces on PDP Explorer, and open a folder's link, which verifies in the browser.
MCP server
The MCP server gives any agent read-only tools for storage providers, data sets, pieces, Filecoin Pay rails, and session keys, on mainnet and Calibration. It uses Streamable HTTP and needs no authentication. It cannot store or delete content.
The filecoin plugin adds it in Claude Code and Codex. To add the server alone, add-mcp writes it into the configuration of Claude Code, Codex, Cursor, VS Code, and about 20 other agents:
It asks which agents to configure, and adds the server to the current project. Add -g to add it for your user instead.
Claude Code and Codex also add it with their own commands:
In the Claude and ChatGPT apps, add the URL as a custom connector. API and MCP lists the tools.
Approve the agent's key
The agent never holds the wallet key. It gets a session key instead, and the wallet owner approves it:
The agent runs
filecoin login. It gets alogin_pendingerror with an approval link, and relays the link to you.You open the link, which goes to the filecoin-app dashboard's setup page with the key filled in. Connect your wallet, review the request, and approve it.
The agent runs
filecoin login --checkto confirm.--checknever makes a new key, so it can't replace the one you approved.If the account has no funds yet, the agent relays a funding link. It opens the same setup page, where you deposit USDFC and, if you haven't yet, approve the Warm Storage service, each as its own wallet transaction.
When the account runs low, filecoin status reports ready: false with the same funding link, and filecoin put fails with insufficient_funds and that link. To stop the agent, revoke its key on the dashboard's Session keys page.
Docs for agents
These docs are published in formats agents can read directly:
An index of every page on docs.filecoin.io in Markdown, from llmstxt.org
Every page in one Markdown file
Every page
https://docs.filecoin.io/~gitbook/mcp
An MCP server that searches and reads these docs, described at /.well-known/mcp/server-card.json. This is separate from the read-only Filecoin MCP server
Every page also has a Markdown version. Add .md to the path, such as /build-on-filecoin/filecoin-for-agents/cli.md, or send Accept: text/markdown.
Last updated