{"library":"mcp-oracle-database","title":"Oracle Database Model Context Protocol Server","description":"The `mcp-oracle-database` package provides a Model Context Protocol (MCP) server specifically designed to enable AI assistants, such as GitHub Copilot, to execute read-only SQL queries against Oracle databases. Currently at version `1.0.0`, it offers a stable initial release. While no explicit release cadence is stated, its design as a crucial bridge for LLM-driven database interactions suggests ongoing maintenance. Key differentiators include its strict read-only access model for enhanced security, direct standard input/output (stdio) transport for communication (eliminating the need for an HTTP server), efficient Oracle connection pooling, and capabilities for schema introspection. It also features audit logging for all executed queries, timeout protection for long-running operations, and configurable row limits to prevent excessive memory usage. Notably, it leverages `node-oracledb` in Thin Mode, which means developers do not need to install the Oracle Instant Client, simplifying deployment and setup compared to traditional Oracle database drivers.","language":"javascript","status":"active","last_verified":"Thu Apr 23","install":{"commands":["npm install mcp-oracle-database"],"cli":null},"imports":["import { startServer } from 'mcp-oracle-database';","import type { OracleMcpServerConfig } from 'mcp-oracle-database';","import { OracleDatabaseError } from 'mcp-oracle-database';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { spawn } from 'child_process';\nimport * as path from 'path';\n\n// Define the environment variables for the MCP server\n// For production, use a secure method to manage credentials.\nconst env = {\n  ORACLE_CONNECTION_STRING: process.env.ORACLE_CONNECTION_STRING ?? 'localhost:1521/XEPDB1',\n  ORACLE_USER: process.env.ORACLE_USER ?? 'your_readonly_user',\n  ORACLE_PASSWORD: process.env.ORACLE_PASSWORD ?? 'your_password',\n  ORACLE_POOL_MIN: process.env.ORACLE_POOL_MIN ?? '2',\n  ORACLE_POOL_MAX: process.env.ORACLE_POOL_MAX ?? '10',\n  QUERY_TIMEOUT_MS: process.env.QUERY_TIMEOUT_MS ?? '30000',\n  MAX_ROWS_PER_QUERY: process.env.MAX_ROWS_PER_QUERY ?? '1000',\n  // Inherit current process environment to ensure basic PATH, etc.\n  ...process.env,\n};\n\n// The executable command as installed via npm -g or in node_modules/.bin\nconst command = 'mcp-database-server';\n\nconsole.log(`Attempting to start MCP Oracle Database Server with command: ${command}`);\nconsole.log('Ensure ORACLE_CONNECTION_STRING, ORACLE_USER, ORACLE_PASSWORD are set via environment variables.');\n\n// Spawn the server process, similar to how an MCP client would\nconst serverProcess = spawn(command, [], {\n  env,\n  stdio: ['pipe', 'pipe', 'pipe'], // Capture stdin, stdout, stderr\n});\n\nserverProcess.stdout.on('data', (data) => {\n  console.log(`[Server stdout]: ${data.toString().trim()}`);\n});\n\nserverProcess.stderr.on('data', (data) => {\n  console.error(`[Server stderr]: ${data.toString().trim()}`);\n});\n\nserverProcess.on('close', (code) => {\n  console.log(`MCP Oracle Database Server process exited with code ${code}`);\n});\n\nserverProcess.on('error', (err) => {\n  console.error(`Failed to start MCP Oracle Database Server process: ${err.message}`);\n});\n\n// In a real scenario, an MCP client would then write JSON-RPC messages to serverProcess.stdin.\n// For example, to send an 'initialize' message after a delay:\n/*\nsetTimeout(() => {\n  const initializeMessage = {\n    jsonrpc: '2.0',\n    id: 1,\n    method: 'initialize',\n    params: { capabilities: {} }\n  };\n  console.log('Sending simulated MCP initialize message...');\n  serverProcess.stdin.write(JSON.stringify(initializeMessage) + '\\n');\n}, 5000);\n*/\n\n// Keep the Node.js process alive for a bit to see output (optional)\nsetTimeout(() => {\n  if (!serverProcess.killed) {\n    console.log('Simulated parent process exit after 60 seconds.');\n    serverProcess.kill(); // Terminate the child process\n  }\n}, 60000);","lang":"typescript","description":"Demonstrates how to programmatically spawn and monitor the MCP Oracle Database server process using TypeScript, mimicking its execution via a VS Code MCP client configuration. It shows how environment variables configure database connection details and how to capture server output.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}