- Home
- MCP servers
- AI Workspace
AI Workspace
- python
0
GitHub Stars
python
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run an AI-focused MCP server that provides a secure workspace for file management and Python execution, hosted as a serverless function on Vercel. It exposes tools to create, read, update, delete, and list files and directories, plus an execution tool for Python scripts with a built-in 30-second timeout. This setup lets you interact with AI clients to perform workspace operations via simple HTTP endpoints.
How to use
You will communicate with the MCP server through HTTP endpoints. Use the tools endpoint to discover available operations, and use the execute endpoint to run a specific tool with its required arguments. For example, you can create a new file, write Python code, and then execute that code, all through API calls.
How to install
Prerequisites: you need Node.js and npm if you plan to use the Vercel CLI for deployment, and you should have Python installed for local testing or dependencies.
Follow these concrete steps to set up and deploy on Vercel.
-
Install Vercel CLI (optional but recommended)
-
Prepare your project structure as described below, or adapt to your existing project.
Your project should look like this when starting fresh (adjust paths if you customize):
ai-workspace-mcp/
├── api/
│ └── mcp.py # Serverless function
├── vercel.json # Vercel configuration
├── requirements.txt # Python dependencies
└── README.md # This file
Deploy to Vercel
Option A: Deploy via Vercel Dashboard
-
Go to vercel.com
-
Click Create New Project or Add New Project
-
Import your Git repository or upload files, then Vercel will auto-detect Python and deploy
Option B: Deploy via CLI
# Login to Vercel
vercel login
# Deploy
vercel
# Deploy to production
vercel --prod
Get Your Deployment URL
After deployment, you will receive a URL similar to https://your-project.vercel.app which you will use to access the MCP server endpoints.
API Endpoints
The server exposes several endpoints for management and execution.
GET / Returns server information and status
GET /health Health check endpoint
GET /tools List all available tools
POST /execute Execute a tool
Using with AI Clients
To integrate with AI clients, configure your client to send requests to the execute endpoint with the desired tool and its arguments. For example, you can create a file and then execute a Python script contained in that file.
Security features
The workspace is sandboxed to restrict file operations to a designated area, with path validation to prevent traversal attacks. Python scripts have a maximum execution timeout to avoid long-running tasks. Cross-origin requests are allowed, and each request runs in an isolated serverless environment.
Tool examples
Common tools include creating files, reading files, updating files, deleting files, listing files, creating directories, and executing Python scripts.
Response formats
Tool executions return JSON objects indicating success or failure, with details such as messages, error descriptions, and Python execution results.
Important notes
Keep in mind that files stored in the temporary space (/tmp) are ephemeral and do not persist between invocations on serverless platforms. For persistence, consider integrating with a storage service or database.
Advanced usage
You can build custom MCP clients that call the execute endpoint and handle tool results, enabling automated workflows driven by AI.
Troubleshooting
If you encounter module or dependency issues, ensure your Python dependencies are declared in requirements.txt and that the deployment environment has access to them.
Notes on persistence and limits
Temporary storage is ephemeral on serverless environments, and there is a finite execution time depending on your hosting tier. For longer-running tasks, consider offloading work to a persistent service.
Environment variables
Configure optional environment variables in the hosting platform to tailor the workspace behavior. Typical keys include a custom workspace path and a Python execution timeout.
Local development
Test locally by running a Python-based server or by using the hosting provider's development tooling. Validate health and functionality with simple HTTP requests.
Available tools
create_file
Create a new file with specified content at a given filepath.
read_file
Read and return contents of a file at a given filepath.
update_file
Update the contents of an existing file.
delete_file
Delete a file located at a given filepath.
list_files
List files and directories under a given path.
create_directory
Create a new directory at a specified path.
execute_python
Execute a Python script located at a given filepath with optional arguments, with a 30-second timeout.