Skip to content

Fix: provide LoginTokenService to McpServerModule (hotfix for cloud outage) - #201

Merged
keysersoft merged 1 commit into
mainfrom
keysersoft/fix-mcp-server-login-token
May 18, 2026
Merged

keysersoft merged 1 commit into
mainfrom
keysersoft/fix-mcp-server-login-token

Conversation

@keysersoft

Copy link
Copy Markdown
Contributor

Root cause

`McpServerModule` registers its own copy of `RestEngine` and `GraphqlEngine` as providers (separate from `ConnectorsModule`'s registration). After PR #199 added `LoginTokenService` as a constructor dependency of both engines, `McpServerModule` could no longer resolve them — Nest throws `UnknownDependenciesException` at startup, the backend never reaches the `/health` endpoint, the container is killed by the unhealthy probe, and the cloud goes down.

Logs from `amcp-cloud-app`:

```
ERROR [ExceptionHandler] UnknownDependenciesException [Error]: Nest can't resolve dependencies of the RestEngine (OAuth2TokenService, ?). Please make sure that the argument LoginTokenService at index [1] is available in the McpServerModule module.
```

Fix

Add `LoginTokenService` to `McpServerModule`'s providers list, alongside the existing `OAuth2TokenService`. One-line change.

Test plan

  • `npm test` — 704 tests pass
  • After merge → rebuild image → redeploy → `amcp-cloud-app` becomes healthy → `https://cloud.anythingmcp.com\` reachable → Sorare adapter visible in catalog

McpServerModule registers its own copy of RestEngine and GraphqlEngine
as providers. After the Sorare PR added LoginTokenService as a
constructor dependency of both engines, McpServerModule could no
longer resolve them, causing UnknownDependenciesException at startup
and an unhealthy app container.

Adding LoginTokenService to McpServerModule's providers (alongside
the existing OAuth2TokenService) fixes the startup crash.

This is the root cause of the cloud outage following PR #199.
@keysersoft
keysersoft merged commit b81bf2f into main May 18, 2026
8 checks passed
@keysersoft
keysersoft deleted the keysersoft/fix-mcp-server-login-token branch May 18, 2026 13:57
keysersoft added a commit that referenced this pull request May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant