Documentation
Build secure MCP surfaces from APIs and databases
Use this page as the practical setup path for Swagger to MCP Gateway: choose the source, publish a small MCP surface, test it in Gateway Chat, connect external MCP clients, then operate real tool traffic with validation and logs.
System map
Sources
OpenAPI spec
REST operations
Database scope
Tables and columns
Gateway boundary
Auth
Gateway token and owner scope
Validation
Policy before execution
Logs
Redacted tool traffic
MCP clients
Claude / Cursor
HTTP MCP config
VS Code / cURL
tools/list smoke test
Gateway Chat
Test with tool calls
Product concepts
How the Gateway fits together
The product pages explain why the Gateway exists. The docs explain the objects you configure and the sequence you use in production.
MCP surface
Tool catalog
Gateway boundary
Choose your path
Start with the source your AI client needs
Use the source type to decide which setup path to follow. Mixed workflows can use both source kinds through separate MCP surfaces.
OpenAPI to MCP
Database to MCP
Secure MCP Gateway
OpenAPI guide
Publish a Swagger/OpenAPI API as MCP tools
The OpenAPI flow turns HTTP operations into curated MCP tools. The important work is not only import; it is deciding which operations should become agent-callable tools and writing descriptions that help the model choose correctly.
Step 1
Import the OpenAPI source
Step 2
Review generated tools
Step 3
Publish and use the MCP URL
Publish fewer tools than the API contains
Write agent-ready descriptions
Test with a real question
Example agent-ready OpenAPI tool contract
1{2 "name": "search_orders",3 "description": "Search approved orders by customer, status, or date range before support follow-up. Use limit to keep the result small.",4 "inputSchema": {5 "type": "object",6 "properties": {7 "customerId": { "type": "string" },8 "status": { "type": "string" },9 "fromDate": { "type": "string", "format": "date" },10 "limit": { "type": "integer", "maximum": 50 }11 },12 "required": ["status"]13 }14}OpenAPI flow
Paste OpenAPI URL
https://api.example.com/openapi.json
get_order_by_id
GET /orders/{id}
create_support_ticket
POST /tickets
search_customers
GET /customers/search
MCP endpoint
/mcp/acme-orders
OpenAPI security boundary
Database guide
Publish a database scope as safe MCP tools
Database to MCP separates schema understanding from query execution. Schema tools are metadata-only, while QueryPlan or SQL executor tools are validated before any database query runs.
Step 1
Connect PostgreSQL or SQL Server
Step 2
Run metadata discovery
Step 3
Create and publish a scope
Design scopes by workflow
Tune column permissions
Use schema tools first
Database flow
support_readonly
PostgreSQL scope · 3 tables published
customers
9 columns · email masked
orders
8 columns · read-only
tickets
7 columns · support scope
Validation path
Every executor call is checked before SQL runs.
Recommended QueryPlan shape
1{2 "version": "1.0",3 "description": "Order count by status",4 "from": {5 "table": "Orders",6 "alias": "o"7 },8 "select": [9 {10 "column": {11 "tableAlias": "o",12 "column": "Status"13 },14 "alias": "Status"15 },16 {17 "aggregate": {18 "function": "COUNT",19 "tableAlias": "o",20 "column": "Id"21 },22 "alias": "OrderCount"23 }24 ],25 "groupBy": [26 {27 "tableAlias": "o",28 "column": "Status"29 }30 ],31 "orderBy": [32 {33 "alias": "OrderCount",34 "direction": "desc"35 }36 ],37 "limit": 10038}Advanced SQL mode payload
1{2 "sql": "SELECT o.Status, COUNT(o.Id) AS OrderCount FROM sales.Orders AS o WHERE o.CreatedAt >= @fromDate GROUP BY o.Status ORDER BY OrderCount DESC LIMIT 100",3 "parameters": [4 {5 "name": "fromDate",6 "type": "date",7 "value": "2026-01-01"8 }9 ]10}Database execution rules
MCP clients
Connect Claude, Cursor, VS Code, or cURL
After a surface is published, every MCP client needs the same two things: the MCP URL and a Gateway token. Use tools/list as the first smoke test before asking a model to call tools.
Client configuration
1{2 "mcpServers": {3 "gateway": {4 "type": "http",5 "url": "<MCP_URL>",6 "headers": {7 "Authorization": "Bearer <GATEWAY_TOKEN>"8 }9 }10 }11}Smoke-test tools/list
1curl -X POST "<MCP_URL>" \2 -H "Content-Type: application/json" \3 -H "Authorization: Bearer <GATEWAY_TOKEN>" \4 -d '{5 "jsonrpc": "2.0",6 "id": "1",7 "method": "tools/list",8 "params": {}9 }'Smoke-test a tool call
1curl -X POST "<MCP_URL>" \2 -H "Content-Type: application/json" \3 -H "Authorization: Bearer <GATEWAY_TOKEN>" \4 -d '{5 "jsonrpc": "2.0",6 "id": "2",7 "method": "tools/call",8 "params": {9 "name": "search_orders",10 "arguments": {11 "status": "open",12 "limit": 1013 }14 }15 }'Client testing
MCP client config
{
"url": "<MCP_URL>",
"headers": {
"Authorization": "Bearer <TOKEN>"
}
}Gateway Chat
Check customer order status and summarize related support tickets.
Selected tools
Create a token
Verify tools/list
Start with narrow scopes
MCP URL examples
Built-in chat
Talk to your MCP surfaces inside the Gateway
Gateway Chat is both a product feature and a validation tool. Use it to see whether the published surface is understandable before you hand the MCP URL to external clients.
Select published surfaces
Test tool choice
Follow database call order
Use chat for fast validation
Built-in chat is the fastest way to verify that a surface is understandable and callable. For production integrations, external clients still use the MCP URL and Gateway token, but the same Gateway validation path applies.
Security model
Gateway enforcement rules
The Gateway is the trust boundary. LLMs and orchestration frameworks may propose actions, but Gateway validation decides what can execute and what is recorded.
OpenAPI calls
Database calls
Secrets and redaction
Limits and entitlements
Descriptions are guidance
Public docs stay public-safe
Operations
Run MCP surfaces like production traffic
Once MCP clients call real systems, the Gateway should be operated like any other production integration layer: monitored, limited, reviewed, and easy to roll back.
Usage dashboards
Audit logs
Change control
Operate safely
Gateway auth
Token checked before tools/list and callTool.
Policy validation
Scope and publication state enforced.
Redacted logs
Secrets and sensitive values are masked.
Change control
Pause, hide, or unpublish without client code changes.
Usage snapshot
Audit event
callTool allowed · arguments redacted · latency 284ms
Production checklist
Review before real users and real clients
Use this checklist before advertising a surface, connecting an external client, or allowing a team to depend on the MCP endpoint.
Surface is intentionally small
Descriptions are written for agents
Gateway Chat test is clean
Credentials are server-side
Logs and limits are checked
Rollback path is obvious
Troubleshooting
Common setup checks
Most setup issues come from the MCP URL, token, publication state, or an intentionally blocked policy rule.
No tools returned
401 or auth failures
Database validation failed
Unexpected tool choice
Keep public docs safe