Skip to main content
Glama
Codehooks.io MCP Server

Codehooks.io MCP Server

by RestDB

Codehooks.io MCP Server

An MCP (Model Context Protocol) server that provides AI agents with database operations, serverless code deployment, and file management capabilities on the Codehooks.io platform.

When to Use This MCP vs. CLI Directly

Environment

Has Terminal?

Recommended Approach

Claude Code

Yes

Use coho CLI directly

Cursor

Yes

Use coho CLI directly

Claude Desktop

No

This MCP server

For AI Agents with Terminal Access (Claude Code, Cursor, etc.)

Using the Codehooks CLI directly is simpler and more flexible:

  1. Install the CLI: npm install -g codehooks

  2. Login: coho login

  3. Get the AI prompt: coho prompt

  4. Or reference the online docs: https://codehooks.io/llms.txt

The agent can then run coho commands directly in the terminal.

For Claude Desktop (No Terminal Access)

Use this MCP server to give the AI access to Codehooks functionality. See the Setup section below.

Related MCP server: pocketbase-mcp

Available functionality

Database & Collections

  • Query and update collections (including metadata) with filters and sorting

  • Create and manage collections

  • Import/export data (JSON,JSONL,CSV)

  • Add schemas and indexes, cap collections

Code Deployment

  • Deploy JavaScript serverless functions

File Operations

  • Upload files to cloud storage

  • List and browse files

  • Delete files

  • Inspect file metadata

Key-Value Store

  • Store key-value pairs

  • Retrieve one or many key-value pairs

  • Delete key-value pairs

  • Set time-to-live (TTL) for key-value pairs

System Operations

  • View application logs

  • Access API documentation (local documentation for the MCP agent)

Setup

Get Codehooks Admin Token (keep it secret!)

coho login
coho add-admintoken

Create MCP Server Script

Create a folder for your MCP server scripts:

mkdir ~/mcp-servers
cd ~/mcp-servers

For macOS/Linux - Create 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_project_name \
  -e CODEHOOKS_ADMIN_TOKEN=your_admin_token \
  -e CODEHOOKS_SPACE=your_space_name \
  ghcr.io/restdb/codehooks-mcp:latest

Make it executable:

chmod +x ~/mcp-servers/codehooks.sh

For Windows - Create codehooks.bat:

@echo off
docker run --rm -i ^
  --pull always ^
  -e CODEHOOKS_PROJECT_NAME=your_project_name ^
  -e CODEHOOKS_ADMIN_TOKEN=your_admin_token ^
  -e CODEHOOKS_SPACE=your_space_name ^
  ghcr.io/restdb/codehooks-mcp:latest

Replace your_project_name, your_admin_token, and your_space_name with your actual values.

Configure for Claude Desktop

Add to your claude_desktop_config.json:

macOS/Linux:

{
  "mcpServers": {
    "codehooks": {
      "command": "/Users/username/mcp-servers/codehooks.sh"
    }
  }
}

Windows:

{
  "mcpServers": {
    "codehooks": {
      "command": "C:\\Users\\username\\mcp-servers\\codehooks.bat"
    }
  }
}

Configure for Cursor

Add to your ~/.cursor/mcp.json:

macOS/Linux:

{
  "mcpServers": {
    "codehooks": {
      "command": "/Users/username/mcp-servers/codehooks.sh"
    }
  }
}

Windows:

{
  "mcpServers": {
    "codehooks": {
      "command": "C:\\Users\\username\\mcp-servers\\codehooks.bat"
    }
  }
}

Replace username with your actual username.

Example Requests

  • "Build a complete survey system: create a database, deploy an API to collect responses, and add search/analytics endpoints"

  • "Set up a real-time inventory tracker: import my product CSV, create stock update webhooks, and build low-stock alerts"

  • "Build a webhook processing pipeline: receive webhooks from multiple sources, transform and validate data, then trigger automated actions"

  • "Build a content management system: create file upload endpoints, set up a metadata database, and deploy content delivery APIs"

  • "Set up automated data backups: export my collections to JSON files, store them with timestamps, and create restoration endpoints"

How These Examples Work

Complete Survey System

The AI agent would:

  1. Create collections (surveys, responses) for data storage

  2. Add schemas for data validation and structure

  3. Deploy JavaScript endpoints like POST /surveys and GET /surveys/:id/analytics

  4. Create indexes on response fields for fast searching and analytics

Real-time Inventory Tracker

The AI agent would:

  1. Import your CSV to populate the products collection

  2. Deploy webhook handlers for POST /inventory/update and GET /inventory/low-stock

  3. Set up key-value storage for alert thresholds and settings

  4. Create indexes on SKU and stock levels for real-time queries

