Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(mcp-host): assert the oauth-context broker body the factory actually emits (R2-M3)

Diego Zacarias358b9f94b8fc
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index 8501ee49a..209ea04ec 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.284",
+ "version": "0.1.285",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.284",
+ "version": "0.1.285",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/sdk": "^0.32.0",
diff --git a/mcp-host/package.json b/mcp-host/package.json
index 2e705d6f2..fd458bb54 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.284",
+ "version": "0.1.285",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {
diff --git a/mcp-host/src/mcp/__tests__/brokerTokenProvider.test.ts b/mcp-host/src/mcp/__tests__/brokerTokenProvider.test.ts
index 6aeeef05e..cc0052f82 100644
--- a/mcp-host/src/mcp/__tests__/brokerTokenProvider.test.ts
+++ b/mcp-host/src/mcp/__tests__/brokerTokenProvider.test.ts
@@ -189,11 +189,16 @@ describe('createBrokerTokenProvider — fail-closed contract', () => {
await expect(p.resolve()).rejects.toThrow(/abort/i)
})
- it('grantScope=context subject POSTs contextId', async () => {
+ it('oauth-context subject POSTs no identity — control-api resolves the context server-side', async () => {
+ // The production factory (main.ts createMcpTokenProviderFactory) builds the
+ // oauth-context provider with an EMPTY subject `{}` — control-api keys the
+ // shared grant by server.spec.contextRef (authoritative) and mcp-host
+ // transports no context identity (invariant I1). Assert the shape the factory
+ // actually emits, not a contextId the host never sends (R2-M3).
const f = stubFetch(() => jsonResponse(200, { token: 'ctx-tok', expiresAt: null }))
- const p = createBrokerTokenProvider({ name: 'gh' }, { contextId: 'ctx-1' }, deps(f))
+ const p = createBrokerTokenProvider({ name: 'gh' }, {}, deps(f))
expect(await p.resolve()).toBe('ctx-tok')
- expect(bodyOf(f)).toEqual({ mcpServerName: 'gh', contextId: 'ctx-1' })
+ expect(bodyOf(f)).toEqual({ mcpServerName: 'gh' })
})
})