Context7
Up-to-date docs for AI agents
作者提供的说明(英文原文)
Permission-aware retrieval for AI systems: policy-enforced access to organizational knowledge.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
GATECO_API_KEY, GATECO_BASE_URL标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"gateco": {
"command": "uvx",
"args": [
"gateco"
],
"env": {
"GATECO_API_KEY": "your-value",
"GATECO_BASE_URL": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add gateco --env GATECO_API_KEY=your-value --env GATECO_BASE_URL=your-value -- uvx gateco运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"gateco": {
"command": "uvx",
"args": [
"gateco"
],
"env": {
"GATECO_API_KEY": "your-value",
"GATECO_BASE_URL": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"gateco": {
"type": "stdio",
"command": "uvx",
"args": [
"gateco"
],
"env": {
"GATECO_API_KEY": "your-value",
"GATECO_BASE_URL": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
GATECO_BASE_URL env这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日
注册名称已通过域名 gateco.ai 验证(注册中心会核实域名所有权)
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
你需要填写:GATECO_API_KEY
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(1.13.0)于33天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
同一分类中有:Context7, Codebase Memory, Exa
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Official Python client for the Gateco API — permission-aware retrieval for AI systems.
Without Gateco, when an employee asks your AI assistant "What is the CEO's salary?", the RAG pipeline returns the salary from a leaked HR document.
With Gateco:
from gateco_sdk import GatecoClient
client = GatecoClient("https://api.gateco.ai") client.login("you@yourco.com", "...")
result = client.retrievals.execute( query="What is the CEO's salary?", principal_id="user_james_wu", connector_id="connector_hr_docs", search_mode="hybrid", )
Gateco sits between your AI agent and your vector store. Every retrieval is evaluated against your access policies before any content reaches the model.
pip install gateco
For MCP server support (Claude Desktop, Cursor, etc.):
pip install gateco[mcp]
Gateco API keys use the format gck_ _ (e.g. gck_live_abc123...).
Generate keys via the dashboard or via client.api_keys.create(name="my-service").
from gateco_sdk import AsyncGatecoClient, GatecoClient
client = AsyncGatecoClient("https://api.gateco.ai", api_key="gck_live_abc123...")
client = GatecoClient("https://api.gateco.ai", api_key="gck_live_abc123...")
client = GatecoClient("https://api.gateco.ai") client.login("user@example.com", "password")
The API key is sent as the X-API-Key header on every request. Set it via the GATECO_API_KEY environment variable when using the CLI or MCP server. The key takes precedence over a stored login.
No credential at all? Since 1.13.0 a client constructed with no api_key, no GATECO_API_KEY and no access_token reads the session that gateco login stored in ~/.gateco/credentials.json (and its base_url), and writes refreshed tokens back. One login on a machine serves the CLI, the MCP server and your own scripts; do not copy the file between machines, because refresh rotates and the two copies would revoke each other.
A key carries explicit scopes, chosen when it is created (Settings > API Keys, every plan). Everything not listed here needs a user session (gateco login or client.login(...)); a key sent there gets 401 AUTH_JWT_REQUIRED, and a key without the needed scope gets 403 API_KEY_SCOPE_MISSING.
| Scope | Routes |
|---|---|
retrieve | POST /api/retrievals/execute, POST /api/retrievals/filter, POST /api/answers/execute, GET /api/principals, GET /api/principals/:id, POST /api/principals/resolve, GET /api/groups (since 2026-10-02), GET /api/connectors (id, name, type, status) |
ingest | POST /api/v1/ingest, /batch, /file, /files, DELETE /api/v1/resources/:id, /api/v1/ingest/jobs* |
relationships | POST, GET, DELETE /api/relationships |
principals | POST, PATCH, DELETE /api/principals (local directory) |
| any key | GET /api/users/me (reports the key's name and scopes) |
Session only: policies, connector create/update/delete and their search and ingestion configs, identity providers, API-key management, audit, retrieval history, billing, the access simulator, classification suggestions.
import asyncio
from gateco_sdk import AsyncGatecoClient
async def main(): async with AsyncGatecoClient( "https://api.gateco.ai", api_key="gck_live_abc123...", ) as client:
result = await client.retrievals.execute( query="What is the CEO's salary?", principal_id="user_james_wu", connector_id="connector_hr_docs", search_mode="hybrid", alpha=0.7, # 70% vector weight, 30% keyword top_k=5, )
for chunk in result.allowed_chunks: print(f"[ALLOWED] {chunk.resource_id} score={chunk.score}")
print(f"Denied: {result.denied_count} chunk(s)")
asyncio.run(main())
from gateco_sdk import GatecoClient
with GatecoClient("https://api.gateco.ai", api_key="gck_live_abc123...") as client: result = client.retrievals.execute( query="What is the CEO's salary?", principal_id="user_james_wu", connector_id="connector_hr_docs", search_mode="hybrid", ) print(result.decision) # "DENIED"
Every namespace, and every method on it, is available on both AsyncGatecoClient (async) and GatecoClient (sync); tests/test_sync_parity.py fails the build if the two drift.
| Namespace | Description |
|---|---|
client.answers | Grounded answer synthesis with policy-filtered citations (Team+) |
client.api_keys | Create, list, delete, and rotate API keys |
client.audit | Audit log listing and CSV export |
client.auth | Login, signup, token refresh, logout |
client.billing | Plans, usage meters, invoices, subscription, Stripe checkout and portal |
client.connectors | Connector CRUD, connection testing, search/ingestion config, coverage, classification suggestions |
client.dashboard | Aggregated dashboard statistics with optional sparklines |
client.data_catalog | Gated resource listing and metadata updates |
client.groups | Read-only groups directory with live member counts |
client.identity_providers | Identity provider CRUD and sync (Okta, Azure Entra ID, AWS IAM, GCP) |
client.ingest | Single-document, batch, and file ingestion (Tier 1 connectors) |
client.onboarding | Onboarding status (6 computed steps) and checklist dismissal |
client.pipelines | Pipeline CRUD and run management |
client.policies | Policy CRUD, lifecycle (activate/archive), and templates |
client.principals | Principal listing, detail, and resolution by email or provider subject |
client.relationships | REBAC direct-relation CRUD — create, list, delete 1-hop tuples (Team+) |
client.retroactive | Retroactive vector registration for existing connectors |
client.retrievals | Permission-gated retrieval execution, policy filter, and history |
client.simulator | Dry-run, live-preview, and batch-preview access simulation (Growth+) |
client.sources | Content-source connections (Drive, SharePoint, Confluence, Notion): create, test, ACL coverage |
client.users | Current user profile — get_me(), update_me(name) |
# Vector search (default) — semantic similarity
result = await client.retrievals.execute( query="quarterly earnings", principal_id="...", connector_id="...", )
result = await client.retrievals.execute( query="quarterly earnings", principal_id="...", connector_id="...", search_mode="keyword", )
result = await client.retrievals.execute( query="quarterly earnings", principal_id="...", connector_id="...", search_mode="hybrid", alpha=0.5, # 1.0 = all-vector, 0.0 = all-keyword )
result = await client.retrievals.execute( query="ERR-4021", principal_id="...", connector_id="...", search_mode="grep", pattern_type="regex", case_sensitive=False, )
# Create a key — the plaintext is returned exactly once
key_info = await client.api_keys.create(name="prod-worker") print(key_info["key"]) # gck_live_abc123... (store this securely) print(key_info["prefix"]) # gck_live_abc
keys = await client.api_keys.list()
new_key = await client.api_keys.rotate(key_id="key-uuid-here")
await client.api_keys.delete(key_id="key-uuid-here")
# Create a direct relation: Alice owns resource R
rel = await client.relationships.create( subject_principal_id="principal-uuid", relation_name="owner_of", object_resource_id="resource-uuid", ) print(rel["id"])
rels = await client.relationships.list( subject_id="principal-uuid", relation="owner_of", )
await client.relationships.delete(relationship_id=rel["id"])
Use relation. as a policy condition field to gate access on the existence of a tuple:
# Policy rule: allow access when principal has owner_of relation on the resource
rule = {"field": "relation.owner_of", "operator": "eq", "value": True}
# Check which onboarding steps are complete
status = await client.onboarding.status() for step in status["steps"]: print(f"{step['name']:30s} {step['status']}")
await client.onboarding.dismiss()
# Resolve a principal by email (read-only — never creates)
principal = await client.principals.resolve(email="alice@company.com")
principal = await client.principals.resolve(provider_subject="okta-user-123")
principal = await client.principals.resolve( email="alice@company.com", identity_provider_id="idp-uuid-here", )
answer = await client.answers.execute(
query="Summarise the Q4 revenue results.", principal_id="user_alice", connector_id="connector_finance_docs", search_mode="hybrid", )
print(answer.answer_text) # LLM-generated answer from allowed chunks only print(answer.outcome) # "answered" | "no_access" | "insufficient_context" for citation in answer.citations: print(f" [{citation.score:.2f}] {citation.resource_id}")
# Create an RBAC policy
policy = await client.policies.create( name="Engineering read-only", description="Allow engineering group to read internal resources", type="rbac", effect="allow", rules=[{ "description": "Engineering group members", "effect": "allow", "conditions": [{"field": "principal.groups", "operator": "contains", "value": "engineering"}], "priority": 1, }], resource_selectors=[{"field": "resource.classification", "op": "lte", "value": "internal"}], )
Policy validation rules:
resource., principal., or relation. prefix. Bare field names (e.g., "classification") are rejected with 422 — they silently resolve against the principal rather than the resource.resource_selectors require apply_to_all_resources=True in the request body to opt into matching all resources explicitly.result = await client.retrievals.execute(
query="quarterly earnings", principal_id="user_alice", connector_id="connector_finance_docs"
只显示了开头部分;其余内容请在仓库中阅读