Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lucid.foundation/llms.txt

Use this file to discover all available pages before exploring further.

MCPGate is Lucid’s tool gateway, exposing 88 built-in MCP (Model Context Protocol) servers plus tenant-registered external servers. It provides RBAC, audit logging, credential injection, and metering for every tool call.

How MCPGate Works

Agent request
  -> Bearer auth + RBAC scopes
  -> Plan enforcement + quota check
  -> Route to builtin:* (in-process) or registered server (StreamableHTTP/SSE)
  -> Tool metering
  -> Audit log
  -> Response

Making Tool Calls

curl -X POST https://mcpgate.lucid.foundation/v1/tools/call \
  -H "Authorization: Bearer lk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "server": "builtin:github",
    "tool": "search_repositories",
    "arguments": {
      "query": "lucid AI",
      "per_page": 5
    }
  }'

Built-in Servers

MCPGate ships with 88 built-in MCP servers covering common integrations:
ServerCategoryCapabilities
builtin:githubDev ToolsRepos, issues, PRs, search
builtin:slackCommunicationMessages, channels, users
builtin:notionProductivityPages, databases, search
builtin:coingeckoFinancePrices, charts, market data
builtin:web-searchSearchWeb search, scraping

Credential Injection

MCPGate handles authentication for tool servers through a pluggable credential adapter system:
AdapterSourceUse Case
EnvVarAdapterEnvironment variablesSimple token-based auth (e.g., GITHUB_TOKEN)
DatabaseAdaptercredential_store tablePer-tenant stored credentials
CompositeAdapterChains multiple adaptersProduction: tries each adapter, first match wins
NangoAdapterNango OAuth flowsFull OAuth integration (SaaS only)
Agents never handle raw credentials — MCPGate injects them at call time.

Registering External Servers

Tenants on the Growth plan or above can register their own MCP servers:
curl -X POST https://control-plane.lucid.foundation/admin/tenants/my-tenant/servers \
  -H "X-Admin-Key: ..." \
  -d '{
    "name": "my-custom-server",
    "url": "https://my-server.com/mcp",
    "transport": "streamable-http",
    "scopes": ["my-tool:read", "my-tool:write"]
  }'

RBAC Scopes

API keys can be scoped to specific servers and tools:
{
  "scopes": ["builtin:github:*", "builtin:slack:send_message"]
}
  • builtin:github:* — access to all GitHub tools
  • builtin:slack:send_message — access to only the Slack send_message tool

Audit Logging

Every tool call is logged to the mcpgate_audit_log table with tenant identity, server/tool name, redacted input arguments, response status, latency, and timestamp.

SDK Usage

import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const sdk = new RaijinLabsLucidAi({
  serverURL: "https://api.lucid.foundation",
  security: { bearerAuth: process.env.LUCID_API_KEY },
});

const result = await sdk.tools.call({
  server: 'builtin:github',
  tool: 'search_repositories',
  arguments: { query: 'lucid AI' },
});