An open protocol for AI agents and IDEs to interact with real databases.
The Skematia Protocol is an open specification that enables AI agents and IDEs — Claude, Cursor, Windsurf, GitHub Copilot, custom autonomous agents, and any tool that wants to query, design, or operate on real databases — to connect to a production-grade backend with a single configuration step.
The protocol turns a database into a first-class citizen of the agent ecosystem: discoverable via Agent Card (A2A spec), operable via MCP (Model Context Protocol), and accessible via REST for any other client.
The current AI tooling landscape has a gap. Agents are powerful at reasoning and code generation, but their interaction with persistent data is limited to flat files, fragile shell commands, or one-off database wrappers. There is no shared, standard way for an agent to:
1. Discover what a database service can do.
2. Authenticate with a single credential that works across protocols.
3. Operate on the data — query, mutate, design schemas, evolve them safely.
4. Trust the result — with versioning, audit, rollback, and safety guards built in.
The Skematia Protocol fills that gap. It is to AI agents what JDBC was to Java applications — a uniform way to talk to a database, designed for the era of autonomous agents.
An isolated Firebird 5.0 database. Each project has its own .fdb file, its own API key, and its own data.
A credential (sk_...) that identifies a client and associates it with a project. Sent as a Bearer token with every request.
Any software that connects: an AI bot, a desktop application, a Python script, a Node.js service — anything that speaks HTTP.
The protocol supports two transports, both MUST be implemented:
MCP (Model Context Protocol) — Primary transport for AI agents. JSON-RPC over HTTP, stateless mode.
REST API — Standard HTTP endpoints for traditional clients.
Both transports share the same authentication, reach the same Firebird engine, and respect the same permissions.
Every server MUST publish an Agent Card at GET /.well-known/agent.json following the A2A Protocol v0.2.6.
| Field | Required | Description |
|---|---|---|
name | MUST | Service name |
description | MUST | Capability description |
url | MUST | Base URL |
version | MUST | Service version |
capabilities | MUST | Supported capabilities |
skills | MUST | Available operations |
authentication | SHOULD | Authentication scheme |
integration | SHOULD | Connection instructions per platform |
Example: skematia.com/.well-known/agent.json
Every request MUST include an API key:
Authorization: Bearer sk_XXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXX
| Level | Allowed operations |
|---|---|
read_only | SELECT only |
read_write | SELECT + INSERT, UPDATE, DELETE |
full | Everything including CREATE, ALTER, DROP |
Sliding window per API key. Response headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. Exceeding returns 429 Too Many Requests.
All endpoints use the /api/ prefix.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/data/{project_id}/{table} | Get rows |
| POST | /api/data/{project_id}/{table} | Insert record |
| PUT | /api/data/{project_id}/{table}/{id} | Update record |
| DELETE | /api/data/{project_id}/{table}/{id} | Delete record |
| POST | /api/data/{project_id}/raw-sql | Execute raw SQL |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/explorer/{id}/tables | List tables |
| GET | /api/explorer/{id}/schema | Full schema |
| GET | /api/explorer/{id}/schema/history | DDL change history |
| GET | /api/explorer/{id}/schema/suggestions | Improvement suggestions |
Blocked by default: DROP TABLE, DROP DATABASE, TRUNCATE, DELETE without WHERE. Server responds 403 Forbidden.
{
"error": "Descriptive message",
"error_type": "table_not_found",
"hint": "How to fix it",
"details": {}
}
Stateless HTTP transport at POST /mcp/. Each request is independent — no session management needed.
| Tool | Description |
|---|---|
list_projects | List accessible projects |
list_tables | List tables with counts |
get_schema | Full project schema |
execute_sql | Execute arbitrary SQL |
query | Natural language query |
insert_data | Insert records |
update_data | Update by primary key |
delete_data | Delete by primary key |
bulk_update | Bulk update with WHERE |
design_schema | AI-assisted schema design |
modify_schema | AI-assisted schema modification |
schema_history | DDL change history |
schema_suggestions | Schema improvement suggestions |
create_project | Create new project |
list_backups | List available backups |
If the API key is sent via Authorization header, it does not need to be included as a parameter in tool calls. Priority: explicit parameter > header.
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "execute_sql",
"arguments": {
"project_id": "abc123",
"sql": "SELECT * FROM CLIENTS ROWS 10"
}
},
"id": 1
}
Every DDL change is automatically recorded with timestamp, SQL executed, source, and agent. The history is immutable.
Automatic analysis with improvement suggestions: missing NOT NULL, missing UNIQUE, foreign keys without indexes, tables without primary keys. Each suggestion includes the SQL to apply it.
Each migration generates up (apply) and down (revert) scripts. The down script is calculated automatically.
| Concept | Firebird 5.0 | MySQL / PostgreSQL |
|---|---|---|
| Row limit | ROWS 10 | LIMIT 10 |
| Table alias | AS required | AS optional |
| Column names | Always UPPERCASE from RDB$ | Case-sensitive |
| INSERT with return | RETURNING supported since v2.1 | Supported |
Each project is an independent .fdb file: individual backup with gbak, portable, no cross-project interference.
Isolation: Each project has its own Firebird database. An API key can only access its bound project. Firebird is never exposed to the internet.
SQL Safety Guards: Destructive statements blocked by default (see section 5).
Audit Trail: All DDL operations recorded. DML operations optionally recorded.
Backups: Automatic daily backups, minimum 7-day retention, pre-restore backup required.
import requests
API_KEY = "sk_abc123_xxxxxxx"
PROJECT = "abc123-def456"
r = requests.post(
f"https://skematia.com/api/data/{PROJECT}/raw-sql",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"sql": "SELECT * FROM CLIENTS ROWS 10"}
)
print(r.json()["results"])
{
"mcpServers": {
"skematia": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://skematia.com/mcp/",
"--header",
"Authorization: Bearer sk_YOUR_API_KEY"
]
}
}
}
curl -X POST https://skematia.com/api/data/PROJECT_ID/raw-sql \
-H "Authorization: Bearer sk_abc123_xxxxxxx" \
-H "Content-Type: application/json" \
-d '{"sql": "SELECT * FROM CLIENTS ROWS 10"}'
const res = await fetch(`${API_URL}/data/${PROJECT}/raw-sql`, {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ sql: "SELECT * FROM CLIENTS ROWS 10" })
});
const data = await res.json();
Semantic versioning: MAJOR.MINOR.PATCH. A server declaring v1.x MUST maintain compatibility with all v1.0 clients. Deprecated endpoints remain functional for at least 6 months before removal in the next MAJOR version.
| Level | Requirements |
|---|---|
| Core | Agent Card + Auth + REST CRUD + Raw SQL |
| Schema | Core + versioning + advisor + migrations |
| AI | Schema + design_schema + modify_schema + NL query |
| Full | AI + MCP + backups + rate limiting + audit |
Why Firebird: 25+ years of development, ACID compliant, single-file portability, no per-use licensing, native replication in v5.0. Ideal for intermittent connectivity scenarios.
Why Stateless MCP: Eliminates Redis dependency for sessions. Horizontal scaling without coordination.
Why API Keys (not OAuth): Simple, predictable, works identically across all languages. OAuth can be added later without breaking existing auth.
Why REST + MCP: REST is universal. MCP is the emerging standard for AI agents. Supporting both allows legacy and modern clients to connect with equal ease.
| Version | Feature |
|---|---|
| v1.1 | Offline replication (local .fdb sync with cloud) |
| v1.2 | Row-Level Security (automatic filtering by user context) |
| v1.3 | Realtime (push via Firebird POST_EVENT + WebSockets) |
| v1.4 | Schema marketplace (pre-built schemas by industry) |
| v1.5 | Domain plugins (domain-specific validation and logic) |