Moul

Built-in Model Context Protocol (MCP) Server

Native MCP server enabling AI coding assistants to inspect schemas, execute CRUD, manage background jobs, and monitor metrics.

moul includes a native Model Context Protocol (MCP) server powered by github.com/mark3labs/mcp-go. This empowers AI coding assistants (Claude Desktop, Cursor, Antigravity, Windsurf) with deep inspection and operational control over your backend.


Transport Modes

1. Stdio Mode (moul mcp)

Communicates directly over standard input and output streams. Ideal for local IDEs without running a separate HTTP process.

2. Streamable HTTP & SSE Mode (/api/mcp)

Enabled automatically when running moul start. Accepts direct JSON-RPC POST requests (MCP 2025 Spec) as well as legacy SSE streams.


Assistant Configuration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "moul": {
      "command": "/usr/local/bin/moul",
      "args": ["mcp"],
      "env": {
        "MOUL_DB_PATH": "/path/to/moul-local.db"
      }
    }
  }
}

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "moul": {
      "command": "moul",
      "args": ["mcp"]
    }
  }
}
curl -X POST "http://localhost:8090/api/mcp" \
  -H "X-Admin-Key: test-admin-key-1234" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "moul_list_collections",
      "arguments": {}
    }
  }'

Available MCP Tools Catalog

MCP Tool NameCategoryDescription
moul_list_collectionsSchemaList all dynamic collection schemas and tables.
moul_get_collectionSchemaGet detailed schema definition, field types, and rules.
moul_create_collectionSchemaCreate a new dynamic collection and SQLite table.
moul_delete_collectionSchemaDelete a collection and drop its SQLite table.
moul_list_recordsCRUDQuery paginated records with optional filters.
moul_get_recordCRUDRetrieve a single record by collection name and ID.
moul_create_recordCRUDInsert a new dynamic record into a collection.
moul_update_recordCRUDUpdate an existing record by ID.
moul_delete_recordCRUDDelete a record by ID.
moul_list_worker_jobsWorkersList background jobs by status (available, executing, etc.).
moul_enqueue_jobWorkersEnqueue a new background worker job.
moul_cancel_jobWorkersCancel a pending or retryable worker job.
moul_list_feature_flagsFlagsList OpenFeature flags and targeting gate rules.
moul_set_feature_flagFlagsCreate or update a feature flag and rollout percentage.
moul_get_system_metricsMetricsFetch host CPU, Memory, Disk, and load metrics.
moul_get_analytics_summaryObservabilityFetch visitor and request analytics totals.
moul_list_requestsObservabilityQuery recent HTTP request logs.

On this page