add_schema
Add a JSON schema to a collection. Provide the schema content as a JSON string.
Give an assistant a backend it can build — collections, schemas and indexes, deployed JavaScript endpoints, file storage and a key-value store on Codehooks.io.
LABSCO SUMMARY
For Claude Code or Cursor the maintainers point you at the coho CLI instead — install it, log in, run coho prompt, and let the agent use the command line, which is simpler and covers more. This server exists for Claude Desktop and anything else without shell access. Within that niche it is unusually complete: deploying code, not just reading and writing rows, is what lets an assistant produce a working endpoint rather than a database someone else has to wire up.
An MCP server for the Codehooks.io platform, aimed at clients without a terminal. It covers the whole backend surface: a document database with collections, schemas and indexes; deployment of JavaScript serverless functions; file storage; a key-value store with TTL; and application logs — so an assistant can stand up a working API from a conversation.
A Codehooks.io account and an admin token, created with coho login followed by coho add-admintoken. Three values go to the server: CODEHOOKS_PROJECT_NAME, CODEHOOKS_ADMIN_TOKEN and CODEHOOKS_SPACE. It ships as a container at ghcr.io/restdb/codehooks-mcp, launched through a small shell or batch script that your client runs — the README gives both. There is no npm release: the package is marked private. The admin token is what it sounds like: keep it out of anything you commit.
Run a container — pull the image and point your client at it
USE CASES
Import the CSV into a collection, add a schema and an index on the fields you filter by, and deploy an endpoint that serves it.
Deploy a handler for the incoming posts, create collections for processed and failed events, and use key-value entries with a TTL for duplicate detection.
Upload files to cloud storage, keep their metadata in a collection alongside the content records, and deploy the delivery endpoint.
Export collections to JSON, store the files with timestamps, and deploy a restore endpoint so the backup is usable rather than just present.
Read the application logs from the same conversation, then redeploy the corrected function.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
add_schemaAdd a JSON schema to a collection. Provide the schema content as a JSON string.
cap_collectionCap a collection
collectionShow collections for space. Lists all collections available in the current space.
create_collectionCreate a new collection
create_indexAdd field(s) to a query index
deploy_codeDeploy JavaScript code to Codehooks.io project.
MINIMAL WORKING EXAMPLE:
import { app } from 'codehooks-js';
app.get('/hello', (req, res) => {
res.json({ message: 'Hello, world!' });
});
// MANDATORY: bind to serverless runtime
export default app.init();INSTANT CRUD BACKEND:
import { app } from 'codehooks-js';
// Creates complete CRUD API for any collection (no schema required)
app.crudlify();
export default app.init();KEY REQUIREMENTS:
export default app.init();const conn = await Datastore.open(); conn.insertOne(collection, data);DOCUMENTATION:
Note: Codehooks.io has CORS built-in by default, so no additional CORS middleware is needed.
docsGet comprehensive Codehooks.io documentation and examples. Includes complete ChatGPT prompt, setup instructions, code examples, and API reference.
drop_collectionDelete a collection
drop_indexRemove field(s) from a query index
exportExport data from collection. If no filepath specified, returns the exported content directly. If filepath specified, saves to file inside Docker container.
file_deleteDelete a file from server
file_listList files from server
file_uploadUpload files to server
importImport data from file or content. Provide either 'filepath' (for files inside Docker container) or 'content' (JSON/CSV data as string).
kv_delDelete key-value pair in a space.
kv_getRetrieve key-value pair(s) from a space. Supports pattern matching with wildcards.
kv_setSet key-value pair in a space with optional TTL and keyspace.
logsShow system logs for a space with filtering and follow options.
query_collectionQuery data from a collection. Supports URL-style, regex, and MongoDB-style JSON queries with comparison operators. Can also query system collections like '_hooks' which contains deployment metadata including available API endpoints. Using delete, update or replace is very powerful but also dangerous, so use with caution.
remove_schemaRemove JSON schema from a collection
uncap_collectionRemove cap from a collection
BEFORE YOU INSTALL
21 tools when we connected. Many tools write, including deploy_code, drop_collection, drop_index and file_delete, and they run under an admin token with full project access.
CONTEXT COST
Rated by the size of the 21 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
Create the script
Save this as ~/mcp-servers/codehooks.sh (create the folder with mkdir ~/mcp-servers). <YOUR_CODEHOOKS_PROJECT_NAME>, <YOUR_CODEHOOKS_ADMIN_TOKEN> and <YOUR_CODEHOOKS_SPACE> are your own values. Make it executable with chmod +x ~/mcp-servers/codehooks.sh.
#!/bin/bash
# Set PATH to include common Docker locations
export PATH="/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH"
exec docker run --rm -i \
--pull always \
-e CODEHOOKS_PROJECT_NAME=<YOUR_CODEHOOKS_PROJECT_NAME> \
-e CODEHOOKS_ADMIN_TOKEN=<YOUR_CODEHOOKS_ADMIN_TOKEN> \
-e CODEHOOKS_SPACE=<YOUR_CODEHOOKS_SPACE> \
ghcr.io/restdb/codehooks-mcp:latestPoint the client at the script
Add this to claude_desktop_config.json:
{
"mcpServers": {
"codehooks": {
"command": "/Users/<YOUR_USERNAME>/mcp-servers/codehooks.sh"
}
}
}Create the script
Save this as ~/mcp-servers/codehooks.sh (create the folder with mkdir ~/mcp-servers). <YOUR_CODEHOOKS_PROJECT_NAME>, <YOUR_CODEHOOKS_ADMIN_TOKEN> and <YOUR_CODEHOOKS_SPACE> are your own values. Make it executable with chmod +x ~/mcp-servers/codehooks.sh.
#!/bin/bash
# Set PATH to include common Docker locations
export PATH="/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH"
exec docker run --rm -i \
--pull always \
-e CODEHOOKS_PROJECT_NAME=<YOUR_CODEHOOKS_PROJECT_NAME> \
-e CODEHOOKS_ADMIN_TOKEN=<YOUR_CODEHOOKS_ADMIN_TOKEN> \
-e CODEHOOKS_SPACE=<YOUR_CODEHOOKS_SPACE> \
ghcr.io/restdb/codehooks-mcp:latestPoint the client at the script
Add this to ~/.cursor/mcp.json:
{
"mcpServers": {
"codehooks": {
"command": "/Users/<YOUR_USERNAME>/mcp-servers/codehooks.sh"
}
}
}