Skip to main content
Glama
RestDB

Codehooks.io MCP Server

by RestDB

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CODEHOOKS_SPACEYesThe specific space name within your Codehooks.io project.
CODEHOOKS_ADMIN_TOKENYesYour Codehooks.io admin token, which can be generated using 'coho add-admintoken'.
CODEHOOKS_PROJECT_NAMEYesThe name of your Codehooks.io project.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
query_collection

Query 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.

deploy_code

Deploy 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:

  • Always import from 'codehooks-js'

  • Always end with export default app.init();

  • Use app.get(), app.post(), app.put(), app.delete() for routes

  • For database: const conn = await Datastore.open(); conn.insertOne(collection, data);

  • Use app.crudlify() to create complete CRUD backend with no schema required

  • Package.json will be auto-generated if not provided

DOCUMENTATION:

  • Use 'docs' tool for more information

  • Online ChatGPT prompt: https://codehooks.io/docs/chatgpt-backend-api-prompt

  • Online Workflow API: https://codehooks.io/docs/workflow-api

  • LLM-optimized docs: https://codehooks.io/llms.txt and https://codehooks.io/llms-full.txt

Note: Codehooks.io has CORS built-in by default, so no additional CORS middleware is needed.

file_upload

Upload files to server

file_delete

Delete a file from server

file_list

List files from server

create_index

Add field(s) to a query index

drop_index

Remove field(s) from a query index

create_collection

Create a new collection

drop_collection

Delete a collection

add_schema

Add a JSON schema to a collection. Provide the schema content as a JSON string.

remove_schema

Remove JSON schema from a collection

cap_collection

Cap a collection

uncap_collection

Remove cap from a collection

import

Import data from file or content. Provide either 'filepath' (for files inside Docker container) or 'content' (JSON/CSV data as string).

export

Export data from collection. If no filepath specified, returns the exported content directly. If filepath specified, saves to file inside Docker container.

kv_get

Retrieve key-value pair(s) from a space. Supports pattern matching with wildcards.

kv_set

Set key-value pair in a space with optional TTL and keyspace.

kv_del

Delete key-value pair in a space.

logs

Show system logs for a space with filtering and follow options.

docs

Get comprehensive Codehooks.io documentation and examples. Includes complete ChatGPT prompt, setup instructions, code examples, and API reference.

collection

Show collections for space. Lists all collections available in the current space.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RestDB/codehooks-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server