AgentFS (beta) Guides
MCP Server Integration
Use AgentFS as an MCP server for AI assistants
AgentFS can run as an MCP (Model Context Protocol) server, exposing filesystem and key-value operations to AI assistants like Claude Desktop.
Starting the MCP Server
agentfs serve mcp my-agent
This starts an MCP server that exposes AgentFS tools over stdio.
Available Tools
Filesystem Tools
| Tool | Description |
|---|---|
read_file |
Read file contents |
write_file |
Write file contents |
readdir |
List directory contents |
mkdir |
Create directory |
remove |
Remove file or directory |
rename |
Rename file or directory |
stat |
Get file metadata |
access |
Check file access permissions |
Key-Value Tools
| Tool | Description |
|---|---|
kv_get |
Get value by key |
kv_set |
Set key-value pair |
kv_delete |
Delete key |
kv_list |
List all keys |
Limiting Exposed Tools
For security, you can limit which tools are available:
# Read-only mode
agentfs serve mcp my-agent --tools read_file,readdir,stat,kv_get,kv_list
# Filesystem only
agentfs serve mcp my-agent --tools read_file,write_file,readdir,mkdir,remove
# Key-value only
agentfs serve mcp my-agent --tools kv_get,kv_set,kv_delete,kv_list
Security Considerations
WARNING
The MCP server gives AI assistants direct access to the AgentFS filesystem. Consider these security practices:
- Limit tools - Only expose tools the assistant needs
- Use overlays - Create overlay filesystems instead of giving access to real directories
- Review the agent database - Check
.agentfs/*.dbperiodically
Debugging
Check if the MCP server is working:
# Run manually to see output
agentfs serve mcp my-agent
# Check if the database exists
ls -la .agentfs/my-agent.db
Next Steps
Synced from official Turso documentation (
tursodatabase/turso-docs
· MIT License)
Official Docs ↗