MCP Integration Guide¶
Antska makes your databases accessible to Large Language Models (LLMs) through the Model Context Protocol (MCP). This guide shows you how to use these capabilities in your applications.
What is the Model Context Protocol?¶
The Model Context Protocol (MCP) is an open standard that allows LLMs to interact with external tools and data. Think of it as a universal connector between AI and data sources.
With MCP, your LLM applications can:
- Discover what databases and tools are available
- Query those databases directly
- Receive structured data in a consistent format
- Maintain context across multiple interactions
Antska implements MCP so you can connect any compatible LLM to your databases without custom integration work.
Connecting LLMs to Databases¶
Antska connects LLMs to databases through a simple, standardized interface:

- LLM clients send requests to Antska's MCP server
- Antska processes those requests and connects to the appropriate database
- Databases return data which Antska formats and returns to the client
Antska supports real-time data streaming using Server-Sent Events (SSE), making it ideal for interactive LLM applications.
Getting Started¶
1. Start the Antska Server¶
1 2 3 4 5 | |
2. Register a Database¶
1 2 3 4 5 6 7 | |
3. Integrate with Your LLM Application¶
Antska provides two integration methods:
Option A: Direct HTTP Requests¶
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Option B: Server-Sent Events for Streaming¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Available Tools¶
Antska provides these database tools for LLMs:
| Tool | Description | Example Use |
|---|---|---|
execute_query |
Run SQL queries | "Show me the top 10 users by activity" |
list_schemas |
List available schemas | "What schemas are in this database?" |
list_tables |
List tables in a schema | "Show me tables in the public schema" |
get_table_info |
Get table structure | "What columns are in the users table?" |
Example: Database Exploration Workflow¶
Here's how an LLM might explore a database using Antska:
-
List available databases
1GET /api/v1/databases -
Discover schemas in a database
1 2 3 4
POST /api/v1/tools/list_schemas { "database": "my-postgres" } -
Find tables in a schema
1 2 3 4 5
POST /api/v1/tools/list_tables { "database": "my-postgres", "schema": "public" } -
Examine table structure
1 2 3 4 5 6
POST /api/v1/tools/get_table_info { "database": "my-postgres", "schema": "public", "table": "users" } -
Query the table
1 2 3 4 5
POST /api/v1/tools/execute_query { "database": "my-postgres", "query": "SELECT id, name, email FROM users WHERE active = true LIMIT 5" }
Best Practices¶
To get the most out of Antska with LLMs:
- Start simple: Begin with basic database queries before complex operations
- Use limits: Always limit query results to prevent overwhelming responses
- Handle errors: Check status codes and error messages in responses
- Stream large results: Use SSE for queries that might return large datasets
- Cache metadata: Store database structure information to reduce repeated calls
- Secure connections: Use authentication and encryption in production environments
Need Help?¶
- Documentation: Full API Reference
- Examples: See example clients
- Community: Join our Discord
- Issues: Report bugs on GitHub