Browse guides · SDK reference

ClosedMCP SDKs

Keep your existing tools. Wrap your MCP server so each request has a signed-in person.

Start with our SDK

Install our SDK. Wrap your MCP server. Every request now comes with the signed-in person.

v0.1.1
Install
npm install @closedmcp/sdk @modelcontextprotocol/sdk
TypeScript example
import { McpServer } from
  "@modelcontextprotocol/sdk/server/mcp.js";
import {
  closedMcpPerson,
  serveWithClosedMcp,
} from "@closedmcp/sdk";

serveWithClosedMcp(() => {
  const mcp = new McpServer({
    name: "hello", version: "1.0.0",
  });
  mcp.registerTool("hello", { inputSchema: {} },
    async () => ({ content: [{
      type: "text",
      text: `Hello ${closedMcpPerson().email}`,
    }] }));
  return mcp;
}, {
  resource: "https://example.com/mcp",
  allowedDomains: ["example.com"],
});

Package page ↗Source ↗

Settings and other integrations

MCP_URL is the exact public MCP endpoint you register in ClosedMCP, including its path.

ALLOWED_DOMAINS lists the customer company domains your server accepts. At least one is required.

The TypeScript SDK supports the official MCP SDK and FastMCP. Python supports the official FastMCP and standalone FastMCP 2. Go supports the official Go SDK and mark3labs. Rust supports rmcp.

For private deployments or local tests, set CLOSEDMCP_ORIGIN and CLOSEDMCP_JWKS_URL where supported.

Not using our SDK?

Each SDK is open source and small. Read how it checks a pass in TypeScript, Python, Go or Rust, and do the same in your own code.