{"record":{"id":"9315c52c2c54ecdf","repo":"different-ai/openwork","slug":"mcp-server-not-found","errorCode":"mcp_server_not_found","errorMessage":"MCP server declaration not found on this config object.","messagePattern":"MCP server declaration not found on this config object\\.","errorType":"http","errorClass":"PluginArchRouteFailure","httpStatus":404,"severity":"error","filePath":"ee/apps/den-api/src/routes/org/plugin-system/store.ts","lineNumber":4887,"sourceCode":"    const declaredUrl = entries.get(row.binding.serverName)\n    if (!declaredUrl) return [row.binding.id]\n    return comparablePluginMcpRequirementUrl(row.connection.url) === comparablePluginMcpRequirementUrl(declaredUrl)\n      ? []\n      : [row.binding.id]\n  })\n  await deletePluginMcpRequirementBindingsByIds({ bindingIds: staleBindingIds })\n}\n\nfunction mcpRequirementServerFromVersion(input: {\n  configObject: ConfigObjectRow\n  serverName: string\n  version: ConfigObjectVersionRow\n}): PluginMcpRequirementServer {\n  const spec = parseConfigObjectVersionSpec(input.version)\n  const serverName = input.serverName.trim()\n  const entry = marketplaceMcpServerEntries(spec, input.configObject.title).find((candidate) => candidate.name === serverName)\n  if (!entry) {\n    throw new PluginArchRouteFailure(404, \"mcp_server_not_found\", \"MCP server declaration not found on this config object.\")\n  }\n\n  const url = readRecordString(entry.config, \"url\")\n  if (!url) {\n    throw new PluginArchRouteFailure(400, \"mcp_server_not_remote\", \"Only declared remote MCP servers with a URL can be configured.\")\n  }\n\n  return { config: entry.config, name: entry.name, url }\n}\n\nfunction configVersionOwnsImportedExternalMcpConnection(version: ConfigObjectVersionRow, connectionId: string) {\n  const spec = parseConfigObjectVersionSpec(version)\n  const metadata = isRecord(spec.metadata) ? spec.metadata : null\n  const recordedConnectionId = readRecordString(spec, \"externalMcpConnectionId\")\n    || (metadata ? readRecordString(metadata, \"externalMcpConnectionId\") : null)\n  const owned = spec.externalMcpConnectionOwnedByPlugin === true\n    || metadata?.externalMcpConnectionOwnedByPlugin === true\n  return owned && recordedConnectionId === connectionId","sourceCodeStart":4869,"sourceCodeEnd":4905,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-api/src/routes/org/plugin-system/store.ts#L4869-L4905","documentation":"Thrown as PluginArchRouteFailure(404, 'mcp_server_not_found') when resolving an MCP requirement server for a marketplace config object version. The code parses the config object version spec, collects all marketplace MCP server declarations via marketplaceMcpServerEntries(), and looks for one whose name equals the requested serverName (trimmed). A missing name means the requested server is not declared in that config version.","triggerScenarios":"Calling the API to configure/resolve an MCP requirement server passing a serverName that does not match any entry name in the given config object version — typo'd name, wrong configObject/version supplied, or the server declaration was removed/renamed in a newer version.","commonSituations":"Client cached an old server name after a marketplace config update; name compared against candidate.name after trimming, so whitespace is tolerated but case differences are not; requesting a local (non-remote) or stdio server entry by a stale name.","solutions":["List the actual declared entries (marketplaceMcpServerEntries output / marketplace MCP section of the config object) and use an exact matching name for serverName.","Verify you are pointing at the correct configObject and its latest version — the declaration may exist only in a different version.","Trim and fix case: the comparison is exact equality on the trimmed name, so match capitalization and spelling precisely.","If the server was intentionally removed, update the client/requirement manifest to stop requesting that server."],"exampleFix":"// before\nawait configureMcpServer({ version, configObject, serverName: \"Github MCP\" })\n// after (name matches a declared entry exactly)\nawait configureMcpServer({ version, configObject, serverName: \"github-mcp\" })","handlingStrategy":"validation","validationCode":"const declared = marketplaceMcpServerEntries(spec, configObject.title)\nif (!declared.some((s) => s.name === serverName.trim())) {\n  throw new Error(`Unknown MCP server '${serverName}'. Available: ${declared.map((s) => s.name).join(\", \")}`)\n}","typeGuard":"function isDeclaredServer(spec: ConfigObjectSpec, title: string, serverName: string): boolean {\n  return marketplaceMcpServerEntries(spec, title).some((s) => s.name === serverName.trim())\n}","tryCatchPattern":"try {\n  await configureMcpServer({ version, configObject, serverName })\n} catch (e) {\n  if (isPluginArchRouteFailure(e) && e.code === \"mcp_server_not_found\") {\n    // re-list declared entries and correct the name\n  }\n}","preventionTips":["Fetch and cache declared server names from the config object before configuring","Treat names as case-sensitive exact strings","Refresh cached names after marketplace config version updates","Keep a canonical registry of server names instead of free-text input"],"tags":["mcp","not-found","config","plugin-store"],"backgroundTag":"mcp-server-declaration-not-found","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}