Webhook Processing Pipeline

The AI agent would:

  1. Deploy webhook receivers like POST /webhooks/stripe and POST /webhooks/github

  2. Create collections for webhook_logs, processed_events, and failed_events

  3. Set up data transformation rules and validation schemas for each webhook source

  4. Use key-value store for rate limiting and duplicate detection with TTL

  5. Deploy action triggers that send emails, update databases, or call other APIs based on webhook data

Content Management System

The AI agent would:

  1. Create collections for content, media, and users

  2. Deploy file upload endpoints with POST /upload and GET /content/:id

  3. Upload and manage static files for content delivery

  4. Store metadata linking files to content records with search indexes

Automated Data Backups

The AI agent would:

  1. Export collections to JSON format with timestamps

  2. Upload backup files to cloud storage automatically

  3. Deploy restoration APIs like GET /backups and POST /restore/:backup-id

  4. Store backup metadata in key-value store for tracking and management

Each example demonstrates how multiple MCP tools work together to create complete, production-ready systems through natural conversation with your AI agent.

Security Researchers

We thank the following individuals for responsible disclosure and helping improve the security of this project:

  • Liran Tal – Reported a command injection vulnerability in the query_collection tool (May 2025)

License

This project is licensed under the MIT License.

Available Tools

21 tools
add_schemaB

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

Inputs: schema (required), collection (required).

cap_collectionC

Cap a collection

Inputs: cap (required), collection (required).

collectionB

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

Inputs: sys, json, project.

create_collectionC

Create a new collection

Inputs: collection (required).

create_indexC

Add field(s) to a query index

Inputs: index (required), collection (required).

deploy_codeA

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:

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

Inputs: files (required), json, main, spaceId, +1 more.

docsA

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

Inputs: no named parameters.

drop_collectionB

Delete a collection

Inputs: collection (required).

drop_indexB

Remove field(s) from a query index

Inputs: index (required), collection (required).

exportA

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

Inputs: collection (required), csv, jsonl, filepath.

file_deleteC

Delete a file from server

Inputs: match, dryrun, filename.

file_listC

List files from server

Inputs: path.

file_uploadC

Upload files to server

Inputs: target (required), content (required), encoding.

importA

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

Inputs: collection (required), content, encoding, filepath, +1 more.

kv_delC

Delete key-value pair in a space.

Inputs: key (required), json, keyspace.

kv_getB

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

Inputs: key, text, keyspace.

kv_setB

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

Inputs: key (required), val (required), ttl, json, +1 more.

logsC

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

Inputs: tail, follow, context.

query_collectionB

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.

Inputs: collection (required), csv, end, sort, +13 more.

remove_schemaB

Remove JSON schema from a collection

Inputs: collection (required).

uncap_collectionB

Remove cap from a collection

Inputs: collection (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 21 tools

    Disambiguation5/5

    Each tool targets a distinct operation or resource: collections, schemas, indexes, queries, key-value store, files, import/export, logs, etc. Even similar-sounding tools like 'collection' (list) and 'create_collection' are clearly differentiated by their descriptions.

    Naming Consistency5/5

    All tool names use snake_case consistently and follow a verb_noun pattern (e.g., 'add_schema', 'create_collection', 'file_upload', 'kv_set'). Exceptions like 'collection', 'docs', and 'logs' are short nouns for retrieval, which is a common and predictable convention.

    Tool Count4/5

    With 21 tools, this is slightly above the typical 3-15 range for MCP servers, but the number is justified by the comprehensive set of operations (database, files, KV store, logs, etc.). The tools are well-scoped and each serves a clear purpose.

    Completeness5/5

    The tool set covers full lifecycle operations for collections (create, list, drop, cap, uncap), schemas (add, remove), indexes (create, drop), queries, key-value store (set, get, del), files (upload, list, delete), import/export, deployment, logs, and documentation. No obvious gaps are present.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI agents to fully automate Appwrite backend operations with 143 tools covering databases, users, storage, functions, messaging, and more. Supports advanced features like GeoJSON attributes, file uploads, function deployment, and bulk operations.
      3 npm
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to perform CRUD operations on Pocketbase collections, manage authentication, and query logs via a type-safe API.
      18 npm
      ISC
    • F
      license
      Not graded
      quality
      B
      maintenance
      Provides AI agents with production-ready integrations for GitHub repository management, sandboxed code execution, SFTP file operations, web search and scraping, YouTube, Google Workspace, Notion, and more.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to manage collections and records, handle user authentication and account operations, and create database backups through MCP tools. Supports schema creation, CRUD operations, pagination, filtering, and relationship expansion.
      18 npm
      ISC