Skip to main content
Glama

Sola

Sola is an MCP gateway. A client connects to one Streamable HTTP endpoint. The model sees four tools: discover_servers, discover_tools, get_tool_schema, and invoke_tool.

You install registries of the backend operations the gateway may call. Sola checks the allowlist, then runs the matching catalog tool through invoke_tool.

Install

Node.js 20+. Peer dependency: zod.

npm install sola-mcp-gateway zod

Dependencies: @modelcontextprotocol/sdk, express.

Related MCP server: mcp-router

Usage

1. Define a catalog

import { z } from 'zod';
import {
  bindCatalogTools,
  compileServer,
  success,
  type CatalogTool,
} from 'sola-mcp-gateway';

const ping: CatalogTool = {
  name: 'ping',
  title: 'Ping',
  description: 'Check that the demo backend is reachable',
  enabled: true,
  scopes: ['demo:read'],
  input: z.object({}).strict(),
  schema: { type: 'object', properties: {}, additionalProperties: false },
  execute: async () => success({ ok: true }),
};

const server = compileServer({
  id: 'demo',
  title: 'Demo',
  description: 'Example catalog',
  owner: 'example',
  kind: 'catalog',
  enabled: true,
  access: { scopes: ['demo:read'], clients: ['*'] },
}, [ping]);

const tools = bindCatalogTools([ping], () => ({
  request: async () => ({}),
}));

await tools.invoke({
  sessionHash: 's1',
  subject: 'user',
  credentials: {},
  scopes: ['demo:read'],
  expiresAt: Math.floor(Date.now() / 1000) + 3600,
}, 'ping', {});

Each tool has a public name, JSON Schema, Zod input, and either execute or request + normalize. If a scope ends in :write, add write metadata. Details: spec/02-catalog.md.

2. Serve it

import express from 'express';
import {
  attachSola,
  findCatalog,
  useRegistries,
  writeScopeNames,
} from 'sola-mcp-gateway';

useRegistries([{
  id: 'demo',
  catalog: { id: 'demo', server, ...tools },
}]);

const app = express();
app.use(express.json());

attachSola(app, {
  publicBaseUrl: process.env.PUBLIC_BASE_URL!,
  identity: { serviceName: 'demo', resourceName: 'Demo MCP' },
  host: {
    registry: { version: '1', servers: [server] },
    writesEnabled: false,
    writeScopes: writeScopeNames(),
    getToolSchema: (serverId, toolName) =>
      findCatalog(serverId)?.getToolSchema(toolName),
    invoke: (session, serverId, toolName, raw) =>
      findCatalog(serverId)!.invoke(session, toolName, raw),
  },
  sessions, // SolaSessionRuntime: createSession, resolveSession, revokeSession
  oauth,    // SolaOAuthRuntime: clients, authorization codes, refresh grants
  transport: { sse: false },
});

attachSola is the gateway. It mounts /mcp and the OAuth 2.1 / PKCE routes. Pass a SolaSessionRuntime and a SolaOAuthRuntime.

transport: { sse: false } is for request/response hosts. Clients POST to /mcp.

A client signs in, then calls discover_servers, discover_tools, and invoke_tool. Those calls stay on the gateway. invoke_tool runs the matching catalog tool.

Spec

Catalogs are TypeScript (CatalogTool). Full spec: spec/.

Document

Topic

01-overview

Roles and MCP surface

02-catalog

Tools, codecs, HTTP steps

03-discovery

The four public tools

04-writes

Confirmation and idempotency

05-security

Tokens and allowlisting

06-adapters

Drafting a catalog from another spec

Versioning

CHANGELOG.md

Contributing

CONTRIBUTING.md

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables connecting any number of OpenAPI, GraphQL, and MCP servers to MCP clients through a single local endpoint, with a web UI for management, unified tool exposure, and policy controls.
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables clients to connect once and access the union of multiple backend MCP servers' tools through a single unified interface, with namespaced tool routing, capability search, and health isolation.
      MIT