MCP
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
A Model Context Protocol (MCP) server that exposes Val Town's native tools and resources, allowing AI models to interact with Val Town's capabilities through a standardized protocol.
- Blob Storage: Read, write, list, and delete blob data
- SQLite Database: Execute queries and manage database operations
- Email: Send emails through Val Town's email service
- OpenAI Integration: Access OpenAI API through Val Town's service
- File Operations: Read and list project files
- Environment Variables: Access environment configuration
This server implements the Model Context Protocol specification, providing:
- Tool discovery and execution
- Resource listing and reading
- Proper error handling and validation
- JSON-RPC 2.0 compliant messaging
POST /mcp
- Main MCP protocol endpointGET /
- Server information and documentation
The server exposes Val Town capabilities as MCP tools that can be called by compatible AI models and clients.
- Main Interface:
GET /
- Web interface with documentation - MCP Protocol:
POST /mcp
- JSON-RPC 2.0 endpoint for MCP requests - Health Check:
GET /health
- Server health status - API Documentation:
GET /api/docs
- Complete API documentation in JSON format
// Initialize connection { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {} } // List available tools { "jsonrpc": "2.0", "id": 2, "method": "tools/list" } // Call a tool { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "blob_set", "arguments": { "key": "my-data", "value": {"hello": "world"} } } } // List resources { "jsonrpc": "2.0", "id": 4, "method": "resources/list" }
├── backend/
│ ├── index.ts # Main HTTP server
│ ├── mcp/
│ │ ├── server.ts # MCP protocol handler
│ │ ├── tools.ts # Tool definitions and handlers
│ │ ├── resources.ts # Resource definitions and handlers
│ │ └── types.ts # MCP type definitions
│ └── README.md
├── shared/
│ └── utils.ts # Shared utilities
└── README.md