continuedev/continue · error · Error

No MCP connection found for ${mcpId}

Error message

No MCP connection found for ${mcpId}

What it means

MCPContextProvider.getContextItems decoded an mcpId from the resource query, but MCPManagerSingleton has no live connection registered under that id. The MCP server was never started, failed to start, or was removed from config while the resource id still references it.

Source

Thrown at core/context/providers/MCPContextProvider.ts:74

  private insertInputToUriTemplate(uri: string, query: string): string {
    const TEMPLATE_VAR = "query";
    if (uri.includes(`{${TEMPLATE_VAR}}`)) {
      // Sending an empty string will result in an error, so we instead send "null"
      const queryOrNull = query.trim() === "" ? "null" : query;
      return uri.replace(`{${TEMPLATE_VAR}}`, encodeURIComponent(queryOrNull));
    }
    return uri;
  }

  async getContextItems(
    query: string,
    extras: ContextProviderExtras,
  ): Promise<ContextItem[]> {
    const { mcpId, uri } = MCPContextProvider.decodeMCPResourceId(query);

    const connection = MCPManagerSingleton.getInstance().getConnection(mcpId);
    if (!connection) {
      throw new Error(`No MCP connection found for ${mcpId}`);
    }

    const resourceuri = this.insertInputToUriTemplate(uri, extras.fullInput);
    const { contents } = await connection.getResource(resourceuri);

    return await Promise.all(
      contents.map(async (resource) => {
        if (!("text" in resource) || typeof resource.text !== "string") {
          throw new Error(
            "Continue currently only supports text resources from MCP",
          );
        }
        return {
          name: resource.uri,
          description: resource.uri,
          content: resource.text,
          uri: {
            type: "url",

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Confirm the MCP server is listed and connected in Continue's MCP settings/logs
  2. Fix the server launch command or package path so it starts successfully
  3. Re-insert the resource from the current MCP list rather than using a stale id
Defensive patterns

Strategy: validation

Validate before calling

const conn = MCPManagerSingleton.getInstance().getConnection(mcpId);
if (!conn) { /* re-establish or skip resource */ }

Type guard

function hasMcpConnection(mcpId: string): boolean {
  return !!MCPManagerSingleton.getInstance().getConnection(mcpId);
}

Prevention

When it happens

Trigger: Referencing an MCP resource id (@mcpId:resource-uri) whose server is not connected: server crashed at startup, connection closed, or the provider query uses a stale/wrong mcpId.

Common situations: MCP server command/path wrong so it never launches; server was disabled or renamed in config but slash-command history still references the old id; server disconnected mid-session.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/318bd29a3b08320a. Report an issue: GitHub.