Before setting up a client, make sure you have connected at least one source.
What MCP clients get
| Type | Name | Description |
|---|---|---|
| Tool | sql | Execute read-only SQL against the Coral database |
| Tool | list_catalog | List database tables and table functions with pagination |
| Tool | search_catalog | Search database catalog metadata with a Rust regex |
| Tool | describe_table | Show compact metadata for one database table |
| Tool | list_columns | List columns for one database table with pagination |
| Resource | coral://guide | Database workflow guide for agents |
| Resource | coral://tables | JSON summaries of database tables and required filters |
coral sql. You set up sources with the CLI, then agents query Coral over MCP as SQL schemas and tables.
Agents should treat the discovery tools as catalog helpers, not as replacement provider APIs. For data questions, prefer a single sql call using JOIN, CROSS JOIN, CTEs, subqueries, aggregates, or window functions over multiple tool calls that fetch rows and combine them in the agent.
Discovery tools
list_catalog: paginated list of database tables and parameterized table functions.
- Arguments: optional
schema,kind,limit,offset. Omitkind(or passnull) to include both"table"and"table_function"items. - For tables, use
sql_referenceinFROMandJOINclauses. - For table functions, use
sql_call_exampleand fill in the required arguments. - Do not quote the whole
schema.itemstring: writegithub.pullsor"github"."pulls", not"github.pulls".
search_catalog: deterministic regex matching over database catalog metadata.
- Arguments: required
patternplus optionalschema,kind,ignore_case,limit,offset.
describe_table: compact metadata for one table.
- Arguments: exact
schemaandtable. - Returns guide text, required filters, and a column count without dumping full columns.
list_columns: paginated columns for one table.
- Arguments: exact
schemaandtable, plus optionalpattern,ignore_case,required_only,limit,offset. - For existing tables, returns a
columnspage withtotal,has_more, and optionalnext_offset. Whenpatternis set, matching rows includematched_fieldsso clients can explain why a column matched. - When the requested table does not exist, returns
found: falsewith recovery hints instead of an empty page. Clients should branch tosearch_catalogorlist_catalograther than pretending the table has zero columns.
Richer metadata via SQL
For deeper introspection, querycoral.tables, coral.columns, coral.filters, coral.table_functions, and coral.inputs through the sql tool instead of relying only on list_catalog or coral://tables. Use coral.filters as the normalized filter surface, with coral.columns.filter_mode available when inspecting filter-only virtual columns.
Searching a provider’s data
Some sources expose native search endpoints (for example, GitHub issue search) as table functions withkind = 'search'. Prefer these over scanning a regular table when the agent needs ranked, query-driven results. They return provider-ranked candidates, so agents should preserve any returned rank columns and use the returned ids plus catalog-described tables to fetch full detail rows when the search result itself is incomplete.
Query result format
Thesql tool returns rows as a JSON array of objects. To preserve exact values across JSON parsers, Coral encodes precision-sensitive numeric types as JSON strings rather than JSON numbers:
Int64(BIGINT) andUInt64Decimal32,Decimal64,Decimal128, andDecimal256
Struct, List, and Map columns. The column’s declared SQL type does not change — describe_table, list_columns, and coral.columns still report Int64 or Decimal(p, s); only the JSON encoding of the value is a string. A BIGINT user_id, for example, comes back as { "user_id": "-8504475857937456387" }.
Coral does this because MCP uses JSON-RPC, and many clients — JavaScript/TypeScript JSON.parse and most MCP hosts — decode JSON numbers as IEEE-754 doubles. Values beyond 2^53 silently lose precision when read as a number.
The CLI is unaffected: coral sql --format json keeps emitting these types as JSON numbers.
Client setup
Coral uses stdio transport. If a client supports a command-based install flow, point it atcoral mcp-stdio.
- npx add-mcp
- Claude Code
- Codex
- OpenCode
- Cursor
- VS Code
- Claude Desktop
- Other
Use add-mcp to add the Coral MCP server to all your favorite coding agents with a single command.(To install only in the current project, omit the
- macOS / Linux
- Windows PowerShell
-g flag.)Verify the connection
Once your client is connected, ask the agent to list available tables or run a simple database query. Examples:“List the tables available in Coral.”
“Run a small Coral query against coral.tables.”
The agent should call list_catalog, search_catalog, or query coral.tables and coral.table_functions to return SQL schemas and catalog items, and use describe_table or list_columns for table-specific metadata. Large catalogs should be paged with limit and offset.
Troubleshooting
coralnot found: Make surecoralis on yourPATH, or use the full path fromwhich coralon macOS or Linux or(Get-Command coral).Sourcein PowerShell.- No tables visible: Run
coral source listin your terminal to confirm you have sources installed. If empty, add one withcoral source add.