EElektra DB DocsEMDS

MCP Endpoint

A Model Context Protocol server that serves this documentation to AI agents, so they can look up the schema and write correct SQL against the Elektra database.

Endpoint (Streamable HTTP, stateless)
https://<this-host>/api/mcp

Speaks JSON-RPC 2.0 over POST: initialize, tools/list and tools/call. No authentication, sessions or SSE required.

Tools

search_schema

Keyword search across table/view names & descriptions, column names and routine names. The entry point for finding relevant objects.

list_tables

List tables (optionally views) with row counts, module category and descriptions; filter by category or keyword.

describe_table

Full documentation of one table/view: typed columns with PK/FK flags and descriptions, foreign keys both directions, and sample rows.

get_routine

Parameter signature and inferred purpose of a stored procedure or function; includes T-SQL source for the few readable ones.

sql_conventions

The house rules for writing correct EMDS T-SQL: multi-tenancy (HOTELID), soft deletes, huge-table warnings and canonical join paths.

Connect from Claude Code / MCP clients

Add to .mcp.json (or run claude mcp add --transport http elektra-schema https://<this-host>/api/mcp):

{
  "mcpServers": {
    "elektra-schema": {
      "type": "http",
      "url": "https://<this-host>/api/mcp"
    }
  }
}

Try it with curl

curl -X POST https://<this-host>/api/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"describe_table","arguments":{"table":"HOTEL_RES"}}}'

Suggested agent workflow

  1. Call sql_conventions once — multi-tenancy and soft-delete rules prevent most wrong queries.
  2. search_schema with a business keyword ("reservation", "invoice", "housekeeping").
  3. describe_table for each table the query will touch — column types, FKs and sample values.
  4. Write T-SQL: filter HOTELID, respect ISDELETED=0, add date ranges on the huge tables.
Built with Viski