Gateco MCP server
Give Claude Desktop, Cursor, and any Model Context Protocol host policy-enforced access to your organization's knowledge bases. The Gateco MCP server wraps the full retrieval, answer synthesis, and access simulation API surface into six tools — all returning only what the requesting principal is authorized to see.
Growth+ plan required The MCP server is included in Growth and Enterprise plans.
Install
The MCP server is an optional extra on the gateco Python package. Install it with the [mcp] extra:
pip install "gateco[mcp]"
This pulls in mcp>=1.8,<2 (FastMCP) alongside the core SDK and CLI. Users who only need the SDK or CLI are unaffected — the mcp dependency is never installed unless explicitly requested.
After installation, two entry points are available:
gateco mcp serve # via the unified CLI gateco-mcp # direct entry point for MCP host configs
Both start the MCP server on stdio transport. MCP hosts (Claude Desktop, Cursor) manage the process lifecycle — you never run it directly.
Credentials
The MCP server resolves credentials in this order:
GATECO_API_KEYenvironment variable — recommended for MCP host configs. Set it in theenvblock of your host configuration (see below).GATECO_BASE_URLenvironment variable — override the API endpoint. Defaults tohttps://api.gateco.ai. Set this if you are on an Enterprise private data plane.~/.gateco/credentials.json— written bygateco login. Used as a fallback when neither env var is set. Not recommended for MCP host configs — prefer the env var for explicit, auditable credential binding.
Generate an API key in your Gateco dashboard under Settings → API Keys.
Claude Desktop setup
Add Gateco to your Claude Desktop MCP server config. The config file location depends on your OS:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add a gateco entry under mcpServers:
{
"mcpServers": {
"gateco": {
"command": "gateco-mcp",
"env": {
"GATECO_API_KEY": "gco_your_api_key_here",
"GATECO_BASE_URL": "https://api.gateco.ai"
}
}
}
}Restart Claude Desktop after saving. The six Gateco tools appear in the tool selector. Claude will call them automatically when answering questions that require searching your knowledge base.
If gateco-mcp is not on your PATH (e.g., installed in a virtualenv), use the full path: /path/to/venv/bin/gateco-mcp.
Cursor setup
Cursor reads MCP server configs from ~/.cursor/mcp.json (global) or .cursor/mcp.json in your project root (project-scoped).
{
"mcpServers": {
"gateco": {
"command": "gateco-mcp",
"env": {
"GATECO_API_KEY": "gco_your_api_key_here",
"GATECO_BASE_URL": "https://api.gateco.ai"
}
}
}
}Open Cursor Settings → Features → MCP to verify the server is listed and shows a green status indicator. Project-scoped configs take precedence over the global config when both are present.
Use the project-scoped config (.cursor/mcp.json) to bind different API keys per codebase — useful when different projects connect to different Gateco organizations or environments.
Other MCP hosts
Any MCP-compatible host that supports stdio transport can use the Gateco server. The command is always gateco-mcp (or the full path to the binary). Pass GATECO_API_KEY and optionally GATECO_BASE_URL as environment variables.
For programmatic use or testing, you can also start the server directly:
GATECO_API_KEY=gco_your_key gateco mcp serve
Tools reference
The Gateco MCP server exposes six tools. All tools return human-readable markdown — not raw JSON. Denied content is never included in tool output; only denial reasons and counts are surfaced.
gateco_retrieveAll plansRate limit: 60/min per orgPermission-aware retrieval across a connector. Searches using vector, keyword, hybrid, or grep mode, then applies your active policies. Denied chunks are never returned — not even in truncated form.
| Parameter | Required | Notes |
|---|---|---|
| connector_id | Yes | UUID of the connector to search |
| query | Yes | Search query text |
| principal_id | No | Identity UUID. Use this or email — not both |
| No | Resolves to a principal automatically. Use this or principal_id | |
| top_k | No | Max results (default: 10) |
| search_mode | No | "vector" (default), "keyword", "hybrid", or "grep" |
| alpha | No | Hybrid weight 0.0–1.0. Hybrid mode only. |
| pattern_type | No | "substring" or "regex". Grep mode only. |
| case_sensitive | No | Boolean. Grep mode only. |
gateco_askGrowth+Rate limit: 20/min per orgGrounded answer synthesis. Retrieves policy-filtered chunks, then synthesizes a natural language answer with citations. Denied chunks are never included in the LLM context — the model only sees what the principal is allowed to access.
| Parameter | Required | Notes |
|---|---|---|
| connector_id | Yes | Connector to search |
| query | Yes | Natural language question |
| principal_id | No | Identity UUID. Use this or email |
| No | Resolves to a principal automatically | |
| top_k | No | Max context chunks (default: 15) |
| search_mode | No | "vector", "keyword", or "hybrid" (grep not supported for answer synthesis) |
| alpha | No | Hybrid weight 0.0–1.0. Hybrid mode only. |
gateco_check_accessGrowth+Rate limit: 10/min per orgDry-run access simulation. Evaluates what a principal can and cannot access without performing an actual retrieval. Returns allowed/denied counts and per-resource policy traces. Useful for debugging policy configurations before they go live.
| Parameter | Required | Notes |
|---|---|---|
| principal_id | Yes | Identity to simulate for |
| connector_id | No | Scope to a specific connector |
| resource_ids | No | Specific resource UUIDs to evaluate |
gateco_list_connectorsAll plansList configured connectors. Returns connector names, types, policy readiness levels (L0–L4), connection status, and UUIDs. Use this to discover connector IDs for use in other tools.
| Parameter | Required | Notes |
|---|---|---|
| page | No | Page number (default: 1) |
| per_page | No | Items per page (default: 20) |
gateco_list_principalsAll plansList identity principals known to Gateco. Returns names, emails, groups, roles, and UUIDs. Use this to discover principal IDs synced from your identity provider.
| Parameter | Required | Notes |
|---|---|---|
| page | No | Page number (default: 1) |
| per_page | No | Items per page (default: 20) |
gateco_resolve_principalAll plansResolve a principal by email or provider-native subject ID (e.g., an Okta user ID, Google sub claim, or AWS external ID). Returns principal details including groups, roles, and attributes. Returns an error if the identity is not synced or is inactive.
| Parameter | Required | Notes |
|---|---|---|
| No | Email address to resolve. At least one of email or provider_subject required. | |
| provider_subject | No | Provider-native subject identifier |
| identity_provider_id | No | Optional UUID to scope lookup to a specific IDP |
Passing identity to retrieval tools
gateco_retrieve and gateco_ask require either a principal_id (UUID) or an email address. When you pass an email, the MCP server resolves it to a principal UUID automatically before executing the retrieval — no pre-resolution step in the agent runtime.
Option A — pass email (recommended for delegated identity)
The AI passes the authenticated user's email. Gateco resolves it against principals synced from your IDP. Returns an error if the email is not synced or is inactive — never falls back silently to a default identity.
Option B — pass principal_id (for bot / service accounts)
Pass the UUID of a service account principal directly. Suitable for public FAQ bots or anonymous assistants where every user gets the same access level. Find the UUID via gateco_list_principals or the Principals page in the dashboard.
See Agent identity patterns for a full explanation of the three integration patterns — including how to handle external users (customers, partners) who don't have a corporate directory entry.
How policy enforcement works through MCP
Every call to gateco_retrieve or gateco_ask runs the full Gateco policy engine before returning results to the MCP host. The sequence:
- Search the connector using the requested mode (vector / keyword / hybrid / grep)
- Resolve the requesting principal and load their IDP-synced attributes
- Evaluate all active policies against each candidate chunk
- Return only the allowed chunks — denied chunks are dropped, not redacted
- Write a
SecuredRetrievalaudit event with full policy trace
The MCP host (and therefore the LLM) never sees denied content — not even a truncated excerpt. Denial reasons and counts are included in the tool output so the model can surface a meaningful response rather than silently omitting data.
Rate limits apply per organization: 60 retrievals/min for gateco_retrieve, 20/min for gateco_ask, and 10/min for gateco_check_access. Exceeded limits return a rate_limited error string that the MCP host surfaces to the user.
Troubleshooting
Server listed in Claude Desktop but shows "failed" status
Check that gateco-mcp is on PATH and the GATECO_API_KEY is set correctly in the env block. Run gateco-mcp from your terminal to see the startup error.
gateco_retrieve returns "Authentication failed"
The API key is missing or invalid. Verify GATECO_API_KEY in your MCP host config. Generate a new key at Settings → API Keys in the dashboard.
gateco_ask returns "Entitlement required. Requires Growth plan"
gateco_ask and gateco_check_access require Growth or Enterprise plan. gateco_retrieve, gateco_list_connectors, gateco_list_principals, and gateco_resolve_principal work on all plans.
gateco_resolve_principal returns "Not found"
The email is not synced to Gateco. Ensure IDP sync has completed (check the Identity Providers page). resolve() is read-only — it never creates principals.
"install gateco[mcp]" error when running gateco mcp serve
The MCP extra is not installed. Run: pip install "gateco[mcp]"
Still stuck? Contact support with your Gateco organization ID and the error message from the MCP host log.