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.
https://<this-host>/api/mcpSpeaks JSON-RPC 2.0 over POST: initialize, tools/list and tools/call. No authentication, sessions or SSE required.
Tools
search_schemaKeyword search across table/view names & descriptions, column names and routine names. The entry point for finding relevant objects.
list_tablesList tables (optionally views) with row counts, module category and descriptions; filter by category or keyword.
describe_tableFull documentation of one table/view: typed columns with PK/FK flags and descriptions, foreign keys both directions, and sample rows.
get_routineParameter signature and inferred purpose of a stored procedure or function; includes T-SQL source for the few readable ones.
sql_conventionsThe 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
- Call sql_conventions once — multi-tenancy and soft-delete rules prevent most wrong queries.
- search_schema with a business keyword ("reservation", "invoice", "housekeeping").
- describe_table for each table the query will touch — column types, FKs and sample values.
- Write T-SQL: filter
HOTELID, respectISDELETED=0, add date ranges on the huge tables.