{"record":{"id":"3810a325c9457426","repo":"different-ai/openwork","slug":"database-url-is-required-e-g-mysql-root-passwo","errorCode":null,"errorMessage":"DATABASE_URL is required (e.g. mysql://root:password@127.0.0.1:3306/openwork_den)","messagePattern":"DATABASE_URL is required \\(e\\.g\\. mysql://root:password@127\\.0\\.0\\.1:3306/openwork_den\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ee/packages/den-admin-mcp/index.mjs","lineNumber":30,"sourceCode":"//\n// Register in OpenWork (opencode.json):\n//   { \"mcp\": { \"den-admin\": { \"type\": \"local\",\n//       \"command\": [\"node\", \"/path/to/ee/packages/den-admin-mcp/index.mjs\"],\n//       \"environment\": { \"DATABASE_URL\": \"mysql://...\" }, \"enabled\": true } } }\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport mysql from \"mysql2/promise\";\nimport { z } from \"zod\";\n\nconst DEFAULT_ROW_LIMIT = Number(process.env.DEN_ADMIN_MCP_ROW_LIMIT || 200);\n\nlet pool = null;\nfunction getPool() {\n  if (!pool) {\n    const url = process.env.DATABASE_URL;\n    if (!url) {\n      throw new Error(\n        \"DATABASE_URL is required (e.g. mysql://root:password@127.0.0.1:3306/openwork_den)\",\n      );\n    }\n    pool = mysql.createPool({ uri: url, connectionLimit: 4, dateStrings: true });\n  }\n  return pool;\n}\n\nasync function rows(sqlText, params = []) {\n  const [result] = await getPool().query(sqlText, params);\n  return result;\n}\n\nconst n = (value) => Number(value ?? 0);\n\nfunction ok(data) {\n  return { content: [{ type: \"text\", text: JSON.stringify(data, null, 2) }] };\n}","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/packages/den-admin-mcp/index.mjs#L12-L48","documentation":"Error \"DATABASE_URL is required (e.g. mysql://root:password@127.0.0.1:3306/openwork_den)\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/packages/den-admin-mcp/index.mjs:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}