home / mcp / ai workspace mcp server
Provides a secure AI workspace with file management and Python execution via HTTP MCP endpoints deployed on Vercel.
Configuration
View docs{
"mcpServers": {
"a-proof-coding-mcp": {
"url": "https://your-project.vercel.app",
"headers": {
"WORKSPACE_PATH": "/tmp/workspace",
"EXECUTION_TIMEOUT": "30"
}
}
}
}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.
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.
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.
1) Install Vercel CLI (optional but recommended)
2) 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 fileOption A: Deploy via Vercel Dashboard
1. Go to vercel.com
2. Click Create New Project or Add New Project
3. 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 --prodAfter deployment, you will receive a URL similar to https://your-project.vercel.app which you will use to access the MCP server 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 toolTo 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.
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.
Common tools include creating files, reading files, updating files, deleting files, listing files, creating directories, and executing Python scripts.
Tool executions return JSON objects indicating success or failure, with details such as messages, error descriptions, and Python execution results.
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.
You can build custom MCP clients that call the execute endpoint and handle tool results, enabling automated workflows driven by AI.
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.
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.
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.
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.
Create a new file with specified content at a given filepath.
Read and return contents of a file at a given filepath.
Update the contents of an existing file.
Delete a file located at a given filepath.
List files and directories under a given path.
Create a new directory at a specified path.
Execute a Python script located at a given filepath with optional arguments, with a 30-second timeout.