Skip to content

Connect to an MCP server

Superhuman Go only

Connecting to an MCP server is only supported for connectors installed in Go.

The Model Context Protocol (MCP) offers a standard way to expose resources and tools to LLMs. Many apps are adopting this standard and hosting MCP servers, making it easy for AI tools to interact with their data and features.

Connectors can integrate with MCP servers to take advantage of the tools provided. Adding an MCP server to a connector requires only a few lines of code, specifying an internal name and the server's URL.

pack.addMCPServer({
  name: "Icons8",
  endpointUrl: "https://mcp.icons8.com/mcp/",
});

Only one MCP server per-connector

A connector is limited to connecting to only a single MCP server. The platform expects each connector to connect to a single external application, and users wishing to work across multiple applications would install multiple connectors.

Compatibility

MCP is a large, rapidly evolving standard, and not all MCP servers are compatible with the platform.

  • Hosted servers only - Local MCP servers (installed via npm, etc) are not supported.
  • Streamable HTTP transport only - Most MCP servers use the more modern Streamable HTTP transport, but the older and now deprecated HTTP+SSE transport is not supported.

Additionally, not all MCP features are supported by the platform.

  • Tools only - Although MCP servers can provide additional types of resources, connectors can only use the tools.
  • No streaming support - Connectors must wait for the complete response from the MCP server, and cannot take advantage of streamed responses.

Network access

As with all network traffic, MCP requests go through the Fetcher, and the domains used must be declared in advance. While MCP servers are often hosted on a subdomain, it's a best practice to declare the root domain to allow for future expansion to other endpoints.

pack.addMCPServer({
  name: "Icons8",
  endpointUrl: "https://mcp.icons8.com/mcp/",
});

pack.addNetworkDomain("icons8.com");

Authentication

Requests to MCP servers use the same authentication system as the rest of the platform, supporting common patterns like static tokens or OAuth2. Your code must declare the type of auth used.

Many MCP servers use OAuth2 with dynamic client registration (DCR).

pack.addMCPServer({
  name: "Example",
  endpointUrl: "https://mcp.example.com/mcp",
});

pack.setUserAuthentication({
  type: sdk.AuthenticationType.OAuth2,
  useDynamicClientRegistration: true,
  useProofKeyForCodeExchange: true,
  scopes: ["read", "write"],
});

For MCP servers that use OAuth2 but don't support DCR, you can manually specify the OAuth URLs in your code. You'll also need to manually register an application in their portal and upload client credentials on the Settings screen of the Pack Studio.

pack.addMCPServer({
  name: "Example",
  endpointUrl: "https://mcp.example.com/mcp",
});

pack.setUserAuthentication({
  type: sdk.AuthenticationType.OAuth2,
  authorizationUrl: "https://example.com/authorize",
  tokenUrl: "https://example.com/token",
  useProofKeyForCodeExchange: true,
  scopes: ["read", "write"],
});
pack.addMCPServer({
  name: "Example",
  endpointUrl: "https://mcp.example.com/mcp",
});

pack.setUserAuthentication({
  type: sdk.AuthenticationType.HeaderBearerToken,
});
pack.addMCPServer({
  name: "Example",
  endpointUrl: "https://mcp.example.com/mcp",
});

pack.setUserAuthentication({
  type: sdk.AuthenticationType.QueryParamToken,
  paramName: "api_key",
});

Same authentication as the REST API is preferred

When possible, configure the connector's authentication to support both the MCP server and the app's REST API (if available). A Pack can only include a single type of authentication, and advanced connector features may require using the app's REST API to implement them.

User confirmation for actions

Go prompts users for confirmation before performing actions that mutate records or have side effects. An MCP tool will be considered such an action if the readOnlyHint annotation on the tool is any value other than true. See the ToolAnnotations type in the MCP specification for more information.